|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hacking Domino mail rules to fight spam (continued)
The second "Select Case" function in ConditionParser chooses the logical operator for use in the mail rule. Here again you must make sure numeric options are differentiated from text ones, so you must add the appropriate conditions for option K as illustrated in Figure I above, and further below in the next "Select Case" function as shown in Figure J.
FIGURE J
 
Add numeric context for option K in ConditionParser. Roll over picture for a larger image.
Step 5: Adding descriptive text
Navigate to the GetString function in the Rules library and you will see a "Select Case" statement that retrieves descriptive text for each mail rule condition via the constants defined in the library's (Declarations) object (see step 2). Simply, add the appropriate cases for your custom options as shown in Figure K.
FIGURE K
 
Finally, add descriptions for your custom options. Roll over picture for a larger image.
Step 6: Cleaning up Ok, you're done mucking about in the Rules library. Save it, and then recompile all the LotusScript in the database by selecting the option in the tools menu of Designer. Next open your modified database in the Notes client or Domino Administrator and add a new mail rule. You'll notice your custom options are now available when creating new rules. The rules illustrated in Figure A implement each of the new features we set out to create.
To see how everything has come together, let's examine the $FilterFormula for the rule "When Spam Assassin Score is more then 9 change routing state - mark as held". The formula that gets created is:
SELECT @If((@If(@IsError(@TextToNumber(X_Spam_Score)); 0; @TextToNumber(X_Spam_Score) ) > 9 ); ( @Do( @SetField( "RoutingState"; "HOLD" ); @SetField( "RoutingStateBy";"2" ) ) ) ; "")
|
You can easily see how the selection formula we entered in step 4 has been used by the Mailrule form to construct this formula. Congratulations, now go filter some spam!
Colin Neale is a Domino consultant specializing in document management and search solutions and is also an IBM Certified Instructor for Lotus Domino. Colin has also developed the C-Search range of products and can be contacted at cneale@c-search-solutions.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|