[ Content | View menu ]

Archivemail

Written on 20 Jan, 2005

I decided to use to use an excellent tool called Archivemail for two purposes: 1. To archive mail (duh!) and 2. to delete old mail such as mailing lists (already mirrored everywhere on the web) and spam.

This short script is run everyday at 17:00 by cron:

#!/bin/sh
# script called from cron to archive my mail
# based on the example in archivemail
set -e
ARCMAIL="archivemail --quiet --output-dir=$HOME/mail/archive/ "
$ARCMAIL --days 14 --delete $HOME/`for file in /home/sa/mail/lists/*; do echo -n "mail/lists/$(basename $file) "; done`
$ARCMAIL --days 160 --suffix '_%B_%Y' $HOME/mail/inbox/
$ARCMAIL --days 30 --delete $HOME/mail/spam

Very convenient and easy to set up.

Filed in: General.

Comments closed