[prev in list] [next in list] [prev in thread] [next in thread] 

List:       procmail
Subject:    Re: Help rule
From:       PSE-L () mail ! professional ! org (Professional Software Engineering)
Date:       2011-04-01 17:35:34
Message-ID: 201104011735.p31HZWiV010341 () trei ! professional ! org
[Download RAW message or body]

At 08:37 2011-04-01, Robert Bonomi wrote:

>Procmail, itself, doesn't do that.  You have to pipe the messge through
>a 'filter' that makes the changee.  e.g.:

Formail is a tool which is part of the procmail distribution.  Header 
rewriting is a big part of what it is used for.



# grab subject.  Best to not incorporated this into the same recipe as your
# header rewrite, in case there's NO subject, which would result in the
# filter condition NOT executing.
# As written, this eliminates leading whitespaces.
:0
* Subject:[     ]*\/[^  ].*
{
         SUBJECT=$MATCH
}

# I don't use amavis, but I suspect it may place several tags in the header,
# and there's probably whitespace before the first one, so check your regexp.
:0
* ^X-Amavis-Alert:BAD HEADER
{
         :0f
         | formail -I "Subject: [BAD HEADER] $SUBJECT"

         # maildir wouldn't use locking flag.
         :0
         $MAILDIR/Maildir/.Spam/
}

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail@lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic