procmail
[Top] [All Lists]

Re: Why does this trap invalid Message-IS's?

1998-08-25 10:35:49
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
:0
* !^Message-Id:[\t ]+<("[^"]+"|[^ <>@]+)@[^<>]*>$
/dev/null

 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:
  <rik."not rick"(_dot_)kabel(_at_)netcom(_dot_)com>
  < lhecking @nmrc.ucc.ie>
are valid, but would be rejected, while
  <david.not.dave.tamkin@>
  <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              
rik(_at_)netcom(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>