[Dovecot] Purging old mails

Rick Romero rick at havokmon.com
Mon Aug 7 23:43:35 EEST 2006


On Mon, 2006-08-07 at 14:34 -0600, Stephen Warren wrote:
> Rick Romero wrote:
> > On Mon, 2006-08-07 at 20:42 +0100, Dave Hatton wrote:
> >> I use dovecot as a backup mail store and would now like to purge all mails
> >> over a certain age.
> >
> > Just your folder?  I have a cron job for a user with a Treo that does a
> > broken pop and delete:
> > 
> > 00 02 * * * /usr/bin/find \
> > /usr/local/vpopmail/domains/domain/username/Maildir/new -mtime +4 \
> > -exec rm -f {} \;
> 
> I'm doing something similar, but I'm searching "Maildir/cur" not
> "Maildir/cur".
> 
> From my understanding, the mail "server" (MTA, LDA, ...) is supposed to
> deliver new mail to "Maildir/new", and once a mail client has seen the
> mail, it'll get moved to "Maildir/cur".
>
> As such, deleting files from "Maildir/new" will only delete new, unread
> messages, which sounds dangerous!
> 
> Of course, perhaps not all software that manipulates Maildir follows the
> move-from-new-to-cur rule...

My fault - I have multiple cronjobs for deleting mail.  The one I posted
was for the 'admin' account, as sometimes the help desk person sets the
'default deliver to' to admin, instead of bounce :/   And we don't
actually use 'admin' for email purposes.

You're right, for the first description, I delete from Maildir/cur

Rick




More information about the dovecot mailing list