[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-users
Subject:    Re: Automatically Deleting old Messages
From:       Louis-David Mitterrand <vindex+lists-mutt-users () apartia ! org>
Date:       2007-07-31 13:27:42
Message-ID: 20070731132741.GA32232 () apartia ! fr
[Download RAW message or body]

On Fri, Jun 15, 2007 at 11:56:41PM +0300, tyler.roach@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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic