Out Of Stack Space

This is a before mail arrives agent. Just moved mail files to my new r6.5 server.

It keeps triggering out of stack space errors. I have 3 versions of this agent, another one copies the doc to an archive dbs, different dbs for different groups)

Never had his error before on my 5.12 server

Anyone have suggestions?

Sub Initialize

Dim session As New NotesSession 

Dim note As NotesDocument

Dim dbug As NotesLog

Dim db As NotesDatabase



Set db = session.CurrentDatabase

’ Log steps in our processing for debug purposes

Set dbug = New NotesLog("SPAM log")

dbug.LogActions = True

dbug.OpenAgentLog

dbug.LogAction("begin")

’ Make sure we have the note set correctly

If db Is Nothing Then dbug.LogAction("DB not set") Else dbug.LogAction("DB set")

Set note = session.DocumentContext

If note Is Nothing Then dbug.LogAction("Note not set") Else dbug.LogAction("Note set")

’ Note the Subject of all messages

dbug.LogAction("Subject: " + note.Subject(0))

’ Is this message has the special subject, store it in the special folder

subject = note.Subject(0)

If (Instr(subject, "-SPAM")) Then

	dbug.LogAction("Found -SPAM in subject")

	If (note.hasItem("X_Spam_Score")) Then

		dbug.LogAction("Found SA score")

		tmpScore  = note.X_Spam_Score(0)

		note.SpamScore = tmpScore

		Call note.Save(True, False, False)

	End If

	Call note.PutInFolder( "SPAM",True )

	dbug.LogAction("put in folder SPAM")

	Call note.RemoveFromFolder("($InBox)")

	dbug.LogAction("remove from Inbox")

End If



dbug.LogAction("done")

dbug.Close 		

End Sub

Subject: Out Of Stack Space

Are you getting the same workload on the new R6 server? Meaning it could be that the new mail is coming in faster than the “before new mail” agent can keep up with it.

Subject: RE: Out Of Stack Space

This is a much better server. I’m going to check the ini files on the old server and the new one just to see.

Is there any way I can improve on that script in the mean time?

Subject: RE: Out Of Stack Space

You’ll also want to check the number of concurrent agents that your new server is running…

Alternatively you seem to be doing some spam processing (moving anything tagged in the subject line from the inbox to a junk mail folder).

Could you possibly consider using mail rules to do this? This should be quicker than getting the agent manager involved and should scale better (well relativley speaking…)

Also the folder operations in LotusScript are very very VERY slow, i.e., it can take 2-3 seconds or more per moving in/out to/of folders, so that could be adding to the delay.

Has the volume of mail that the agent is processing gone up? This might not have been the case on your old 5.0.12 server but may be the case on your new server.

Generally “before new mail” agents are tricky as you are finding out…

Regards,

Mike Robinson

http://www.invcs.com