1 (edited by Vortex 2020-12-28 16:57:52)

Topic: Auto learn spam/ham with Dovecot imap_sieve plugin

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): iRedMail-1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Downloaded installer
- Linux/BSD distribution name and version: Ubuntu 18.4
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Both
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Vortex wrote:

I have been setting this up and all worked well until I got to the Tests - sa-learn section where I get errors when executing these command line checks.
https://docs.iredmail.org/dovecot.imaps … ml#summary

su -s /bin/bash - amavis -c "spamassassin -D bayes < /opt/sample.eml"
error wrote:
-su: /opt/sample.eml: Permission denied

and

su -s /bin/bash amavis -c "sa-learn --dump magic"
error wrote:
bayes: cannot open bayes databases /var/lib/amavis/.spamassassin/bayes_* R/O: tie failed: Permission denied
bayes: cannot open bayes databases /var/lib/amavis/.spamassassin/bayes_* R/O: tie failed: Permission denied
ERROR: Bayes dump returned an error, please re-run with -D for more information

The error messages are using root user.  All is well elsewhere and the services are running. TIA.

----

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

2

Re: Auto learn spam/ham with Dovecot imap_sieve plugin

Try to switch to "amavis" user first, then run the commands (without the "su ..." part):

su - -s /bin/bash amavis
spamassassin -D bayes < /opt/sample.eml

3

Re: Auto learn spam/ham with Dovecot imap_sieve plugin

ZhangHuangbin wrote:

Try to switch to "amavis" user first, then run the commands (without the "su ..." part):

su - -s /bin/bash amavis
spamassassin -D bayes < /opt/sample.eml
Vortex wrote:

Thank you.  Still have a problem.

su - -s /bin/bash amavis
Password: 'Database password'
su: Authentication failure

What is the password for amavis?  I cannot authenticate.

4

Re: Auto learn spam/ham with Dovecot imap_sieve plugin

How about "su -s /bin/bash amavis" (without "-" after "su")?

5

Re: Auto learn spam/ham with Dovecot imap_sieve plugin

ZhangHuangbin wrote:

How about "su -s /bin/bash amavis" (without "-" after "su")?

Vortex wrote:

Thanks, this - was a typo, I did not use it in the terminal.

Check detailed bayes learning log wrote:
# su -s /bin/bash - amavis -c "spamassassin -D bayes < /opt/sample1.eml"
-su: /opt/sample1.eml: Permission denied

Still have the problem. As this one also.

Check bayes data wrote:
# su -s /bin/bash amavis -c "sa-learn --dump magic"
bayes: cannot open bayes databases /var/lib/amavis/.spamassassin/bayes_* R/O: tie failed: Permission denied
bayes: cannot open bayes databases /var/lib/amavis/.spamassassin/bayes_* R/O: tie failed: Permission denied
ERROR: Bayes dump returned an error, please re-run with -D for more information

Thank you, if you can help solve this problem

6

Re: Auto learn spam/ham with Dovecot imap_sieve plugin

Both commands works fine for me on a Ubuntu 18.04 VM.
What's the owner/group/permission of files under /var/lib/amavis/? Check them one by one.