Lars Hecking lhecking at nmrc.ucc.ie writes:
Felix Tilley writes:
Can someone explain (either via the list, or via email reply) why this
recipe traps invalid message ID's? This recipe is rather bewildering to
me. I can't tell from the log file if really deletes spam. But I have
deleted only two genuine email messages in two years, so it must be benign.
# This will allegedly trap invalid message ID's
* !^Message-Id:[\t ]+<("[^"]+"|[^ <>@]+)@[^<>]*>$
Trashing email on the basis of bad Message-Id: is a bad idea.
The format of the Message-Id: header is defined in RFC 822, but some
MTAs do simply not generate fully compliant Message-Id:'s.
Even with a proper recipe, it is, as Lars stated, a bad thing to delete
mail based on message id violations. Not only do many mailers not
generate conforming ids, but many mailers which are capable of
generating conforming ids are often misconfigured by users. The idea
that one can delete, unseen, two otherwise valid messages and consider
that benign, acceptable behavior is scary for any use of email beyond
that of plaything.
For an excellent, human-readable understanding of the format of RFC 822
Message-Id:'s and translation into a regexp, search the procmail archives
for Philip Guenther's mail from Mar 19 1998 Subject: Re: bad message id's.
Philip's recipe is certainly the one to use. Note that the recipe Felix
posted exhibits both type I and type II errors: it rejects some valid
message ids, and accepts some invalid message ids. As examples:
< lhecking @nmrc.ucc.ie>
are valid, but would be rejected, while
<guenther(_at_)g a c .edu>
are invalid, but would be accepted. Philip's recipe handles these properly.
Rik Kabel Old enough to be an adult