[plug] Procmail/SpamAssassin problem...

Trevor Phillips T.Phillips at murdoch.edu.au
Tue Nov 19 09:49:14 WST 2002


I have an existing setup which uses procmail and cyrus IMAP for server-side 
E-mail filtering. I'm trying to integrate SpamAssassin into the pipeline, but 
have hit a problem.

Here's what I have in my .procmailrc:

:0fw:$CYUSER.lock
* < 256000
| /usr/bin/spamc -f

But here's what I get in my procmail log once this is added (snippet from the 
SPAM filter through to the failed delivery):

procmail: Match on "< 256000"
procmail: Locking "phillips.lock"
procmail: Executing "/usr/bin/spamc,-f"
procmail: [8869] Tue Nov 19 09:35:06 2002
procmail: Unlocking "phillips.lock"
procmail: No match on "^From\s"
procmail: Extraneous filter-flag ignored
procmail: Extraneous deliver-head flag ignored
procmail: No match on "^To:.*anyplace at juno.com"
procmail: No match on "^From: $"
procmail: Locking "phillips.lock"
procmail: Executing "/usr/sbin/cyrdeliver,-e,-a,phillips,-m,user.phillips"
user.phillips: Message contains invalid header
procmail: Non-zero exitcode (65) from "/usr/sbin/cyrdeliver"
procmail: Assigning "LASTFOLDER=/usr/sbin/cyrdeliver -e -a phillips -m 
user.phillips"
procmail: Unlocking "phillips.lock"

Running spamc from the command line, and piping the body of a SPAM through it 
works as it should, but it doesn't in the procmail filter.

Doing a Google search, and doing a Diff on the manually piped versions, spamc 
is adding an old style "From blah at address  date" as the first line of the 
message. (Yes, I've found out more about this problem as I've been writing up 
this message. ^_^;;)

Actually, I've fixed it now, but still, there may be a more elegant 
solution...

What is the easiest way in Procmail to strip off this line, if it's defined? 
The code I used was:

:0fh:$CYUSER.lock
* ^From[ ]
{ 
  :0fhw
  | /bin/sed -e '1s/^From[ ].*$//'
}

Is there a nicer way?

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: Web Technical Administrator     -          T.Phillips at murdoch.edu.au : 
| IT Services                        -              Murdoch University | 
 >--------------------------------------------------------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list