procmail
[Top] [All Lists]

Re: block mail by compairing word in subject

2005-04-29 05:34:08
On Fri, Apr 29, 2005 at 02:01:03PM +0200, Ruud H.G. van Tol wrote:

If a field can be empty, you can do

    H_SUBJ  # unset
    :0
    * ^Subject:.*\/[^  ].*
    { H_SUBJ = "$MATCH" }

Ja.  You wouldn't really even need to bother initializing
the var, in that case.  An empty Subject will return empty
in the action assignment.  An email without a Subject line
will leave H_SUBJ as it was before, i.e., undefined,
which for practical purposes in procmail is as if empty.

The initialization is nonetheless a good habit, as it's
deadly if forgotten when needed.  (And if you're running
complex stuff and can't remember if you previously set
H_SUBJ to something, well, that would be another reason,
but only for emails here that have a Subject header-field
but one that is empty.

-- 
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail