1

Topic: Automatically delete quarantined mail

There is any way to delete automatically quarantined mail after X days in iRedAdmin-Pro 1.4?
Even a console command that I can invoke by crontab will be useful.

Thanks in advance.

----

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

2

Re: Automatically delete quarantined mail

You can change "AMAVISD_REMOVE_QUARANTINED_IN_DAYS" in libs/iredutils.py, but it requires you to access iRedAdmin-Pro, then it will delete all quarantined mails older than the days you specified.

Do you prefer to delete them via crontab job?

3

Re: Automatically delete quarantined mail

Try delete quarantined mails older than 7 days from MySQL database:

$ mysql -uroot -p
mysql> USE amavisd;
mysql> DELETE FROM msgs \
        WHERE content IN ('S', 's', 'V', 'Y') \
        AND quar_type IN ('Q', 'F') \
        AND UNIX_TIMESTAMP()-time_num > 604800

604800 = 7 (days) x 24 (hours) x 60 (minutes) x 60 (seconds)

4

Re: Automatically delete quarantined mail

Thanks a lot!

5

Re: Automatically delete quarantined mail

ZhangHuangbin wrote:

Try delete quarantined mails older than 7 days from MySQL database:

$ mysql -uroot -p
mysql> USE amavisd;
mysql> DELETE FROM msgs \
        WHERE content IN ('S', 's', 'V', 'Y') \
        AND quar_type IN ('Q', 'F') \
        AND UNIX_TIMESTAMP()-time_num > 604800

604800 = 7 (days) x 24 (hours) x 60 (minutes) x 60 (seconds)

I even prefer

DELETE FROM msgs\
          WHERE content IN ('S', 's', 'V', 'Y')\
          AND quar_type IN ('Q', 'F')\
          AND time_num  < DATE_SUB(NOW(), INTERVAL 7 DAY);

Thanks again.

6

Re: Automatically delete quarantined mail

robynhub wrote:

          AND time_num  < DATE_SUB(NOW(), INTERVAL 7 DAY);

Yours is better, thanks. smile

Committed into iRedAdmin-Pro, use DATE_SUB() for all time compare