Google Box
 News
  Tips Home :

How to drag and drop spam into junk mail filter using LotusScript

Doc TypeTips & Tricks
Email SettingMake Public
Email Addresssteve.robinson@notes411.com
Keep informed?Yes
AuthorSteven Charles Robinson
Company NameNotes411.com
CategoryLotusScript 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


Add Response   ||  Add a Document



Responses to "How to drag and drop spam into junk mail filter using LotusScript":

© 2003 notes411.com. All rights reserved. Disclaimer. site designed & developed by appsworks.com
Lotus Notes is a registered trademark of IBM. This site is not affiliated with IBM or Lotus.