It uses a new r6 feature of lotusscript to get the received header information so that spamcop will know exactly where the email came from at each hop. This is important as they use this for their black lists so that the correct servers are blocked while the innocent receiving servers are not.
It is also important to list your allowed hosts with spamcop so that if it routes through some of your servers then these will not be treated at open relays.
Dim s As New notessession
Dim dc As NotesDocumentCollection
Dim db As notesdatabase
Dim doc As notesdocument
Set db = s.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
While Not(doc Is Nothing)
Dim text As String
text = ""
Forall t In doc.GetReceivedItemText
text = text + "Received: " + t + Chr(10)
Forall it In doc.Items
If it.name <> "Received" Then
text = text + it.name + ": " + it.text + Chr (10)
Dim mail As notesdocument
Set mail = db.CreateDocument
mail.form = "memo"
mail.subject = "Spam to report"
mail.body = text
Call mail.Send(False, "email@example.com")
Call mail.Send(False, "quick.[yoursecretkeyhere]@spam.spamcop.net")
'You can then save or just delete it here
Call doc.Save(True, False)
Set doc = dc.GetNextDocument(doc)
Like this article? Digg it!