Friday, 29. September 2006

Enhanced mail rules - some minor tweaks
In case you missed it, this post is the result of
Smorgasblog from earlier in the week.
I am indebted to
Mark Schultz for his help in further enhancing the
D7 enhanced mail rules.
Mark's enhancements include:
- (RulesDLG) now defaults to more common values: OR function allows collection of similar rules in a single record; HELO seems to be one of the more common conditions to test; and initial focus is on the condition field.
- (RulesDLG) incorporates a comment field, which permits documentation of collected phrases for current and future admins.

- (Server Mail Rules) view has now been modified as well, and must be similarly protected against replacement by Design task. Each row now displays up to 9 lines of text to simplify review of larger rule collections; also, the comment column has been added to the far right of the view. Users may wish to tailor the width of these columns to fit their display. The font was reduced to allow more text to be displayed on the screen.

Download
Download the new enhanced mail rules template components here.
The fine print
- I offer absolutely no warranty 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. It has been further enhanced by Mark Schultz who, likewise, makes no warranty of any kind.
- For your information, this enhancement is working here on Domino 7.0.1 servers.
Installation
- 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 three, one form, one view and one script library) 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 Views and locate a view named (Server Mail Rules), alias Rules. Rename that form to (Server Mail Rules Backup) and delete the alias.
- Paste the (Server Mail Rules) view 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.
Use
See
this earlier piece for instructions on use which have not materially changed.
Removal
- 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, the view and the script library.
- Rename the backup form, view and script library and reinstate the alias on the renamed form and view.
- Recompile all LotusScript again.
Known Issues
There is a problem with the script library, which fails with an Illegal Function Call when the content of a test is null (e.g. "Blacklist tag is "); it nonetheless saves the rule, so long as there is only one clause in it. It will not allow you to save a rule with two such clauses.
Tests for null values are often quite useful (missing X-Mailer for example), so we have not attempted to duplicate the original behaviour from the unmodified Lotus template which will not permit null values at all.
Category: Domino: Administration
Technorati: IBM Domino Lotus Mail+Rules Notes