expunging all mailboxes

Luuk dovecot at vosslamber.nl
Fri Dec 30 18:28:47 UTC 2016



On 30-12-16 17:03, Michael Fox wrote:
>> doveadm expunge -u <user> mailbox '*' savedbefore 30d
>
> That doesn't work for me either.  The command is accepted, but the messages
> are not expunged.
>
> I guess my search/fetch will just have to return the mailbox name, in
> addition to other fields, and then I'll need to loop through the mailbox
> names and perform multiple expunges for each user.  I understand the desire
> to avoid accidents by requiring that the mailbox be specified.  But if
> "mailbox ALL" or "mailbox '*' were allowed, that would still avoid the
> accident and yet also avoid the inefficiency of having to perform multiple
> expunges for one user.
>
>
> *** Enhancement request:  provide a "mailbox all" or "mailbox '*'" option
> for doveadm search_query so that expunge can be used to remove mail without
> regard to which mailbox it's in.
>

How i read the docs here:
http://wiki2.dovecot.org/Tools/Doveadm/SearchQuery
and here:
http://wiki2.dovecot.org/Tools/Doveadm/Expunge

Is what i can test, but i will/can not test 'expunge' ...

luuk at opensuse:~> doveadm search ALL savedbefore 1800d
0d41613267fb0e4f28190000bbf0c0ec 1
0d41613267fb0e4f28190000bbf0c0ec 2
0d41613267fb0e4f28190000bbf0c0ec 3
luuk at opensuse:~> doveadm fetch date.received ALL before 1800d | sed 
's/^L//g'
date.received: 2012-01-12 16:11:09

date.received: 2012-01-12 16:25:27

date.received: 2012-01-12 17:26:23

date.received: 2012-01-12 17:27:15

luuk at opensuse:~>


After this, i think this should work:
daveadm expunge ALL before 1800d

or, in you case:
doveadm expunge -u <user> ALL savedbefore 30d

if this is not working, that this might be a bug?


More information about the dovecot mailing list