Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Strategies > Email Management (60 articles)
   Using the Notes Client with Gmail
   Using the Notes client with Hotmail (or not)
   Is English-only a viable mail management strategy?
Home > Lotus Technologies > Domino (77 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   Sloppy analysis at the core of another Domino vs. SharePoint report
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login