procmail
[Top] [All Lists]

Re: Alter subject line and then resend - eeek!

2006-04-14 11:35:37
This isn't what you asked, and maybe there's a reason you can't do it
this way, but SpamAssassin has an option (which can be set per-user)
to rewrite the subject line as desired.  Look for the rewrite_header
setting in 3.0 and later.

On Fri, 14 Apr 2006, Brett Charbeneau wrote:

Gentlefolks,

      I've scoured the list archives and Google to try and find out what I'm
doing wrong, but I'm left scratching my head. Doh!
      I'd be very grateful for any help anyone can find the time to offer.
      BACKGROUND: I've got a handful of Outlook users who have individual
SpamAssassin installations on my mail server. I'd like to use a procmail 
script
to run incoming mail through SA and, if marked as spam, alter the Subject line
so that Outlook filters will stick these messages into a specific folder.
      Can anyone please tell me how I can get procmail to NOT skip my formail
statment - I'd like it to alter that Subject line and then just plop the 
message
into the user's  /var/spool/mail file (their inbox).
      Here's the recipe I'm playing with:

:0fw: spamassassin.lock
| /home/mjohnson/sausr/bin/spamassassin
:0e
{
  EXITCODE=$?
}
:0
* ^X-Spam-Status: Yes
| formail -I "Subject: [Spam?] $SUBJECT"


      Here's what the log says on a successful spam detection:

procmail: Assigning "INCLUDERC=/home/mjohnson/Procmail/rc.spam"
procmail: Locking "spamassassin.lock"
procmail: Executing "/home/mjohnson/sausr/bin/spamassassin"
procmail: [15109] Fri Apr 14 10:30:58 2006
procmail: Unlocking "spamassassin.lock"
procmail: Match on "^X-Spam-Status: Yes"
procmail: Skipped "| formail -I "Subject: [Spam?] $SUBJECT""
procmail: Locking "/var/mail/mjohnson.lock"
procmail: Assigning "LASTFOLDER=/var/mail/mjohnson"
procmail: Opening "/var/mail/mjohnson"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/mail/mjohnson.lock"
procmail: Notified comsat: "mjohnson(_at_)2425970:/var/mail/mjohnson"
From genuine_really(_at_)yahoo(_dot_)com  Fri Apr 14 10:30:53 2006
 Subject: Test
  Folder: /var/mail/mjohnson                                               
4428




-- 
Public key #7BBC68D9 at            |                 Shane Williams
http://pgp.mit.edu/                |      System Admin - UT iSchool
=----------------------------------+-------------------------------
All syllogisms contain three lines |              shanew(_at_)shanew(_dot_)net
Therefore this is not a syllogism  | www.ischool.utexas.edu/~shanew

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>