Manage Learn to apply best practices and optimize your operations.

Have Notes process move to rules for mail that doesn't come from the server

This tip describes how to make Notes process the move to rules for mail that doesn't come from the server.

Not all my mail comes from my company Domino Server , I also have mail coming from pop accounts I use often, "problem" is as the Mail Rules are used directly by Domino Router task when you retrieve mail from POP Accounts it doesn't get treated by the Mail Rules , I just needed a script to process the Move to folder rules so I designed one and there it is, either add an action button to the $inbox folder with formula @command([toolsrunmacro];"Dispatch") , then in one click you'll be able to dispatch all mail not processed by notes router


Agent Dispatch :

Sub Initialize
 ' Process Rules Locally
 ' This script is designed to have Notes process move to folder rules
 ' and only those rules , so that when you get mail from a pop account 
 ' and not via the server the mail is dispatched to the good folders according to the rules you set
 ' Script is designed to work with R5 & R6 English and French Mail Template It should be enhanced to process rules with more accuracy
 
 Dim s As New NotesSession
 Dim db As notesdatabase
 Set db = s.currentdatabase
 Dim corules As notesdocumentcollection
 Dim cosearch As String
 ' Get the existing rules
 cosearch = { SELECT Form*="(RulesDlg)":"Mailrule" & Enable="1" & @elements(ActionList)=1 & @contains(ActionList;"move to folder":"classer")}
 Set corules = db.Search(cosearch,Nothing,0)
 If corules.count > 0 Then
  Dim doc As notesdocument
  Set doc = corules.getfirstdocument
  Dim ev As Variant
  While Not (doc Is Nothing)
   ' We get the Folder to move the mail to
   ev = Evaluate ( {@right("} & doc.ActionList(0) & {";"move to folder")},doc)
   If ev(0) = "" Then 'Then French Template
    ev = Evaluate ( {@right("} & doc.ActionList(0) & {";"classer")},doc)
   End If
   'Now move the Mail to the folder
   Call doc.PutInFolder(ev(0),True)
   Call doc.RemoveFromFolder("($Inbox)") 'Remove it from inbox  
   Set doc = corules.getnextdocument(doc)
  Wend
  
 End If
 
End Sub

Dig Deeper on Domino Resources - Part 6

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