| Doc Type | Tips & Tricks |
| Email Setting | Make Public |
| Email Address | steve.robinson@notes411.com |
| Keep informed? | Yes |
| Author | Steven Charles Robinson |
| Company Name | Notes411.com |
| Category | LotusScript Mail, SMTP, Spam, Junkmail |
| Modified | 26/04/2007 23:07:26 |
| Subject | How to drag and drop spam into junk mail filter using LotusScript |
Add this code to the $inbox folder to auto
add senders (spammer) domain of selected document in inbox. Useful for
when junk mail filter is turned on. Notes will then be able to filter these
domain into your junk mail folder.
Sub Click(Source As Button)
Dim session
As New NotesSession
Dim db
As NotesDatabase
Dim collection
As NotesDocumentCollection
Dim doc
As NotesDocument
Set db
= session.CurrentDatabase
Set collection
= db.UnprocessedDocuments
Set doc
= collection.GetFirstDocument()
'Get
the profile document and load fields into
Dim ProfileDoc
As NotesDocument
Set ProfileDoc
= GetProfile(db,"CalendarProfile")
Dim item
As NotesItem
Set item
= ProfileDoc .GetFirstItem( "$Filter_BlockAddressList" )
Dim sCurrentList
As String
Forall
v In item.Values
'Messagebox( v )
sCurrentList = sCurrentList & ";"
& v
End Forall
Msgbox(sCurrentList)
Dim sMessage
As String
Dim sOriginator
As String
Dim NotesMacro$
While
Not(doc Is Nothing)
sOriginator = doc.SMTPOriginator(0)
NotesMacro$ = |@right("| & sOriginator
& |";"@")|
'Msgbox(NotesMacro$)
Result = Evaluate(NotesMacro$, doc)
'Msgbox("@" & Result(0))
If Instr(Lcase(sCurrentList),Lcase("@"
& Result(0))) = 0 Then
Call item.AppendToTextList(
"@" & Result(0) )
'Msgbox(Lcase(sCurrentList))
'Msgbox(Lcase(sOriginator))
End If
Set doc = collection.GetNextDocument(doc)
Wend
'NotesMacro$
= |@unique($Filter_BlockAddressList)|
'Result
= Evaluate(NotesMacro$, Profiledoc)
Call
ProfileDoc.Save(True,False)
End Sub
|