On 06/11/2024 22:19, Joseph Tam via dovecot wrote:
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.
If by expire, you mean expunge, this is more or less what I
used in a nightly cron script

doveadm expunge -A
    \( mailbox 'Deleted Items'
    OR mailbox 'Deleted Messages*'
    OR mailbox Junk
    OR mailbox Trash
    OR \( mailbox INBOX Deleted \) \)
    BEFORE 7d

In English, for all users, delete any messages in commonly named trash
folders or any messages in INBOX marked as deleted that are older than
a week.

I recall one quirk: if the mailbox didn't have a cached entry
for the message's age, the filter criteria would miss this and it would remain
in the mailbox.  I'm not sure if this still happens, but I got around this by
seeding the cache by doing a doveadm search for that metadata
(date.received?).

Joseph Tam<jtam.h...@gmail.com>

In cron, I tried:

   doveadm expunge -A DELETED BEFORE 5d

and got back:

   Fatal: expunge: To avoid accidents, search query must contain
   MAILBOX in all search branches
   run-parts: /etc/cron.daily/dovecot-cleanup exited with return code 64

So I then tried:

   doveadm expunge -A MAILBOX * DELETED BEFORE 5d

and got back:

   Fatal: Unknown argument BOOT
   run-parts: /etc/cron.hourly/dovecot-cleanup exited with return code 75

How can I run it for all mailbox folders without specifying them individually?
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to