Manage Learn to apply best practices and optimize your operations.

Mail rules for POP mail

This tip describes the rules for POP mail.

Each day I get mail from pop accounts to my mail box , but as you may have noticed Mail Rules are applied on the Domino Router not in Mail dbs , to have Lotus Process my rules for the non server incoming mail I did setup a small agent which if able to process simples rules ( multiple Field contains selection & single Action move to folder ...). Paste the code in a new agent in your mail db have it run against all new modified documents and here you go:


Sub Initialize
 'This scrip will process locally Simple mail rules based on a 
condition and simple Move to folder actions 'Works with R6 mail template english , should work in R5
'For other language this would require a few more Replacesubstrings Dim lang As String lang = "move to folder" Dim s As notessession Dim db As notesdatabase Set db = New notesdatabase("","") Dim vue As notesview Set vue = db.GetView("(Rules)") Dim inbox As notesview Set inbox = db.GetView("($Inbox)") Dim mrules As notesdocument Dim valu As String Dim qry As String Dim temp As Variant Dim col2 As notesdocumentcollection Set mrules = vue.GetFirstDocument If mrules Is Nothing Then Print "No rule to process" Exit Sub End If Do While Not mrules Is Nothing If Instr(mrules.actionlist(0),lang)>0 Then movefolder= Trim(Strrightback(mrules.actionlist(0),lang)) qry = "" Forall a In mrules.conditionlist valu = {temp:=@ReplaceSubstring("} & a &
{";"Sender";"FROM");@If(@Contains(temp;"AND");"
AND "+@ReplaceSubstring(temp;"AND";"Field ");@Contains(val;"OR");" OR "+@ReplaceSubstring(temp;
"OR";"Field ");"Field " + temp)}
temp =Evaluate(valu) qry = qry & " " & temp(0) End Forall Set col2 = db.Ftsearch(qry, 0, 0) If col2.Count > 0 Then Call col2.PutAllInFolder(movefolder,False) Call col2.RemoveAllFromFolder("($Inbox)") End If End If Set mrules = vue.GetNextDocument(mrules) Loop End Sub

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close