1

Topic: Email Retention Rules How To ?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):   v0.9.6
- Deployed with iRedMail Easy or the downloadable installer?   downloaded installer
- Linux/BSD distribution name and version: Ubuntu
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- 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.
====

Does anyone know of a good guide to setting Retention Rules for the automatic deletion of email from either all accounts or a specific account after a period of time ?

I like having the catch-all mailbox however it does collect a lot of spam and purging anything older than 24 hours would be great.

Thank You all

----

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

2

Re: Email Retention Rules How To ?

Could this be as easy as a cronjob running hourly ?

find  /var/vmail/vmail1/domain.com/d/o/m/domainadmin-2020.03.24.16.55.59/Maildir/cur/*.*   -mtime +1 -exec rm {} \;

3

Re: Email Retention Rules How To ?

Use the "autoexpunge" option for all mailboxes if you want:
https://wiki.dovecot.org/MailboxSettings

Or, run `doveadm` command with cron job for few mailboxes:
https://wiki.dovecot.org/Tools/Doveadm/Expunge