On 6.3.2019 10.24, Maria Arrea via dovecot wrote:
We are happy users of Dovecot 2.3.4.1 . We run a cronjob that deletes from Trash messages older than 15 days, this is the command we run:
 
/usr/bin/doveadm expunge -u $USER mailbox Trash savedbefore 15d
 
But this commands does NOT delete folders inside Trash. doveadm-expunge man page says nothing about recursive expunge. Maybe is not implemented?
 
We can not use doveadm mailbox delete, because has no search query argument.  We could elaborate a complex doveadm-search query and with xargs feed it do mailbox delete, but must be an easier way, how do you cope with old folders in Trash?


Expunge only deletes mails. Just like IMAP EXPUNGE command. You need to use mailbox delete to delete mailboxes.

Aki