1 Aug 02:44
Re: Automatically Deleting old Messages
Matt Okeson-Harlow <matt <at> technomage.net>
2007-08-01 00:44:29 GMT
2007-08-01 00:44:29 GMT
On Tue, Jul 31, 2007 at 03:27:42PM +0200, Louis-David Mitterrand wrote:
> On Fri, Jun 15, 2007 at 11:56:41PM +0300, tyler.roach <at> bluebottle.com wrote:
> > Hi,
> > Is there any way I can make mutt (or another application)
> > automatically delete messages in _certain_ folders (such as mailing
> > lists) that are over a certain number of days old?
>
> If you have a unix account on your mail server then you can enter these
> crontab jobs:
>
> ## remove all list mails older than 60 days in folders matching
> ## ~/Maildir/.[a-z]* and ~/Maildir/.Admin.*
> 0 2 * * * find /home/ldm/Maildir -mindepth 3 -maxdepth 3 -type f -mtime +60 \( -path
'/home/ldm/Maildir/.[a-z]*' -o -path '/home/ldm/Maildir/.Admin.*' \) -exec rm -f {} \;
>
> ## remove all empty maildirs
> 0 3 * * * for i in ~/Maildir/.*; do if [ -d "$i" ] && [ ! "$(find "$i" -mindepth 2 -type f)" ]; then rm -rf "$i" ; fi ; done
>
> (thanks to greycat on #bash for help on these)
Another option would be to use the 'archivemail' utility.
http://archivemail.sourceforge.net/
It even works over IMAP.
For instance:
/usr/bin/archivemail -q -d 15 ~/Maildir/.Trash
(Continue reading)

.
Cheers.
RSS Feed