procmail
[Top] [All Lists]

procmail/spambuster woes: ${TEST} and && misbehave??

2001-10-20 00:26:14
I've installed spambuster.  It seems to function OK (ie, it delivers
the mail and doesn't report any malconfiguration problems), except
that it marks all mail as X-SBPass: NoBounce.  

After much futzing around, I think I've really localized the problem
Look at this procmail code (from sb.rc, with tracing stuff added by
me): 

:0 f
* ? ${TEST} -f ${NOBOUNCE} 
| ${FORMAIL} -A"X-MW: nobounce file exists"

:0 E
{

:0 f
| ${FORMAIL} -A"X-MW: E says that nobounce file does not exist"

}

:0 f
* !? ${TEST} -f ${NOBOUNCE} 
| ${FORMAIL} -A"X-MW: test -f nobounce failed"

# THE NOBOUNCE FILE

:0 f
* ? ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: -zxReply-To: | ${GREP} -i -f 
${NOBOUNCE})
| ${FORMAIL} -A"X-SBPass: NoBounce"


From this we get the following output:

X-MW: E says that nobounce file does not exist
X-MW: test -f nobounce failed
X-SBPass: NoBounce

Since test -f has decided that the NOBOUNCE file doesn't exist
(twice!), the last recipe ought not to have succeeded (right?).  Yet
it does.

Here's the relevant chunk of the log file (the whole thing is appended
below):

procmail: Assigning "NOBOUNCE=/home/wand/.nobounce"
...
procmail: Assigning "TEST=test"
...
procmail: Executing "test,-f,/home/wand/.nobounce"
procmail: [22104] Fri Oct 19 12:39:54 2001
procmail: Non-zero exitcode (1) from "test"
procmail: Assigning "LASTFOLDER=test -f /home/wand/.nobounce"
procmail: No match on "test -f /home/wand/.nobounce"
procmail: Executing "/arch/unix/bin/formail,-AX-MW: E says that nobounce file 
does not exist"
procmail: Executing "test,-f,/home/wand/.nobounce"
procmail: Non-zero exitcode (1) from "test"
procmail: Assigning "LASTFOLDER=test -f /home/wand/.nobounce"
procmail: Match on ! "test -f /home/wand/.nobounce"
procmail: Executing "/arch/unix/bin/formail,-AX-MW: test -f nobounce failed"
procmail: Executing " ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: [22104] Fri Oct 19 12:40:24 2001
procmail: Assigning "LASTFOLDER= ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: Match on " ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: Executing "/arch/unix/bin/formail,-AX-SBPass: NoBounce"

Notice it says "No match on "test -f /home/wand/.nobounce", yet it
reports a match on " ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom:
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"

There are a bunch of recipes like this in Spambuster, and they all
seem to succeed even though they shouldn't.

I thought it might be a problem about the behavior of TEST, but the
same call fails in a simple recipe, yet it seems to succeed inside the
&&.

Can anybody give me a clue as to what might be wrong here?  Oddly,
there is at least one other spambuster user at this site, and it works
fine for him.

I've asked around here, with no success.

Mitchell Wand                                           
wand(_at_)ccs(_dot_)neu(_dot_)edu
College of Computer Science, Northeastern University
360 Huntington Avenue #161CN, Boston, MA 02115     Phone: (617) 373 2072
<http://www.ccs.neu.edu/home/wand>                 Fax:   (617) 373 5121

****************************************************************

Procmail version info:

wand(_at_)alnilam: ~> procmail -v
procmail v3.14 1999/11/22, Copyright (c) 1999, Stephen R. van den Berg
                                                        <srb(_at_)cuci(_dot_)nl>

Submit questions/answers to the procmail-related mailinglist by sending to:
        <procmail-users(_at_)procmail(_dot_)org>

And of course, subscription and information requests for this list to:
        <procmail-users-request(_at_)procmail(_dot_)org>

Locking strategies:     dotlocking, fcntl(), lockf()
Default rcfile:         $HOME/.procmailrc
Your system mailbox:    /var/spool/mail/wand

****************************************************************

My .procmailrc:

# This may conflict with VM's locking mechanism, use it sparingly!
MAILDIR=$HOME/email

LOGFILE=$MAILDIR/.procmail.log
# LOGABSTRACT=$MAILDIR/.procmail.abstract


# Mark says: if you don't set $DEFAULT, stuff will just get left in
# the system  mailbox
# DEFAULT=/var/spool/mail/wand
# DEFAULT=$HOME/mbox

# VERBOSE=yes

# this didn't work before, let's try it again.
DEFAULT=/var/spool/mail/wand

# I think this is already the default
NOBOUNCE=${HOME}/.nobounce   

FORMAIL=/arch/unix/bin/formail
SBDIR=$HOME/procmail
# try using mlogan's copy---
# SBDIR=/home/mlogan/proj/spambnc
BLOCKFOLDER=$MAILDIR/spam
SPAMREPLY=SILENT
BLOCKREPLY=SILENT
THISISP=ccs.neu.edu

# more variables, from .procmailrc.sample
ADMINFOLDER=${DEFAULT}       # deliver bounce notices normally
BULKFOLDER=${DEFAULT}        # also bulk mail
BLOCKFOLDER=${DEFAULT}       # just read the suspicious mail
# SPAMFOLDER=${MAILDIR}/spam   # file the spam
# experimental:
# SPAMFOLDER=${HOME}/mbox            # read the spam
SPAMFOLDER=${HOME}/procmail-test

BACKUPFOLDER=/proj/wand/INBOX.procmail-backup

# from procmail.sample:
# Create a backup cache of most recent messages in case of mistakes
:0 c
${BACKUPFOLDER}

## I've created a cron job to rotate the backupfolder, keeping 3 days' worth.

# Regenerate "From" lines to make sure they are valid
:0 fhw
| formail -I "From " -a "From "

# flush these!
:0:
* ^TOmass-mail(_at_)cns(_dot_)bu(_dot_)edu
${HOME}/procmail-test

# or we could really trash it:
# /dev/null

# test of alternate delivery:
:0:
* ^Subject:.*testing procmail
${HOME}/procmail-test

# ... your own recipes would go down here ...
# Here are some of Mark's

# :0:
# * ^Subject: crack login by user
# /dev/null

# :0:
# * ^To:(_dot_)*crew-admin(_at_)ccs
# $MAILDIR/crew

# :0:
# * ^From:(_dot_)*ewiley(_at_)ccs
# $MAILDIR/crew

# Here's the line that does the damage:

INCLUDERC=${SBDIR}/sb.rc

# Kill some things that are passed by SB

:0
* ^Subject:.*XXX
SPAMFOLDER

:0
* ^Subject:.*             .*
SPAMFOLDER

****************************************************************

FWIW, here's the whole log file. 

procmail: [22104] Fri Oct 19 12:39:53 2001
procmail: Assigning "DEFAULT=/var/spool/mail/wand"
procmail: Assigning "NOBOUNCE=/home/wand/.nobounce"
procmail: Assigning "FORMAIL=/arch/unix/bin/formail"
procmail: Assigning "SBDIR=/home/wand/procmail"
procmail: Assigning "BLOCKFOLDER=/home/wand/email/spam"
procmail: Assigning "SPAMREPLY=SILENT"
procmail: Assigning "BLOCKREPLY=SILENT"
procmail: Assigning "THISISP=ccs.neu.edu"
procmail: Assigning "ADMINFOLDER=/var/spool/mail/wand"
procmail: Assigning "BULKFOLDER=/var/spool/mail/wand"
procmail: Assigning "BLOCKFOLDER=/var/spool/mail/wand"
procmail: Assigning "SPAMFOLDER=/home/wand/procmail-test"
procmail: Assigning "BACKUPFOLDER=/proj/wand/INBOX.procmail-backup"
procmail: Assigning "LASTFOLDER=/proj/wand/INBOX.procmail-backup"
procmail: Opening "/proj/wand/INBOX.procmail-backup"
procmail: Acquiring kernel-lock
procmail: Executing "formail,-I,From ,-a,From "
procmail: No match on 
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)mass-mail(_at_)cns(_dot_)bu(_dot_)edu"
procmail: No match on "^Subject:.*testing procmail"
procmail: Assigning "INCLUDERC=/home/wand/procmail/sb.rc"
procmail: Executing "/arch/unix/bin/formail,-AX-SpamBouncer: 1.4 (8/24/01)"
procmail: No match on "^^^^"
procmail: No match on "^^^^"
procmail: No match on "^^^^"
procmail: Assigning "OLDLINEBUF=2048"
procmail: Assigning "LINEBUF=32776"
procmail: Assigning "ADMINTAG=no"
procmail: Assigning "BLOCKTAG=no"
procmail: Assigning "BLOCKTHIS=no"
procmail: Assigning "BOUNCETHIS=no"
procmail: Assigning "BULKTAG=no"
procmail: Assigning "SPAMTAG=no"
procmail: Assigning "VIRUSTAG=no"
procmail: No match on "^^^^"
procmail: Match on "^^^^"
procmail: Assigning "ALTFROM=wand(_at_)amber(_dot_)ccs(_dot_)neu(_dot_)edu"
procmail: No match on "^^^^"
procmail: Assigning "SETDEF=yes"
procmail: Match on "SILENT"
procmail: Assigning "SETDEF=no"
procmail: No match on "NOTIFY"
procmail: No match on "yes"
procmail: No match on "^^^^"
procmail: Match on "^^^^"
procmail: Assigning "BYPASSWD=zeugma"
procmail: Match on "^^^^"
procmail: Assigning "CHINESE=no"
procmail: Match on "^^^^"
procmail: Assigning "DATE=date"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "DEBUG=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "DORKSLCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "DULCHECK=no"
procmail: Match on "^^^^"
procmail: Assigning "FILTER=no"
procmail: Match on "^^^^"
procmail: Assigning "FREEMAIL=INTERNAL"
procmail: Match on "^^^^"
procmail: Assigning "GARBLEDCHARSET=yes"
procmail: Match on "^^^^"
procmail: Assigning "GLOBALNOBOUNCE=NONE"
procmail: Match on "^^^^"
procmail: Assigning "GREP=fgrep"
procmail: Match on "^^^^"
procmail: Assigning "JAPANESE=no"
procmail: Match on "^^^^"
procmail: Assigning "KOREAN=no"
procmail: Match on "^^^^"
procmail: Assigning "LEAN=yes"
procmail: Match on "^^^^"
procmail: Assigning "LEGITLISTS=/home/wand/.legitlists"
procmail: Match on "^^^^"
procmail: Assigning "MYEMAIL=/home/wand/.myemail"
procmail: No match on "^^^^"
procmail: Match on "^^^^"
procmail: Assigning "NOLOOP=wand(_at_)amber(_dot_)ccs(_dot_)neu(_dot_)edu"
procmail: Match on "^^^^"
procmail: Assigning "NSLOOKUP=nslookup -timeout=5 -retry=2"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "ORBLCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "ORBZINCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "ORBZOUTCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "ORDBCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "OSDIALCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "OSSPAMCHECK=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "SILENT"
procmail: No match on "NOTIFY"
procmail: Match on "yes"
procmail: Assigning "PATTERNMATCHING=NONE"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "PROXYSOCKS=no"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "RBLCHECK=no"
procmail: Match on "^^^^"
procmail: Assigning "RM=rm"
procmail: Assigning "SETDEF=yes"
procmail: No match on "yes"
procmail: Match on "yes"
procmail: Assigning "RSSCHECK=no"
procmail: Match on "^^^^"
procmail: Assigning "RUSSIAN=no"
procmail: No match on "^^^^"
procmail: No match on "^^^^"
procmail: Assigning "SETDEF=yes"
procmail: No match on "no"
procmail: Match on "yes"
procmail: Assigning "SPAMHAUSORGCHECK=yes"
procmail: Assigning "SETDEF=yes"
procmail: No match on "BOUNCE"
procmail: No match on "COMPLAIN"
procmail: No match on "BOTH"
procmail: Match on "yes"
procmail: Assigning "SPAMREPLY=SILENT"
procmail: Match on "^^^^"
procmail: Assigning "TEST=test"
procmail: No match on "^^^^"
procmail: Match on "^^^^"
procmail: Assigning "TURKISH=no"
procmail: Match on "^^^^"
procmail: Assigning "VIRUSFOLDER=/home/wand/procmail-test"
procmail: No match on "yes"
procmail: Executing "date,+%y%m"
procmail: Assigning "CM=0110"
procmail: Assigning "RESPOND=no"
procmail: No match on "0109"
procmail: No match on "0108"
procmail: Match on "no"
procmail: Assigning "SPAMREPLY=SILENT"
procmail: Assigning "INCLUDERC=/home/wand/procmail/sb-viruses.rc"
procmail: No match on "^X-Spanska:"
procmail: Match on ! "--.*forwarded message --"
procmail: Match on ! "^forwarded message:"
procmail: Match on ! "^-----BEGIN PGP SIGNED MESSAGE-----"
procmail: Score:   -1000   -1000 ""
procmail: Score:       0   -1000 "^begin 644 Happy99.exe$"
procmail: Score:       0   -1000 "^M35I0"
procmail: Score:       0   -1000 "^M86T@;75S="
procmail: No match on "yes"
procmail: Match on ! "--.*forwarded message --"
procmail: Match on ! "^forwarded message:"
procmail: Match on ! "^-----BEGIN PGP SIGNED MESSAGE-----"
procmail: Score:   -1000   -1000 ""
procmail: Score:       0   -1000 "^Subject: Homepage"
procmail: Score:       0   -1000 "Homepage\.HTML\.vbs"
procmail: Match on ! "--.*forwarded message --"
procmail: Match on ! "^forwarded message:"
procmail: Match on ! "^-----BEGIN PGP SIGNED MESSAGE-----"
procmail: Score:   -1000   -1000 ""
procmail: Score:       0   -1000 "^Subject: Mawanella"
procmail: Score:       0   -1000 "Mawanella\.HTML\.vbs"
procmail: No match on "yes"
procmail: No match on "^Content-Type:.*(multipart|attachment)"
procmail: No match on "^From:(_dot_)*hahaha(_at_)sexyfun\(_dot_)net"
procmail: Match on ! "^-----BEGIN PGP SIGNED MESSAGE-----"
procmail: Score:   -1000   -1000 ""
procmail: Score:       0   -1000 "^Subject: Snowhite and the Seven Dwarfs \- 
The REAL story\!$"
procmail: Score:       0   -1000 "dwarf4you\.exe"
procmail: No match on "yes"
procmail: Match on ! "^-----BEGIN PGP SIGNED MESSAGE-----"
procmail: Score:   -1000   -1000 ""
procmail: Score:       0   -1000 "^[:;#>]"
procmail: Score:       0   -1000 
"^Content.*(file)?name=.+\..+\.(hta|vbs|exe|scr|pif|lnk|bat|com).*$"
procmail: Executing "test,-f,/home/wand/.nobounce"
procmail: [22104] Fri Oct 19 12:39:54 2001
procmail: Non-zero exitcode (1) from "test"
procmail: Assigning "LASTFOLDER=test -f /home/wand/.nobounce"
procmail: No match on "test -f /home/wand/.nobounce"
procmail: Executing "/arch/unix/bin/formail,-AX-MW: E says that nobounce file 
does not exist"
procmail: Executing "test,-f,/home/wand/.nobounce"
procmail: Non-zero exitcode (1) from "test"
procmail: Assigning "LASTFOLDER=test -f /home/wand/.nobounce"
procmail: Match on ! "test -f /home/wand/.nobounce"
procmail: Executing "/arch/unix/bin/formail,-AX-MW: test -f nobounce failed"
procmail: Executing " ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: [22104] Fri Oct 19 12:40:24 2001
procmail: Assigning "LASTFOLDER= ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: Match on " ${TEST} -f ${NOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${NOBOUNCE})"
procmail: Executing "/arch/unix/bin/formail,-AX-SBPass: NoBounce"
procmail: Skipped "* !GLOBALNOBOUNCE ?? NONE"
procmail: Skipped "* ? ${TEST} -f ${GLOBALNOBOUNCE} && (${FORMAIL} -zxFrom: 
-zxReply-To: | ${GREP} -i -f ${GLOBALNOBOUNCE})"
procmail: Skipped "| ${FORMAIL} -A"X-SBPass: GlobalNoBounce""
procmail: No match on "yes"
procmail: No match on "yes"
procmail: No match on "yes"
procmail: No match on "yes"
procmail: No match on "yes"
procmail: Match on ! "yes"
procmail: Match on ! "yes"
procmail: Match on ! "yes"
procmail: Executing "/arch/unix/bin/formail,-AX-SBClass: OK"
procmail: Assigning "LINEBUF=2048"
procmail: No match on "yes"
procmail: No match on "^Subject:.*XXX"
procmail: No match on "^Subject:.*             .*"
procmail: Locking "/var/spool/mail/wand.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/wand"
procmail: Opening "/var/spool/mail/wand"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/wand.lock"
From wand(_at_)ccs(_dot_)neu(_dot_)edu  Fri Oct 19 12:39:53 2001
 Subject: test 9, with verbose=yes 
  Folder: /var/spool/mail/wand                                              886
procmail: Notified comsat: "wand(_at_)0:/var/spool/mail/wand"
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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