Re: Help rule

[email protected] (Professional Software Engineering)
Newsgroups gmane.mail.procmail
Organization Professional Software Engineering
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.