Re: Mail cleaning script
* Sven Burgener (sburgener@objeng.ch) [Dec 18. 2001 04:09]:
> I am looking for a script that cleans out mails contained in the
> mail-files in /var/spool/mail/ that are older than a specific date, say
> 6 months, for example.
> Is there any such beast?
There may be tools that exist specifically for this purpose, but in the
spirit of this list:
grepmail can do it. You'd basically grep for messages between start-date
and "now" and direct the output to a file. Then when you're satisfied
you've got the syntax down right, write a shell script that does this at
regular intervals, for example, writes your results to a temp file, then
overwrite the mailbox with the temp file.
apt-get install grepmail
--
Brian Clark | Debian GNU/Linux: 3950 packages to keep you busy.
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Eat right, exercise regularly, die anyway.
Reply to: