On Fri, Feb 13, 2004 at 01:53:28PM +0200, you [Ville Herva] wrote:
> Is there a way to batch process a mailbox with SpamAssassin (sort it to ham
> and spam)?
> 
> I had this ~10000 mail box ~70% of which was spam.
> 
> The best I could think of was to split the mbox with tools/mboxsplit, then
> run them through spamassassin --exit-code one by one and cat them the HAM or
> SPAM mbox accordingly. Not too elegant...

FWIW, here's roughly what I did in case anyone is interested:

 mkdir spool; cd spool
 perl /usr/share/doc/spamassassin-tools-2.63/tools/mboxsplit -f "%06i" < 
../Mailbox
 cd ..

 foreach i in spool/*; do
   if spamassassin --exit-code < $i > temp; then
     cat temp >> HAM
   else
     cat temp >> SPAM
   fi
   rm temp
 done



-- v --
 
[EMAIL PROTECTED]

Reply via email to