[Dovecot] Please HELP: how to delete all messages older than X days from the server?

Timo Sirainen tss at iki.fi
Wed Aug 7 11:32:30 EEST 2013


On 7.8.2013, at 11.22, Răzvan Sandu <razvan.sandu at mobexpert.ro> wrote:

> On Tue, 06 Aug 2013 19:18:15 +0200, Pascal Volk a scris:
> 
>> There is also the -A option, see
>> http://wiki2.dovecot.org/Tools/Doveadm/Expunge#section_options
> 
> 
> Thank you, but doveadm expunge will ask for the mailbox name:
> 
> [root at mail1 ~]# doveadm expunge -u john.doe at example.com ON 2013-08-07
> doveadm(root): Fatal: expunge: To avoid accidents, search query must
> contain MAILBOX in all search branches

Add: mailbox '*'

> Also for the correct search criteria: should I use SAVEDBEFORE or
> SENTBEFORE ?

If they are POP3 only, then SAVEDBEFORE and BEFORE and the same. SENTBEFORE usually is also almost the same, except if the mail has been stuck in queues for a while or if the sender's clock is wrong. So better not use it.



More information about the dovecot mailing list