procmail
[Top] [All Lists]

Problem with Procmail and losing Messages

2009-08-30 09:30:25
Hello,

I have been using procmail for a while to help curb some of my SPAM. We get
~1100 emails a day of which probably 1050 are SPAM. I wrote a perl program
that will take in a from and to email address and the received headers and
look in a database to see if the email address is a valid from address
(whitelist) or if it has spammed me before, or if the domain has spammed me
before and also check the IP addresses to see if any of them have spammed me
before. If all passes I then check the To Address to see if it is a valid
address for which I receive mail and a few other things. I then return a
keyword back to the procmail script and act upon it.

In my mail I have several email boxes (Inbox, SPAMMER, SPAMMERIP,
INVALIDFROM, etc) The procmail script interprets the return value from my
perl program to determine which box to put it in after logging a counter for
the spam program so I can count how many messages are considered spam each
day.

The classification stuff all works like a dream however I'm having a problem
with procmail saying it's writing an email to say INVALIDFROM and the email
not ever getting there. Logging indicates it got the lock file and wrote it
to the INVALIDFROM mail box but when I look at the mailbox the email is not
there.

Example from procmail log file
procmail: Locking "/home/webdesign/.invalidfromlock"
procmail: Assigning "LASTFOLDER=/home/webdesign/mail/INVALIDFROM"
procmail: Opening "/home/webdesign/mail/INVALIDFROM"
procmail: Acquiring kernel-lock
procmail: Unlocking "/home/webdesign/.invalidfromlock"
procmail: Notified comsat: "
webdesign(_at_)1023044:/home/webdesign/mail/INVALIDFROM"
  Folder: /home/webdesign/mail/INVALIDFROM          1

Example from procmail rc file
# If the NFROM is INVALIDFROM then handle adding the Header to indicate that
is the problem
:0 fhw
* ? $GREP -i ^$NFROM$ $INVALIDFROM
| formail -I "X-IDENTIFIER: INVALIDFROM"

# If the NFROM is INVALIDFROM then handle incrementing the spammer count
:0fw
* ? $GREP -i ^$NFROM$ $INVALIDFROM
| /home/lrzone/logspam.pl

# If the NFROM is INVALIDFROM then handle putting it in the correct email
box
:0:$HOME/.invalidfromlock
* ? $GREP -i ^$NFROM$ $INVALIDFROM
$HOME/mail/INVALIDFROM

I did this a couple times in a row with some test emails and none of them
made it. I've come across this with other mailboxes too to the point I've
started keeping a copy of every email in COPY mail folder which never is
locked and I've not come across a problem yet of that box not getting the
emails but with 1100 a day it's hard to really tell. I then archive the COPY
folder off for a couple weeks to make sure nothing was missed.

Does anyone know why this is happening and better yet how to stop it. I
would like to depend on this as it's stopping about 80% of our email from
even being downloaded but right now I just can't trust that all the mail is
getting through even to the spam boxes I've set up. Any and all help would
be much appreciated.

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