Any updates on this topic? Mine is growing out of control as well and it's not clear to me how I would "manually" go about deleting the entries which currently stand at 1189092.
I'm going to poke around and report back if I come up with a command. What I can say though is that this started for me about a week or 10 days after I upgraded amavisd (CentOS7):
[root@voyageur 2020]# egrep amavis /var/log/yum.log*
/var/log/yum.log-20210101:Sep 15 13:13:56 Installed: amavis-2.12.0-9.el7.noarch
/var/log/yum.log-20210101:Sep 15 13:13:56 Erased: amavisd-new-2.11.1-1.el7.noarch
/var/log/yum.log-20210101:Oct 20 11:54:53 Updated: amavis-2.12.0-10.el7.noarch
[root@voyageur 2020]# ls -alh 10/*/amavis*
-rw-r--r-- 1 root root 5.5M Oct 1 02:06 10/01/amavisd-2020-10-01-02-06-02.sql.bz2
-rw-r--r-- 1 root root 5.7M Oct 2 02:06 10/02/amavisd-2020-10-02-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.3M Oct 3 02:06 10/03/amavisd-2020-10-03-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.6M Oct 4 02:06 10/04/amavisd-2020-10-04-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.6M Oct 5 02:06 10/05/amavisd-2020-10-05-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.6M Oct 6 02:06 10/06/amavisd-2020-10-06-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.3M Oct 7 02:06 10/07/amavisd-2020-10-07-02-06-01.sql.bz2
-rw-r--r-- 1 root root 7.0M Oct 8 02:06 10/08/amavisd-2020-10-08-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.6M Oct 9 02:06 10/09/amavisd-2020-10-09-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.5M Oct 10 02:06 10/10/amavisd-2020-10-10-02-06-01.sql.bz2
-rw-r--r-- 1 root root 6.5M Oct 11 02:06 10/11/amavisd-2020-10-11-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.0M Oct 12 02:06 10/12/amavisd-2020-10-12-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.0M Oct 13 02:06 10/13/amavisd-2020-10-13-02-06-02.sql.bz2
-rw-r--r-- 1 root root 4.7M Oct 14 02:06 10/14/amavisd-2020-10-14-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.5M Oct 15 02:06 10/15/amavisd-2020-10-15-02-06-02.sql.bz2
-rw-r--r-- 1 root root 6.0M Oct 16 02:06 10/16/amavisd-2020-10-16-02-06-01.sql.bz2
-rw-r--r-- 1 root root 6.0M Oct 17 02:06 10/17/amavisd-2020-10-17-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.2M Oct 18 02:06 10/18/amavisd-2020-10-18-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.3M Oct 19 02:06 10/19/amavisd-2020-10-19-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.2M Oct 20 02:06 10/20/amavisd-2020-10-20-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.0M Oct 21 02:06 10/21/amavisd-2020-10-21-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.7M Oct 22 02:06 10/22/amavisd-2020-10-22-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.8M Oct 23 02:06 10/23/amavisd-2020-10-23-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.6M Oct 24 02:06 10/24/amavisd-2020-10-24-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.0M Oct 25 02:06 10/25/amavisd-2020-10-25-02-06-01.sql.bz2
-rw-r--r-- 1 root root 4.4M Oct 26 02:06 10/26/amavisd-2020-10-26-02-06-02.sql.bz2
-rw-r--r-- 1 root root 4.5M Oct 27 02:06 10/27/amavisd-2020-10-27-02-06-01.sql.bz2
-rw-r--r-- 1 root root 5.1M Oct 28 02:06 10/28/amavisd-2020-10-28-02-06-01.sql.bz2
-rw-r--r-- 1 root root 6.9M Oct 29 02:06 10/29/amavisd-2020-10-29-02-06-01.sql.bz2
-rw-r--r-- 1 root root 8.7M Oct 30 02:06 10/30/amavisd-2020-10-30-02-06-01.sql.bz2
-rw-r--r-- 1 root root 11M Oct 31 02:06 10/31/amavisd-2020-10-31-02-06-01.sql.bz2
Current backup size:
[root@voyageur 2020]# ls -alh /var/vmail/backup/mysql/2021/02/13/amavisd-2021-02-13-02-06-01.sql.bz2
-r-------- 1 root root 175M Feb 13 02:07 /var/vmail/backup/mysql/2021/02/13/amavisd-2021-02-13-02-06-01.sql.bz2
When I manually run the cleanup script:
[root@voyageur 2020]# /usr/bin/python3 /var/www/iredadmin/tools/cleanup_amavisd_db.py
* Backend: ldap
* SQL server: 127.0.0.1:3306
* Enable dirty read for querying without locking SQL tables.
* Delete quarantined mails which older than 7 days
* Delete incoming/outgoing emails which older than 3 days
* [-] Deleting records: 1 - 100 (Sat Feb 13 08:37:28 2021)
* Delete unreferenced records from table `msgrcpt`.
* Delete unreferenced records from table `quarantine`.
* Delete unreferenced records from table `maddr`.
* [-] Deleting records: 0 - 2 (Sat Feb 13 08:39:19 2021)
* Delete unreferenced records from table `mailaddr`.
*
* Remained records:
*
* `msgs`: 1189092
* `quarantine`: 7
* `maddr`: 745988
* `mailaddr`: 25835
* Log cleanup status.