Unfortunately there is no easy way to add your own “custom” rules that e.g. react on mail headers or on other fields. I always used the way to customize the mail template to allow my own filtering using rules.
Here are the places you have to change:
Step 1: Modify Form “(RulesDlg)”
In order to create a new rule “is Spam” you need to modify the field “condition” and add a new list entry e.g. “is Spam|S”.
In addition you need to modify the hide-whens of the fields “logic“, “string”, “importance” and “fieldlist” so that they are hidden when condition = “S”.
Step 2: Modify LotusScript-Library “Rules” or “Rules_xx-XX”
There are two places you need to modify:
Function “FieldString”:
This function is used to calculate the “description” of the rule in rules views.
in select case add one more case:
Select Case strValue
...
Case “S”:
FieldString = "is marked as Spam"
Function “ConditionParser”
This is used to create the formula to “select” if a document matches the rule.
In last “Select Case COND_sCondition” add one more case:
Select Case COND_sCondition
...
Case "S":
s_MAINFORMULA = s_MAINFORMULA+ |(@Contains( YourHeaderItem; "Is_Spam: yes" )|
Just replace “YourHeaderItem” with the item name where the spam information is stored.
If you need any further assitance feel free to ask.
Of course this is the most “basic” approach to the problem with a solution for exactly your need. You could make this more “general” by adding more configuration options, but then of course the code changes will be way more complicated.
One could add a generic “field contains value”- rule like this, but as said: this is much more work to do…
One downside of this approach: Whenever you open a ticket with HCL you will have to switch back that database to the “default” mail template and reproduce the issue because otherwise support will blame the problem on your custom template, even if the modifications have nothing to do with the reported problem.