TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stupid procmail tricks



This is a procmail trick to archive your users e-mail. The best part is
it's completely transparent to the end user. 

First, 
$touch /etc/skel/.MailArchive
$bzip2 /etc/skel/.MailArchive

Make sure the Archive file exisits for all new users, also copy this file
to existing users home directory.

Then edit /etc/procmailrc to look like this:

# Quick and easy procmail config to archive e-mail
# It would probally be a good idea to make sure you have lots of 
# room on /home and/or quotas set up to handle seven years of e-mail
# for all your users. 
MAILDIR=$HOME
#Carbon Copy Rule
:0c:
#Carbon Copy to bzcat and append to mail Archive
| bzcat -z >> $HOME/.MailArchive.bz2

If you're not running an IMAP enviorment it would be useful if a user lost
all their important e-mails and asks you to get them back from /dev/null

Add a cron job to move the archives to a different filename mounthly and
you'd really be orgnized. Not a big deal since the archive is in mbox
format and you could easily just extract it to $HOME/mail/Archive (or IMAP
mail root) and access it from the mail client as a normal IMAP folder.

|> Andrew S. Zbikowski | I find your lack of pants disturbing.
|> http://www.ringworld.org | "Only two things are infinite, 
|> the universe and human stupidity, and I'm not sure about 
|> the former. "  - Albert Einstein