Expunging and deleting old messages - moving from cyrus-imap
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
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
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.
Nick
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
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
On 07/11/2024 13:01, Stuart Henderson via dovecot wrote:
On 2024-11-06, Nick Howitt via dovecot<dovecot@dovecot.org> wrote:
I have just moved from cyrus-imap to dovecot. Interesting, I'm considering going the other way when Dovecot 2.4 is out and replication is lost ;-)
Only because my previous distro, ClearOS, used Cyrus. I urgently needed to replace ClearOS as there is no way to reinstall it in case of disaster, so I went with Debian 12 and they seem to prefer Dovecot. I only have a family server so am not so interested in replication, just a reliable backup and restore, in case of emergencies.
Stuart Henderson via dovecot skrev den 2024-11-07 14:01:
On 2024-11-06, Nick Howitt via dovecot <dovecot@dovecot.org> wrote:
I have just moved from cyrus-imap to dovecot.
Interesting, I'm considering going the other way when Dovecot 2.4 is out and replication is lost ;-)
real professionals use DBMail with postgresql replication :)
postgresql can here be Mysql varians if wanted problems witn high memmory loads, small servers could stick to sqlite
i am not jokeing btw
participants (4)
-
Aki Tuomi
-
Benny Pedersen
-
Nick Howitt
-
Stuart Henderson