On Fri, Apr 05, 2002 at 03:25:20PM -0800, Andrew Salamon wrote:
>    I've installed SpamAssassin on my company's mail server and started using 
> it for a few addresses. Unfortunately, that leaves me with several 
> megabytes of existing email that I would like to retroactively scan. I 
> tried the simplistic approach of simply piping a Unix mbox file through 
> SpamAssassin but it only seems to have looked at the first email. I suspect 
> this would be easy to do in perl but I'm only skilled enough to modify 
> existing scripts.
> 
>    Any suggestions or scripts?

Simple.  Create a new directory, cd into it, then run the attached script
(bustmail.pl) like this:

   ./bustmail.pl < yourmailbox

This will bust the mail out into individual files.  Then it's just a matter
of doing this:

   for II in [0-9]* ; do procmail < $II ; done

Note that "yourmailbox", if it's the default inbox for procmail, should be
cleared before you run the procmail loop.

(Note: I have this all scripted out with procmail using ".filemailrc", so
that I can automagically file away messages from my inbox after reading.)

 -Scott

Attachment: bustmail.pl
Description: Scott's Mail Buster

Reply via email to