Home > Domino Tips > Developer > Agent > Have Notes process move to rules for mail that doesn't come from the server
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

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)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Agent
Quickly scan all databases on a Lotus Domino server
Run or restart Notes/Domino agents via text messages
Approve Lotus Notes documents using a BlackBerry mobile device
LotusScript agent indexes Lotus Notes/Domino databases
Open documents in Lotus Notes from the Web without a UNID
Fix and update Lotus Notes documents with limited access
Verify scheduled agent status with Domino Extensible Language (DXL)
How to export data from a Lotus Notes database to a CSV file
Enable or disable scheduled agents without opening the Lotus Notes database design
Creating custom views in Lotus Notes databases

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
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 technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts