procmail
[Top] [All Lists]

Re: Maintaining Unix mailbox files

2001-09-12 02:20:48
* Eugene Alperovich <eugene(_at_)xpert(_dot_)com> [20010910 18:37]: writing on 
the subject 'Maintaining Unix mailbox files'
| Hey everyone,
| 
| Does anyone know if I can use procmail/formail to remove old mail from users 
mailbox on a Linux machine?
| 
| What I want to have (eventually) is a cron-ran script that each day checks 
all the mailboxes (around a 100) and removes any mail older than a week. 
| The idea behind this, is that this server works as a backup -
| so it's only used if the main server dies.
| For the record, I am using sendmail 8.11.2 and ipop3d on a RH 7.1 linux .
| 
| Thanks in advance,
| Eugene

There is a better tool (perl script) that i use to do that. It is called 
expire_mail and I have attached it.
You run it via a cron like:

# Expire user mails older than 60 days and send them a notice about the mails
0      23      *       *       3       root    /usr/local/sbin/expire_mail -l 
-M -a 60 /var/mail/*

You'll have to save the file to somefilename.pl, modify it as explained in the 
notes.
It was sent to me. Please _don't_ spam the sender ;-)


-Wash

--
Odhiambo Washington
Wananchi Online Ltd.,
wash(_at_)wananchi(_dot_)com 1st Flr Loita Hse.
Tel: 254 2 313985 Loita Street.,
Fax: 254 2 313922 PO Box 10286,00100-NAIROBI,KE.

Why on earth do people buy old bottles of wine when they can get a fresh one 
for a quarter of the price? 

Attachment: expire_mail.pl.BAK
Description: Text document

Attachment: pgp9DxtMQ1qBo.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>