Hi,
I'm a relative newbie to pm scripting - I've been looking on 'tips'
webpages so far. My script and a short sample logfile are at the
bottom with a few things snipped out for length (all braces are on
separate lines in the real script, if that makes any difference). This
include file runs spamassasin on it, and cleans up the 'From' bug..
(which is: * ^^rom[ ] :0 fhw | sed -e '1s/^/F/' #Work around procmail
bug: any output on stderr will cause the "F" in "From" to be dropped.
This will re-add it." Has this been fixed in the latest pm version?).
A few questions I have so far:
1) How can I insert a newline/CR character at the end of each logfile
entry? I tried the LOG="\n" at the end, but that doesn't work (just
addes '\n' - is the control character different?"
2) I'm getting a lot of 'extraneous locallockfile ignored' warnings in
the log file. I assume this has something to do with the fact that I
have the :0 inside the rule 'consequent' (is there a standard term?) -
this is how I saw it done in another example, and it doesn't seem to
work right without it there. Could the missing \| on the first line of
the "watchsun-porn rule" be the cause? That's corrected now, but I
wonder if it causes it to see the following lines as one big folder
name, and then it doesn't know what to do with the other :0 that's in
the consequent?
3) I've gotten a lot of 'drug spam' that will have subject lines such
as 'V . I . C . O . D . I . N' or similar. The number of spaces
varies after each period (as does the drug name). Is there a nice
RegExp that I can use to catch all variations, other than the rather
unwieldy-looking expression V( )*\.I( )*\.C( )*.( )*\.O [...] Better
yet, us there a perl script (or regex) I could run to catch all these
variants for multiple dug-names - ie. I could say
*catchname('VICONDIN')|\ catchname('XANEX') [...] as the rule?
Thanks in advance,
Jim Witte
jswitte(_at_)bloomington(_dot_)in(_dot_)us
Indiana University CS
---
A vote for Nader is a vote for George Bush.
-- procmail script
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/mail
LOGFILE=$HOME/mailog
INCLUDERC=/etc/mail/spamassassin/hnetinclude
:0 H
* procmail
{
LOG="Procmail - "
:0
$DEFAULT
}
:0 H
* indiana.edu
{ LOG="Indiana - "
:0
$DEFAULT}
:0 H
* alias
{ LOG="Alias - "
:0
$DEFAULT}
:0 H
* CollegeLuv.com|\
pguyot|\
{ LOG="Passed - "
:0
$DEFAULT}
:0
* meds|\
Xanex|\
Vicondin|\
X A N E X|\
V I C O D I N|\
Ever since I was a teenager|\
knew somethng was wrong with me|\
manhood
{ LOG="Trapped meds - "
:0
/dev/null}
:0 H
* ^X-Spam-Status: Yes|\
penis|\
Bigger checks|\
Allen
{ LOG="Trapped Spam,penis,etc - "
:0
/dev/null}
:0:
* watchsun # |\
Female Gushers|\
froidnet.com
{ LOG="Trapped porn - "
:0
/dev/null}
:0 B
* ^[ ]*$TV[qrst]
{ LOG="Trapped virus - "
:0
/dev/null}
:0 H
* ^X-Spam-Status: No, hits=[567]\.[0123456789]|\
Subject: jswitte
suspect
LOG="\n"
--
-- and a sample logfile:
procmail: Extraneous locallockfile ignored
\nFrom camino-bounces(_at_)mozdev(_dot_)org Sat May 1 23:05:35 2004
Subject: [Camino] Camino rendering question
Folder: /var/spool/mail/jswitte
2414
Trapped Spam,penis,etc - From cruise4u(_at_)emailstamp(_dot_)com Sat May 1
23:19:39 2004
Subject: *****SPAM***** Win a 9 Night Cruise
Folder: /dev/null
13630
--
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail