procmail
[Top] [All Lists]

Re: Alter subject line and then resend - eeek!

2006-04-14 08:26:54
On Fri, 14 Apr 2006, Brett Charbeneau wrote:

BC> Gentlefolks,
BC> 
BC>     I've scoured the list archives and Google to try and find out what I'm 
BC> doing wrong, but I'm left scratching my head. Doh!
BC>     I'd be very grateful for any help anyone can find the time to offer.
BC>     BACKGROUND: I've got a handful of Outlook users who have individual 
BC> SpamAssassin installations on my mail server. I'd like to use a procmail 
script 
BC> to run incoming mail through SA and, if marked as spam, alter the Subject 
line 
BC> so that Outlook filters will stick these messages into a specific folder.
BC>     Can anyone please tell me how I can get procmail to NOT skip my formail 
BC> statment - I'd like it to alter that Subject line and then just plop the 
message 
BC> into the user's  /var/spool/mail file (their inbox).
BC>     Here's the recipe I'm playing with:
BC> 
BC> :0fw: spamassassin.lock
BC> | /home/mjohnson/sausr/bin/spamassassin
BC> :0e
BC> {
BC>    EXITCODE=$?
BC> }
BC> :0
BC> * ^X-Spam-Status: Yes
BC> | formail -I "Subject: [Spam?] $SUBJECT"
BC> 
BC> 
BC>     Here's what the log says on a successful spam detection:
BC> 
BC> procmail: Assigning "INCLUDERC=/home/mjohnson/Procmail/rc.spam"
BC> procmail: Locking "spamassassin.lock"
BC> procmail: Executing "/home/mjohnson/sausr/bin/spamassassin"
BC> procmail: [15109] Fri Apr 14 10:30:58 2006
BC> procmail: Unlocking "spamassassin.lock"
BC> procmail: Match on "^X-Spam-Status: Yes"
BC> procmail: Skipped "| formail -I "Subject: [Spam?] $SUBJECT""
BC> procmail: Locking "/var/mail/mjohnson.lock"
BC> procmail: Assigning "LASTFOLDER=/var/mail/mjohnson"
BC> procmail: Opening "/var/mail/mjohnson"
BC> procmail: Acquiring kernel-lock
BC> procmail: Unlocking "/var/mail/mjohnson.lock"
BC> procmail: Notified comsat: "mjohnson(_at_)2425970:/var/mail/mjohnson"
BC> >From genuine_really(_at_)yahoo(_dot_)com  Fri Apr 14 10:30:53 2006
BC>   Subject: Test
BC>    Folder: /var/mail/mjohnson                                               
4428


        Ah ha!
        After fiddling with the recipe and docs some, I've DID get the formail 
portion to work.
        However, the original subject line is now being replaced instead of 
appended to.
        I'd appreciate any pointers!
        Here's the latest version of the recipe:


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



-- 
********************************************************************
Brett Charbeneau
Network Administrator
Williamsburg Regional Library
7770 Croaker Road
Williamsburg, VA 23188-7064
(757)259-4044          www.wrl.org
(757)259-4079 (fax)    brett(_at_)wrl(_dot_)org
********************************************************************


____________________________________________________________
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>