Detecting a blank header in the content filter

Posted on June 17, 2009
Filed Under MDaemon | 2 Comments

The content filter has a condition to trip if a header doesn’t exist.  However, there is no easy way to catch a header with no content at all.

This rule will trip on a blank subject header (where the header DOES exist, but has no content)

[Rule001]
RuleName=If subject is NOT empty, Skip next rule
Enable=Yes
ThisRuleCondition=All
ProcessQueue=LOCAL
Condition01=SUBJECT|reg exp|AND|^..+$|
Action01=skip rule|"1"
[Rule002]
RuleName=Subject IS empty!
Enable=Yes
ThisRuleCondition=All
ProcessQueue=LOCAL
Condition01=SUBJECT|exists|AND|
Action01=move to bad Msg|

UPDATE 2009/06/17: For some reason this rule was completely broken, both by WordPress inserting smartquotes, and a logic error. My apologies, it has been corrected and tested on MDaemon 10.0.5, it should now work as advertised.

Comments

2 Responses to “Detecting a blank header in the content filter”

  1. Noy on June 22nd, 2011 12:05 pm

    Got this from [md-cfilter] reject “no subject”
    This works for messages with blank subjects

    emails – outbound
    RuleName=Blank
    Enable=Yes
    ThisRuleCondition=All
    ProcessQueue=BOTH
    Condition01=SUBJECT|reg exp|OR|^ *$|
    Action01=move to bad Msg|

  2. Dave Warren on June 22nd, 2011 12:11 pm

    Noy,

    This is true, if the subject header contains a space like this: “Subject: “, however if the subject has no trailing space (like “Subject:”) then the “^ *$” format fails to trip.

Leave a Reply