• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Resolved Plesk Email Security and Dovecot Problems

aschulzunna

New Pleskian
Server operating system version
Ubuntu 22.04.4 LTS
Plesk version and microupdate number
18.0.61 #4
Hello,
I've installed and licensed Plesk Email Security.
First what happens:
Everytime a mail was moved from spam folder and the same sender writes again, the new mail goes to spam again.
In Dashboard Amavis, ClamAV, Dovecot and Postfix are green.
Sended and received HAM counting.

In logfiles are two errors:

imap: Error: TxRep: cannot run when Auto-Whitelist is enabled. Please disable it!
imap: Error: Use of uninitialized value $ENV{"PATH"} in split at /usr/lib/x86_64-linux-gnu/perl-base/File/Spec/Unix.pm line 136.

What I've done:
In /etc/mail/spamassassin/local.cf changed from "loadplugin Mail::SpamAssassin::plugin::AWL" to "loadplugin Mail::SpamAssassin::plugin::TxRep" so the first error message no longer exist.

Like some posts explains, in /etc/dovecot/dovecot.conf I insert "import_environment = $import_environment PATH". The second error perists and problem that mails are in spam folder persists.

Thank's for any idea or solution to fix ist.
 
What the output of cat /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-ham.sh and cat /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-spam.sh?
 
Last edited:
Try to add to following lines on a new line below #!/bin/sh of both these files (es-learn-ham.sh and es-learn-spam.sh)
Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH

After that restart Amavis systemctl restart amavis.
 
I've done in both files:
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH
exec /usr/bin/sa-learn -u ${1} --spam
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH
exec /usr/bin/sa-learn -u ${1} --ham
I've restarted amavis and dovecot. But the error persists.

May 29 22:17:34 mx dovecot: imap: Error: Use of uninitialized value $ENV{"PATH"} in split at /usr/lib/x86_64-linux-gnu/perl-base/File/Spec/Unix.pm line 136.
 
Do the files /var/qmail/popuser/es-learn-spam.sh and /var/qmail/popuser/es-learn-ham.sh exist too?
 
Both files exists. I'ved added the two PATH Lines and restart amavis.

The error message is gone. Seems the problem is solved.

Thank you very much.
 
Back
Top