procmail
[Top] [All Lists]

Re: convert all mails of a catch-all mailbox to html or .txt. files infolders named by the recipient

2007-08-30 13:50:09
LuKreme schreef:

  :0
  * $ ^To:$WS*\/[^$WS].*
  { TO=$MATCH }

    WS = "  "  #  two characters: an SPC and a TAB (ASCII-32 and
ASCII-9)
    :0
    *$ ^To:.*\/[^$WS].*
    { H_TO = $MATCH }


  :0
  * TO ?? ^\/[^(_at_)]+
  { TO_USER=$MATCH }

The value of your $TO could now be what is between the {} below:

   {"foo bar" <baz.(some comment)bla    }


So you really should use formail (or Bart's RFC822 address parser) to
extract a clean e-mail address from the To:.

For example:

  SENDER=|formail -b -rtzxTo:

See also http://www.professional.org/procmail/sandbox.html

-- 
Groet, Ruud
____________________________________________________________
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