PermaLink Enhanced Mail Rules on D7

Update 29 Sep 2006 - There's an alternative version here incorporating some minor UI tweaks. Either version should work well for you on D7, subject to the disclaimer below...



Here's what you've been waiting for. A version of the enhanced mail rules that works on D7.

This version is based on new LotusScript code in the PAB template that shipped with D7. The LotusScript for processing mail rules has changed significantly and the enhanced rules are rewritten to be consistent with the new script library.

Changes since last time are:

  1. No support for SpamAssassin is included - I wasn't using it anyway and for some reason I couldn't get it to work. I may try again if there is a desperate need.

  2. In addition to being able to build rules on DNS Blacklist and DNS Whitelist (both now natively supported in D7), you can build rules that act on the source IP of a message, the phrase used in HELO/EHLO and header fields X-Mailer, X-Unsent, several antivirus headers that are frequently forged and FCC which is only ever seen in phishing emails.

The fine print

  • I make absolutely no warranty express or implied concerning this download. You use it entirely at your own risk.

  • I am not the original author of this code, just a grateful user and sometime hacker who has adapted it to D7. Original authorship belongs to Daniel Koffler who, it is entirely reasonable to assume, also makes no warranty of any kind.

  • For your information, this enhancement is working here on Domino 7.0 servers.

How to install it

  • Take a backup of your Domino Directory.

  • Do NOT just replace the design of your Domino Directory with the downloaded template - it is only a template (.ntf) at all to make it easier to download.

  • Sign all the elements on the downloaded template (there are only two) with an ID used to administer your server(s).

  • Open your Domino Directory in Designer and locate a form named (RulesDlg) alias Mailrule. Rename that form to (RulesDlgBackup) and delete the alias.

  • Paste the (RulesDlg) form from the downloaded template into your Domino Directory.

  • Still in Domino Designer, switch to Shared Code, Script Libraries in your Domino Directory and locate a LotusScript library named Rules. Rename this to RulesBackup.

    [Afterthought: it may be necessary to delete the existing Rules script library to avoid conflicts with the replacement. If this is so, keep a backup of the old Rules script library by creating an empty .nsf database and pasting a copy there.]

  • Paste the Rules LotusScript library from the downloaded template into your Domino Directory.

  • Finally, still in Designer and with your Domino Directory open, select menu option Tools / Recompile all LotusScript.

How to use it

You now have the ability to create server mail rules that act on additional information to be found in the MIME headers of inbound messages.

Try creating test rules using this additional information until you get a feel for what can be achieved. For the purposes of illustration below, 192.168.0.1 and mailhost.example.com should be taken to mean the public IP and DNS name of your own Domino server(s). Examples of rules currently working well here include:

  • When X-Mailer contains The Bat! [choose an action] - this rule may need to be tuned by adding additional conditions for negative filtering to eliminate false positives.

  • When HELO is 192.168.0.1 OR HELO is mailhost.example.com do not accept message.

  • When X-Antivirus contains skaner antywirusowy poczty Wirtualnej Polski S. A. move to database spamtrap.nsf

    There are several further variations on this theme which collectively are currently identifying nearly 2/3 of all spam that makes it past protocol level blocks here.

How to remove it

  • IMPORTANT - it is not necessary to delete rules using the enhanced mail rule functionality from your PAB - they will continue to work after you remove the enhancement but you will not be able to edit them. If unsure, delete them first.

  • Delete the form and the script library.

  • Rename the backup form and script library and reinstate the alias on the renamed form.

  • Recompile all LotusScript again.

I am using the original D6.x enhanced mail rules - what now?

  • If you upgrade to D7 and replace the design of the Domino Directory with the standard 7 one then the enhancements will be lost and you will not be able to create new enhanced rules.

  • However, existing rules created with the original enhancement will continue to work as they are stored as complete formulae using @ functions.

  • After you apply the new enhanced rules to your upgraded Domino Directory you can create new enhanced rules and these will will coexist with the old ones - that is, both will work.

  • You may also edit old enhanced rules in an upgraded directory and they will be saved in the new, slightly more efficient form.

  • Mixed version users note: DO NOT attempt to use this new version on a Domino Directory based on any template version earlier than 7 (rules themselves will work on 6.x servers but must be created on a replica of the PAB hosted on a D7 client or server). If you are running a mixed 6/7 environment then the Domino Directory should be using the 7 template anyway.

Good luck. Feedback welcome. I would especially like to hear from people who have constructed successful rules. If we share we can all benefit.



Category: Domino 7
Technorati:

Comments :

TrackBack From Chris Brandlehner06/02/2006 13:58:07


Customize Domino Mailrules

how to add custom actions to a mailrule.




2. Ray28/02/2006 14:28:43
Homepage: http://www.rayd.co.uk


Hi Chris,

Thanks for the download. Works a treat. Now, if we could only find a way to transfer rules form one server domain to another!




3. Chris Linfoot28/02/2006 14:59:43


What we need is an OpenNTF replication hub.




4. Florian Steinel19/06/2006 15:55:24


I'm now using this procmail receipt:
^X\-Mailer\: The Bat\! \(v[0-9]\.[0-9][0-9]\.[0-9][0-9]\) [A-F0-9]+
to catch Spam with
X-Mailer: The Bat! (v1.11.00) AA1AA1111A1A1111
do you also get Spam with an trailing Hexnumber?




5. Florian Steinel19/06/2006 15:56:40


s/trailing/trailed/




6. Chris Linfoot19/06/2006 16:33:14


s/receipt/recipe

Trailing/trailed hexnumber? No, but I do see something similar...

http://chris-linfoot.net/d6plinks/CWLT-6Q6BUA




7. Fabrice Papirnyk07/09/2006 10:52:11


May I use these enhanced rules with a Directory in any other language than English ? Thanks.




8. Chris Linfoot07/09/2006 11:36:02


Interesting question. My honest answer is I don't know. I've never tried it.

I see no reason why it shouldn't work but

a) the UI mods would be in the wromg language unless you modified the code,
b) you should test it thoroughly and
c) you do all of this entirely at your own risk!




Unable to post a comment? Please read this for a possible explanation...
Add Manual Trackback
Please enter the details of the trackback post. Your trackback will not appear on the site until it has been verified. This won't be immediate, as trackbacks are validated on a scheduled basis. Be patient.











Search
Hot Categories
Monthly Archive
Links
Contact Me
Subscribe
Subscribe to articlesArticles

Subscribe to commentsComments

Visitor Locations
Hosted by