procmail
[Top] [All Lists]

Re: Bayes learn

2004-07-05 17:43:04
In <bcefa5200407010048712c1de8(_at_)mail(_dot_)gmail(_dot_)com>, Google Kreme 
<gkreme(_at_)gmail(_dot_)com> writes:

I use a IMAP mailbox names "sa-learn-spam" (and one named
"sa-learn-ham") and have a shell script that is executed by cron:

#/bin/sh

/usr/local/bin/sa-learn --spam --mbox $HOME/Mail/sa-learn-spam
/usr/local/bin/formail -s /usr/local/bin/procmail -m /var/mark_read.rc
< $HOME/Mail/sa-learn-spam
cat /dev/null > $HOME/Mail/sa-learn-spam

Unless you lock the mailbox folder, sa-learn-spam could change while the script
runs. Wouldn't it be safer to move sa-learn-spam off first, something like

mv $HOME/Mail/sa-learn-spam $HOME/Mail/sa-learn-spam.running
touch $HOME/Mail/sa-learn-spam
chmod 600 $HOME/Mail/sa-learn-spam
/usr/local/bin/sa-learn --spam --mbox $HOME/Mail/sa-learn-spam.running
/usr/local/bin/formail -s /usr/local/bin/procmail -m /var/mark_read.rc < 
$HOME/Mail/sa-learn-spam.running
rm $HOME/Mail/sa-learn-spam.running

-- 
Klaus Johannes Rusch
KlausRusch(_at_)atmedia(_dot_)net
http://www.atmedia.net/KlausRusch/

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