procmail
[Top] [All Lists]

Re: Bayes learn

2004-07-05 20:16:11
On Sat, 03 Jul 2004 15:04:03 +0100 (CET), Klaus Johannes Rusch
<klausrusch(_at_)atmedia(_dot_)net> wrote:
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

Yep, it would.  But I'm lazy and the check runs at 4am so it's never
been an issue.

mv $HOME/Mail/sa-learn-spam $HOME/Mail/sa-learn-spam.running
touch $HOME/Mail/sa-learn-spam

I would do 

cat $HOME/Mail/sa-learn-spam > $HOME/Mail/sa-learn-spam.running
cat /dev/null > $HOME/Mail/sa-learn-spam

myself, but otherwise....

chmod 600 $HOME/Mail/sa-learn-spam

for one thing, this would not be needed.


-- 
gkreme at gmail or kreme at kreme or syth at mac

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