Hello all,

For many years now I have been using SA on my home server which acts as
a mail server for my family only. It has, for all this time, been based
on an mbox structure.

I am now planning to change to the Maildir format.
(Do folks here think that's a good idea?)

Before I make the change I want to make sure SA and the tools I use with
will still work. This first thing that comes to mind is my sa-learn
script.

I have a folder structure that looks something like:

/home/mark/mail/

Home Inbox <-mbox
Work Inbox <-mbox
Hobby <-mbox
Malware <-directory
 L> Spam <-mbox
 L> Virus <-mbox
Misc <-directory
 L> Clubs <-mbox
 L> Car <-mbox
 L> Insurance <-mbox
 L> ...etc...
Personal <-directory
 L> Mother <-mbox
 L> AuntBessie <-mbox
 L> UncleJohn <-mbox
 L> ...etc...

Note the Malware directory.

The way I currently do sa-learning is with a nightly cron job that looks
like this (edited a bit):
Essentially it concatenates all the known ham mboxs and all the known
spam mboxs into two temporary files, runs sa-learn over them and then
deletes the temporary files.

============================8<============================================================
# Current sa-learn mbox script
#!/bin/bash

MAILDIR=/home/mark/mail

cd ${MAILDIR}

echo "Gathering Ham messages together..."
cat ${MAILDIR}/Misc/* ${MAILDIR}/Work/* ${MAILDIR}/Personal/*
${MAILDIR}/School/* > TempHam
echo "Ham concatenation completed"

echo "Gathering Spam messages together..."
cat ${MAILDIR}/Malware/* > TempSpam
echo "Spam concatenation completed"

echo "Starting SA-Learn for Spam messages..."
sa-learn --spam --mbox ${MAILDIR}/TempSpam
echo "Spam learning completed"

echo "Starting SA-Learn for Ham messages..."
sa-learn --ham --mbox ${MAILDIR}/TempHam
echo "Ham learning completed"

echo "Removing temporary Spam and Ham files..."
rm ${MAILDIR}/TempHam
rm ${MAILDIR}/TempSpam
echo "SA-Learning completed"
============================8<============================================================

When I switch to Maildir I will have a structure that looks like:

~/Maildir/.Hobby/{cur,new}
~/Maildir/.Misc.Clubs/{cur,new}
~/Maildir/.Misc.Car/{cur,new}
~/Maildir/.Misc.Insurance/{cur,new}
...etc...

So...

Will this work for sa-learn?

============================8<============================================================
# Proposed sa-learn maildir script
#!/bin/bash

sa-learn --ham ~/Maildir/.Hobby/{cur,new}
sa-learn --ham ~/Maildir/.{Misc,Personal,etc}.*/{cur,new}
sa-learn --spam ~/Maildir/.Malware.*/{cur,new}
============================8<============================================================

Is there a neater way of doing it?

Should I use --no-sync?

Thanks in advance for any help or suggestions

Mark

Reply via email to