1

Topic: Delete all Junk and Trash contents of all users and all domains?

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

Is there an 'rm' command (or other) which will delete all of the Junk and Deleted emails stored on the server for each user for each domain?

the files are under /etc/mail/vmail/vmail1/


Regards,


Andrew

2

Re: Delete all Junk and Trash contents of all users and all domains?

You can update dovecot config file to expunge old emails for you automatically.
Search "autoexpunge" here: https://doc.dovecot.org/configuration_m … x-settings

Quick example:

    mailbox Junk {
        auto = subscribe
        special_use = \Junk
        autoexpunge = 30d
    }

    mailbox Trash {
        auto = subscribe
        special_use = \Trash
        autoexpunge = 30d
    }

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee