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

----

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

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
    }

3

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

This worked beautifully; thank you.

I'm backing up the emails using rsync to 2 different servers.
The servers store the emails in /MailBackup/vmail/vmail1/(domain)/...

is there an easy recursive rm command to remove the Junk and Trash from each of the domains/users?

We're sort of back to the original question for cleanup of the deleted mails already stored.