-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29-Oct-2002/14:19 -0800, "Sorensen, Ken" <[EMAIL PROTECTED]> wrote:
>I've recently installed a spam filter to our email system and I'm
>looking for a way to re-send the users current INBOX
>mail(/var/spool/mail/username) back through the system to filter out the
>spam. I really don't want to write a script to parse the users INBOX file to
>extract each email. Any ideas?

Use formail to split the mailbox finle back into separate messages and
pipe the output to procmail for filtering. The following script is
untested.

#!/bin/sh
cd /var/spool/mail
for mailbox in `ls -1`; do
  mv $mailbox $mailbox.original
  touch $mailbox
  chown $mailbox.$mailbox $mailbox
  chmod 660 $mailbox
  cat $mailbox.original | formail -s "procmail -d $mailbox"
done


Tony
- -- 
Anthony E. Greene <mailto:Anthony%20E.%20Greene%20%3Cagreene@;pobox.com%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Anthony E. Greene <mailto:agreene@;pobox.com> 0x6C94239D

iD8DBQE9v12EpCpg3WyUI50RAiAJAJ9hwBC2JyyQalbUhGPGSHcZFGfBRQCdFKp7
4tEnc/EeGAl2YXh9YtxbJIo=
=eG3y
-----END PGP SIGNATURE-----



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to