• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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.
 
I ran into the same problem. Adding the PATH to said 2 files solved the issue, but it gets overwritten every time the plugin updates or a component is removed from Plesk. Can you make that fix permanent and ship it with the next version? Thanks!
 
Hello, @Cmdr . Did you update /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-ham.sh and /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-spam.sh or /var/qmail/popuser/es-learn-spam.sh and /var/qmail/popuser/es-learn-ham.sh?
I believe /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-ham.sh and /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-spam.sh shouldn't be automatically overridden.
 
Hello, @Cmdr . Did you update /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-ham.sh and /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-spam.sh or /var/qmail/popuser/es-learn-spam.sh and /var/qmail/popuser/es-learn-ham.sh?
I believe /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-ham.sh and /usr/local/psa/admin/plib/modules/email-security/resources/dovecot/es-learn-spam.sh shouldn't be automatically overridden.
Hello @Sebahat.hadzhi,

I edited all 4 of the files originally. The ones in /var/qmail/popuser solved the issue after a reboot of amavis, but I also modified the other 2 at the time.

The issue was gone from the logs for a few days until they appeared again. That’s when I noticed that the email security plugin was updated that morning and all files returned to its former state.

I edited the other 2 in the resources/dovecot directory and will check if it survives the next update, but I am quite sure it didn’t the last time.
 
Back
Top