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