[Dovecot] Purging old mails

Stephen Warren swarren at wwwdotorg.org
Mon Aug 7 23:34:58 EEST 2006


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...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20060807/2dcb316f/attachment.pgp 


More information about the dovecot mailing list