On Sunday 04 December 2005 05:08 pm, Pollywog wrote:

> That did not do it, but I think you are close, that is is something along
> those lines.  I think the instructions I followed are not intended for
> Courier but for Cyrus.

I user Courier on this particular server .. and for
sa-learn to harvest spam out of a Courier/IMAP Maildir
folder (because all Courier Maildir folders (regardless
of whether it's the main "Maildir" or one of the subfolders)
has a "cur" "tmp" and "new" subfolders ... this is what I 
have to do.

I use a similar mechanism where I keep track of the different
Ham and Spam folder names... and I use two different scripts
to sweep through the file system with a HAM sweep (going through
all of the cur, tmp, & new named sub-folders that are known to
have HAM in them.... and another script that is setup to sweeep
through the cur, tmp, & new SPAM sub-folders.

This is what most of my HAM folders sa-learning script looks like:

##----NOTES-------------------
$WORKDIR is the path of the main maildir (inbox) that sa-learn
is processing.  $DIRFILE is the name of the file that contains
the list of named sub-folders of the main Maildir.  $SALEARN is
the variable that contains the full path to sa-learn.  And since
this particular e-mail system is fully database driven, "vmail"
is the account of the virtual-mail while e-mail is processed.
##----------------------------

OUTPUT="$WORKDIR/hamfolder.out"  # captures standard output output
WIPPUT="$WORKDIR/hamfolder.wip"  # captures current work-in-progress
ERRPUT="$WORKDIR/hamfolder.err"  # captures standard error output
WORKFIL="$WORKDIR/hamfolder.do"  # captures current named sub-folder

for OUTFILE in `echo $OUTPUT $WIPPUT $ERRPUT $WORKFIL`
do
    if [ -e "$OUTFILE" ]
    then
        echo "erasing $OUTFILE"
        rm $OUTFILE
    fi
done


DATE=`date`

OFLD="tmp cur new"

for FOLDERIN in `cat $DIRFILE`
do
  for SUBFLDR in $OFLD
     do
       echo "$DIRPATH/$FOLDERIN/$SUBFLDR" > folder.do
       echo "---- $DIRPATH/$FOLDERIN/$SUBFLDR -----" >> $WIPPUT
       echo "---- $DIRPATH/$FOLDERIN/$SUBFLDR -----" >> $ERRPUT
       echo "---- $DIRPATH/$FOLDERIN/$SUBFLDR -----" >> $OUTPUT
       nice  $SALEARN -u vmail --showdots --ham --folders=folder.do >> $OUTPUT 
2>>$ERRPUT
       DATE=`date`
       echo "--DONE w/ $DIRPATH/$FOLDERIN/$SUBFLDR --" >> $WIPPUT
       echo "--DONE w/ $DIRPATH/$FOLDERIN/$SUBFLDR --" >> $ERRPUT
       echo "--DONE w/ $DIRPATH/$FOLDERIN/$SUBFLDR --" >> $OUTPUT
    done
done
echo "+-------------------------+" >> $OUTPUT
echo "|                         |" >> $OUTPUT
echo "|   Learning about HAM    |" >> $OUTPUT
echo "|                         |" >> $OUTPUT
echo "|          DONE           |" >> $OUTPUT
echo "|                         |" >> $OUTPUT
echo "+-------------------------+" >> $OUTPUT


The main difference between HAM and SPAM processing is the "--ham" is 
changed to "--spam" in the sa-learn execution..... and where you see 
"ham" or "HAM" in the different variable file names.. they are changed
to "spam" or "SPAM" accordingly as well.

-- 
Tyler Nally
[EMAIL PROTECTED]

Reply via email to