procmail
[Top] [All Lists]

Re: identifying no "From" header

2005-07-28 03:45:12
On Sun, Jul 24, 2005 at 09:31:27AM -0600, Lloyd Standish wrote:

I also tried doing the check of missing "From:" (and emtpy from,
etc.) using scoring, like this:

:0
* 1^0 ^From:([ ]$|$)
* 1^0 !^From:
* 1^0 ^From:.*<>
/dev/null

This is very straightforward and it should trash any mail with no
from line at all.  But it still passed mails that show no from
line at all in the headers.


I got behind in this list, because I was out of town for a few
days.  I have read some of the follow-ups to this post.  But I
haven't yet seen the simplest, to my knowledge, way of catching an
empty or blank or just-angle-brackets header.  This is it:


  :0:  # brackets contain caret, space, tab, angles
  * ! ^From:.*[^        <>]
  /dev/null


The double-negation is the key: a "bang" ("not") condition
and a "not" character-class.


As a side note, in some of the relatively sophisticated
algorithms I'm constructing currently in procmail, I keep
seeing over and over and over again what a wonderful invention
this "not" concept really was in human logic.  :-)

Dallman

____________________________________________________________
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