Re: Help rule
Robert Bonomi <[email protected]>
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
> Date: Fri, 01 Apr 2011 09:53:51 -0300 > From: Marcio_Luciano_Donada <[email protected]> > To: [email protected] > Subject: Help rule > > I would help of experts in a procmail. I want to get a message that it > has the header X-Amavis-Alert and change the subject of it, is this > possible? My idea would be: > > :0: > * ^X-Amavis-Alert:BAD HEADER, > $MAILDIR/Maildir/.Spam/ > > My question is how to change the subject of the message Procmail, itself, doesn't do that. You have to pipe the messge through a 'filter' that makes the changee. e.g.: :0 fhw * ^X-Amavis-Alert:BAD HEADER, | sed -e "/^Subject: /& {{added text}} /I" :0 A $MAILDIR/Maildir/.Spam/ This will change "Subject: Some Text" to "Subject: {{added text}} Some Text" > and do not know > if he'll understand BAD HEADER (it has a space in it). Yes, procmail _does_ understand regex patterns that have whitespace in them _most_ of the time. Trailing whitespace characters ares tripped, So if you want a space as the *last* thing in a pattern, you have to use something like "some text[ ]" instead of "some text ".