On Sun, Dec 28, 2003 at 04:54:30PM -0500, Joey Netterville wrote:
> okay, that was a little unclear... :)
> 
> i have run spamassassin on existing mail spools, but when i run
> spamassassin on a mail spool it marks the spool as if the entire spool was
> one large email message. i'm looking for a way to check the individual
> messages.
> 
> my overall goal is to be able to check existing user's spools for spam and
> let them filter that out of their large mail spools, and then start
> running spamassassin to keep their spools clean in the future.

Assuming the spool file is owned by a user with the same name as the 
spool file:

SPOOLFILES=# SNAG THE LIST OF MAILBOXES SOMEHOW.

for SPLFILE in ${SPOOLFILES}; do
  mv ${SPLFILE} ${SPLFILE}.checking;
  touch ${SPLFILE};
  #LOCK the ${SPLFILE};
  #SET perms on ${SPLFILE};
  sleep 1;
  cat ${SPLFILE}.checking | formail -s spamc -u ${SPLFILE} >> ${SPLFILE};
  #UNLOCK the ${SPLFILE};
  #RM or BACKUP or IGNORE ${SPLFILE}.checking;
done;

Or something like that.  Error checking is left as an excersize for the
reader.

Additional pipelining could seperate into ${SPLFILE}.(spam|ham).

-- 
Scott Lambert                    KC5MLE                       Unix SysAdmin
[EMAIL PROTECTED]      



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to