DB corruption within minutes

Barry Gould BarryGould at pennysaverusa.net
Sun Jan 12 22:32:05 CET 2003


At 04:32 PM 1/11/2003 +0100, Matthias Andree wrote:
>Barry Gould <BarryGould at pennysaverusa.net> writes:
>
> > I've noticed that my goodlist file access timestamp gets updated even if
> > bogofilter is only updated the spam db.
>
>In -u mode, that's fine, because it needs to read the file to evaluate
>the mail it is presented. What matters for writes is the file
>modification time stamp, also known as mtime.
>
>--
>Matthias Andree

Sorry, I did mean to say it's the modification time that's getting updated.

This only seems to happen on -u executions, not -s,
BUT I am fairly sure that -u with spam are still causing the mtime to 
change on the goodlist. (evidence submitted below, note that the message 
was correctly recognized as spam by bogofilter -u)

for example, now (12:58pm Jan 12), my .bogofilter dir looks like:
-rw-r--r--    1 root     root      8892416 Jan 12 12:54 goodlist.db
-rw-r--r--    1 root     root      2912256 Jan 12 12:54 spamlist.db

Below is my procmail log for the relevant message (the only message at 
12:54), and my procmailrc.

I DO realize that I'm running -u and later, -s, on this message. That is a 
deliberate feature of my procmailrc, but I do not think it should cause any 
problems (other than the obvious double classification of spam).

Thanks,
Barry

log:
procmail: [25737] Sun Jan 12 12:54:14 2003
procmail: Locking "/var/spool/mail/.backups/backup.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/.backups/backup"
procmail: Opening "/var/spool/mail/.backups/backup"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/.backups/backup.lock"
procmail: No match on "^Subject:.*Online_Request_For_PENNYSAVER_"
procmail: No match on "^Subject:.*(\(ScanMail has found a virus\)|Virus 
Alert - ScanMail for Lotus Notes)"
procmail: No match on "^To:.*notify\@"
procmail: No match on 
"(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)dns"
procmail: Executing "bogofilter,-e,-p"
procmail: Match on "< 256000"
procmail: Match on "^content-transfer-encoding: *(base64|quoted-printable)"
procmail: Executing " /usr/bin/perl /usr/local/bin/unbase64.pl | bogofilter -u"
procmail: Match on " /usr/bin/perl /usr/local/bin/unbase64.pl | bogofilter -u"
procmail: Executing "formail,-IX-Bogosity: Yes, tests=bogofilter-unbase64"
procmail: Match on "^X-Bogosity: Yes, tests=bogofilter"
procmail: Assigning "LASTFOLDER=bogofilter -s"
procmail: Assigning 
"PATH=/var/spool/mail/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin"
procmail: Locking "/var/spool/mail/webmaster.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/webmaster"
procmail: Opening "/var/spool/mail/webmaster"
procmail: Acquiring kernel-lock
procmail: Executing "bogofilter,-s"
procmail: [25737] Sun Jan 12 12:54:15 2003
procmail: Unlocking "/var/spool/mail/webmaster.lock"
procmail: Notified comsat: "webmaster at 22336:/var/spool/mail/webmaster"
 From spammer at spammerdomain.com Sun Jan 12 12:54:14 2003
  Subject: spammy subject
   Folder: 
/var/spool/mail/webmaster                                        2704


procmail rc:

[root at mail mail]# cat /etc/procmailrc
MAILDIR=/var/spool/mail
HOME=/var/spool/mail
BACK=/var/spool/mail/.backups
SHELL=/bin/bash
LOGFILE=$HOME/procmail.log
VERBOSE=on

#backup everything first
:0c:
$BACK/backup

#backup ad placement
:0c:
* ^Subject:.*Online_Request_For_PENNYSAVER_
$BACK/ad_placement


#delete viruses and virus notifications from HH Scanmail (Trend)
:0h:
* ^Subject:.*(\(ScanMail has found a virus\)|Virus Alert - ScanMail for 
Lotus Notes)
$BACK/scanmail_virus


#delete bounces to mailinglists
:0:
* ^To:.*notify\@
* ^Subject:.*(Returned mail|Warning\:|Failure|Vacation|Out|System 
Error|AutoReply|Undeliv|delivery|auto-repl|Auto Response)
$BACK/notify_bounce


# if it's to dns@, it's spam
:0:
* ^TOdns
* ? bogofilter -s
dns-spam


# filter mail through bogofilter, tagging it as spam and
# updating the word lists
#:0fw
#| bogofilter -u -e -p

#noupdate
:0fw
| bogofilter -e -p

# if bogofilter failed, return the mail to the queue, the MTA will
# retry to deliver it later
# 75 is the value for EX_TEMPFAIL in /usr/include/sysexits.h

:0e
{ EXITCODE=75 HOST }

#check for base64 spam
:0fHB
* < 256000
#* H ?? ^X-Bogosity: No
* ^content-transfer-encoding: *(base64|quoted-printable)
* ? /usr/bin/perl /usr/local/bin/unbase64.pl | bogofilter -u
| formail -I"X-Bogosity: Yes, tests=bogofilter-unbase64"


#update spam db iff it was spam
:0c
* ^X-Bogosity: Yes, tests=bogofilter
| bogofilter -s

# end bogofilter
#eof





More information about the Bogofilter mailing list