procmail
[Top] [All Lists]

Re: Picking Off Sender's Address

1997-06-30 11:03:00
era eriksson <era(_at_)iki(_dot_)fi> wrote:
 $ echo "From: (this is a vicious <comment(_at_)here>) moo luser 
<moo(_at_)iki(_dot_)fi>" | 
 > formail -rtzxTo:
 moo(_at_)iki(_dot_)fi

You can probably break it with judiciously placed escaped backslashes
and stuff like that but this generally is not encountered in real life
(famous last words).

The formail from the procmail v3.11pre7 package gets all the examples
in my addressing FAQ right and every other syntactically correct obscure
case I fed it, so it is probably pretty reliable.

  $ formail -rtzxTo:
  From: <"(Hi) me(_at_)here(_dot_)com"@jffj.foo 
(<neener(_at_)wow(_dot_)ool>\\)> (n(_at_)asty(_dot_)stu(_dot_)ff)
  ^D
  "(Hi) me(_at_)here(_dot_)com"@jffj.foo

  $ formail -rtzxTo:
  From: <\"\(Hi\)\ me\(_at_)here(_dot_)com\"@jffj.foo\ 
\(\<neener\(_at_)wow(_dot_)ool\>\\\)> \
          (n(_at_)asty(_dot_)stu(_dot_)ff)
  ^D
  \"\(Hi\)\ me\(_at_)here(_dot_)com\"@jffj.foo\ 
\(\<neener\(_at_)wow(_dot_)ool\>\\\)

If you don't know, trust me when I say both of those are RFC 822 valid.
The domain name is not valid, but it shouldn't be part of formail's job
to check that.

There doesn't seem to any real attempt to recover from bad addresses,
however.

  $ formail -rtzxTo:
  From: \\(oops)ifi(_dot_)ki(_at_)oom(_dot_)moo
  ^D
  \\

This is not unreasonable, but I think it merits mentioning.

Elijah
------
Please do not CC me when replying to the list.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.