1

Topic: doveadm expunge not responding to commands

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? Downloaded
- Linux/BSD distribution name and version: Ubuntu 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MaridaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I am trying to setup a cron to delete mails from the Trash and Junk folders using doveadm. However the command which should work does not delete the emails.

doveadm expunge -A mailbox Trash SAVEDBEFORE 3d

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: doveadm expunge not responding to commands

Please run 'doveadm' with '-D' option to enable debug mode and check its output carefully:

doveadm -D expunge ...

3

Re: doveadm expunge not responding to commands

Thanks for the response. This is the output with the account censored. I have read it 2 times, and with my lack of understanding of dovecot I don't see anything that looks obvious for why it did not behave as I imagine it.

doveadm(user@domain.com)<583516><>: Debug: auth-master: userdb lookup(user@domain.com): Started userdb lookup
doveadm(user@domain.com)<583516><>: Debug: auth-master: userdb lookup(user@domain.com): auth USER input: user@domain.com master_user=user@domain.com home=/var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40/ mail=maildir:~/Maildir quota_rule=*:bytes=0
doveadm(user@domain.com)<583516><>: Debug: auth-master: userdb lookup(user@domain.com): Finished userdb lookup (username=user@domain.com master_user=user@domain.com home=/var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40/ mail=maildir:~/Maildir quota_rule=*:bytes=0)
doveadm(user@domain.com)<583516><>: Debug: Added userdb setting: mail=maildir:~/Maildir
doveadm(user@domain.com)<583516><>: Debug: Added userdb setting: plugin/master_user=user@domain.com
doveadm(user@domain.com)<583516><>: Debug: Added userdb setting: plugin/quota_rule=*:bytes=0
doveadm(user@domain.com): Debug: Effective uid=2000, gid=2000, home=/var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40/
doveadm(user@domain.com): Debug: Quota root: name=user backend=dict args=:proxy::quotadict
doveadm(user@domain.com): Debug: Quota rule: root=user mailbox=* bytes=0 messages=0
doveadm(user@domain.com): Debug: Quota warning: bytes=0 (100%) messages=0 reverse=no command=quota-warning 100 user@domain.com
doveadm(user@domain.com): Debug: Quota warning: bytes=0 (95%) messages=0 reverse=no command=quota-warning 95 user@domain.com
doveadm(user@domain.com): Debug: Quota warning: bytes=0 (90%) messages=0 reverse=no command=quota-warning 90 user@domain.com
doveadm(user@domain.com): Debug: Quota warning: bytes=0 (85%) messages=0 reverse=no command=quota-warning 85 user@domain.com
doveadm(user@domain.com): Debug: Quota grace: root=user bytes=0 (10%)
doveadm(user@domain.com): Debug: dict quota: user=user@domain.com, uri=proxy::quotadict, noenforcing=0
doveadm(user@domain.com): Debug: Namespace : type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir
doveadm(user@domain.com): Debug: maildir++: root=/var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40//Maildir, index=, indexpvt=, control=, inbox=/var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40//Maildir, alt=
doveadm(user@domain.com): Debug: acl: initializing backend with data: vfile
doveadm(user@domain.com): Debug: acl: acl username = user@domain.com
doveadm(user@domain.com): Debug: acl: owner = 1
doveadm(user@domain.com): Debug: acl vfile: Global ACLs disabled
doveadm(user@domain.com): Debug: Namespace : type=shared, prefix=Shared/%u/, sep=/, inbox=no, hidden=no, list=children, subscriptions=yes location=maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/Shared/%Ld/%Ln
doveadm(user@domain.com): Debug: shared: root=/var/run/dovecot, index=, indexpvt=, control=, inbox=, alt=
doveadm(user@domain.com): Debug: acl: initializing backend with data: vfile
doveadm(user@domain.com): Debug: acl: acl username = user@domain.com
doveadm(user@domain.com): Debug: acl: owner = 0
doveadm(user@domain.com): Debug: acl vfile: Global ACLs disabled
doveadm(user@domain.com): Debug: quota: quota_over_flag check: quota_over_script unset - skipping
doveadm(user@domain.com): Debug: Mailbox Trash: Mailbox opened because: expunge
doveadm(user@domain.com): Debug: acl vfile: file /var/vmail/vmail1/laz.li/k/t/t/kt-2020.07.17.18.10.40//Maildir/dovecot-acl not found
doveadm(user@domain.com): Debug: auth-master: userdb list: Returned username: postmaster@laz.li

4

Re: doveadm expunge not responding to commands

Use `doveadm search` to search mailbox first, make sure your search filter actually matches and returns some messages:
https://wiki.dovecot.org/Tools/Doveadm/Search

If it matches, `doveadm expunge` should work as expected.