On 06/11/2024 13:43, Aki Tuomi via dovecot wrote:
On 06/11/2024 14:51 EET Nick Howitt via dovecot<dovecot@dovecot.org> wrote:
I have just moved from cyrus-imap to dovecot. In cyrus I had an automatic purge of messages marked as deleted with a cron job:
/usr/lib/cyrus-imapd/cyr_expire -E 1 -X 7 -D 7
-E = Expire Days -X = Expunge days
What is the equivalent in doveadm?
doveadm expunge -A DELETED BEFORE 1w
That should do about the same thing.
Is there any equivalent to expire messages marked as deleted? I can't remember why I have it as I set up Cyrus so long ago.
I also delete from deleted (INBOX.trash) anything older than a year. In Cyrus, it is run from an event in the configuration:
trashPurge cmd="ipurge -s -X -f -d 365 user/*/Trash" at=0104
I would be happy to run it from cron, so does this work:
doveadm expunge -A mailbox INBOX.trash SENTBEFORE 52w
You can use autoexpunge setting instead.
Except I get:
doveadm(nobody): Error: mkdir(/nonexistent/.Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup))
I can run it for the individual users but not -A.
You are missing last_valid_uid setting to exclude nobody.
Nick Aki
Working now, thanks.
I do have an odd, sort of related question as I am seeing 2 different Trash locations.
Everyone in the family uses Thunderbird and K-9 mail. I moved all the mail to Debian12 with Dovecot from Cyrus using imapsync. In Cyrus the Trash folder is at the same level as the INBOX. After syncing the mail across, I gained an INBOX.trash folder as did the family account. A couple of other members account did not gain the INBOX.trash folder so I configured TB to use the original top level account. I have assumed this is a Dovecot thing, but I guess TB may have created it itself.
Which Trash folder would Dovecot normally create so I can standardise here? 15-mailboxes.conf has:
mailbox Trash {
special_use = \Trash
autoexpunge = 52w
}
(I've just added the autoexpunge) Does this mean I should resurrect /Trash and move the deleted mails back, adjusting TB and K-9 accordingly