On Fri, Feb 13, 2004 at 09:04:38AM -0500, you [Bob George] wrote:
> Ville Herva <[EMAIL PROTECTED]> wrote:
> > [...]
> > That's clever. That requires one to create procmail recipe
> > beforehand, though.
>
> Hmm.. You originally wrote:
> >>> Is there a way to batch process a mailbox with SpamAssassin
> >>> (sort it to ham and spam)?
>
> What did you have in mind to do the actual sorting if *not* procmail? SA will
> TAG the messages, but not actually sort them.
I already posted this, but here it is again:
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
This is what I used for sorting.
> I think you'll want to create a "sorting" procmailrc if you're not setting up
> one site-wide, then just call it via:
>
> formail -s procmail spamsort.cf < mbox.old
>
> This would work for a one-time job.
Yeah, it works (as does the script above), but I thought maybe there was a
quicker alternative, since there are a lot of unattended mailboxes I tought
I'd clean up.
But fair enough, it can be done via procmail or with spamassassin
--exit-code.
-- v --
[EMAIL PROTECTED]