 |
 |
| Domino Tips: |
|
 |
 |

AGENT
Have Notes process move to rules for mail that doesn't come from the server
Thomas Ozenne 11.26.2002
Rating: --- (out of 5)




|
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
Code
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
 |

|
Rate this Tip
|
To rate tips, you must be a member of SearchDomino.com. Register now
to start rating these tips. Log in if you are already a member.
|


');
// -->
DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.
|
 |
|
|
 |
|
 |
 |
 |
 |
| TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of . |
|
| |
All Rights Reserved, , TechTarget |
|
|
|
|
|