|
|
|
|
|
|
|
|
|
|
|
|
|
|
Hacking Domino mail rules to fight spam (continued)
FIGURE G
 
Create mappings between new entries on the Mailrule form and in the Rules library (Declarations) object. Roll over picture for a larger image.
Step 3: Adjust conditional logic You'll recall from step 1 that our new condition based on the Spam Assassin Score of a message (option K) is numeric, as were options C, H & F. This will require tweaking the LogicString function in the Rules library. Navigate to the function and you will see two "if" statements that check to see if condition C, H or F is being used. Add an entry to each if statement for option K. Your code should match the listing in Figure H.
FIGURE H
 
Your code should match the modified LogicString function in the Rules library. Roll over picture for a larger image.
Step 4: Condition parser The ConditionParser function consists of three "Select Case" statements that allow the Mailrule form to convert a user's entered options into a Domino Formula suitable for the $FilterFormula field. The first "Select Case" function retrieves a formula that will be used in the SELECT statement of the $FilterFormula field. You will need to add one entry for each new condition created in step 1. Following "Case I", add these lines of code:
Case "J"
FieldString = "$DNSBLSite"
Case "K"
FieldString = "@If(@IsError(@TextToNumber(X_Spam_Score));0;@TextToNumber(X_Spam_Score))"
Case "L"
FieldString = "X_Spam_Report"
Case "M"
FieldString = {@Right(@Left(Received;"])"); "([")}
Case "N"
FieldString = {@Right(@Left(Received;" (["); "from ")}
|
You can see how this fits in Figure I.
FIGURE I
 
Here's where it all fits into the ConditionParser code. Roll over picture for a larger image.
Case J takes advantage of the fact that Domino tags messages from blacklisted sources by adding a field named $DNSBLSite to the message. The value of the field is the blacklist the mail source was found in. By using the name of this field as the formula for condition J, you will be able to test the contents of this field in a mail rule (see http://www.dominopower.com/issues/issue200308/00001080001.html for more info on Domino DNS blacklisting).
When Domino processes messages with MIME headers it doesn't recognize, it converts these headers to fields of the same name. This allows you to treat any MIME header as a fieldname in the ConditionParser code and allows us to integrate Spam Assassin with Domino through options K and L which are based on X-MIME headers added by Spam Assassin. Any third party application that tags a message with MIME headers can be integrated with Domino in this manner.
Condition K is our numeric Spam Assassin Score from step 1, so our formula in ConditionParser must always evaluate to a number. The @IsError function ensures that a number is always returned. Cases M and N return formulas that parse a message's Received field to extract the sender's source IP address and helo command hostname respectively. The curly brackets are used around the last two formulas to allow the use of quotes inside the formulas without the need for escaping them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- 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. |
|
|
|
|
|
|
|
|
|
|