You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by LuKreme <kr...@kreme.com> on 2007/06/10 08:24:19 UTC

sa-learn and Maildirs

I currently process sa-learn against two mailboxes in each user's  
mailspool, sal-ham and sal-spam using a line like this:

/usr/local/bin/sa-learn --spam --mbox -u $i $S_PATH

where $i is the user name and $S_PATH is /home/${i}/Mail/sal-spam

Now, I want to process maildirs that are stored for virtual users  
where the path will be to a maildir

/usr/local/virtual/user@somedomain.tld/.sal-spam/

I THINK that simply running

sa-learn --spam -u virtual $S_PATH

will do the trick, but I also want to MOVE those messages to a sal- 
spam-learned folder so that the user knows that a message has been  
learned (and a sal-ham-learned as well).  I currently do this with  
mbox files quite easily:

    /usr/local/bin/sudo -u $i sh -c "cat $S_PATH >> ${S_PATH}-learned  
&& \
    cat /dev/null >  $S_PATH";

But, naturally, that doesn't work with maildirs.

I also want to remove the markup from the messages marked as ham, so  
I think I need to run spamassasin -d as well, but I'm unclear if that  
will work over a maildir or if I have to feed it individual  
messages.  I currently do THIS via a procmailrc that trawls the sal- 
ham mbox file and runs spamassassin-r over each message in it.

Anyone have any suggestions?


-- 
*** AgentSmith sets mode: +m