Topic: iRedMail new install 1.3.1: Autolearn spam/ham uses bad database path
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Dear Zhang,
on my new Debian 10 iRedMail 1.3.1 server I implemented the autolean spam/ham feature from https://docs.iredmail.org/dovecot.imapsieve.html
It looks like the cron script does not use the correct spamassassin database path.
Background:
Spam/ham is learned by following script
# iRedMail: Scan reported mails.
*/10 * * * * /bin/bash /etc/dovecot/sieve/scan_reported_mails.sh
That script uses
# `sa-learn` command, with optional arguments.
export SA_LEARN="sa-learn -u ${AMAVISD_USER}"
To learn spam but the database is saved to /root/.spamassassin
It should be placed in /var/lib/amavis/.spamassassin
Proposed fix:
Script /etc/dovecot/sieve/scan_reported_mails.sh should use
# `sa-learn` command, with optional arguments.
export SA_LEARN="sa-learn --dbpath /var/lib/amavis/.spamassassin -u ${AMAVISD_USER}"
Tested and working on my installation.
Thanks!
Best regards,
Bernhard
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.