Piegeonhole and PATH variable
Hello,
I have a dovecot-sieve rule that has been working fine for years which calls sa-learn whenever a message is moved from or to the Junk folder.
Recently, but I don't know when it started exactly, this no longer works. I get the following error message in mail.log:
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.
Error: program exec:/usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh (2526990): Forcibly terminated with signal 15
Error: sieve: failed to pipe message to program `sa-learn-spam.sh': refer to server log for more information. [2024-10-16 10:16:51]
Error: sieve: Execution of script /usr/lib/dovecot/sieve-pipe/report-spam.sieve failed
The content of report-spam.sieve is
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
if environment :matches "imap.user" "*" { set "username" "${1}"; }
pipe :copy "sa-learn-spam.sh" [ "${username}" ];
So my guess is that one of the require on the first line triggers this Unix.pm, and it fails because somehow the PATH variable is not set in this context.
However, I am at a complete loss to determine how to change the environment variable in the context of dovecot-sieve. And also, I am not sure why this would be required.
Does somebody know how to fix this problem, or alternatively point me to the relevant part in the documentation?
Thanks,
Julien
On 16/10/2024 11:34 EEST Julien Salort via dovecot dovecot@dovecot.org wrote: Hello, I have a dovecot-sieve rule that has been working fine for years which calls sa-learn whenever a message is moved from or to the Junk folder. Recently, but I don't know when it started exactly, this no longer works. I get the following error message in mail.log: 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. Error: program exec:/usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh (2526990): Forcibly terminated with signal 15 Error: sieve: failed to pipe message to program `sa-learn-spam.sh': refer to server log for more information. [2024-10-16 10:16:51] Error: sieve: Execution of script /usr/lib/dovecot/sieve-pipe/report-spam.sieve failed The content of report-spam.sieve is require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; if environment :matches "imap.user" "*" { set "username" "${1}"; } pipe :copy "sa-learn-spam.sh" [ "${username}" ]; So my guess is that one of the require on the first line triggers this Unix.pm, and it fails because somehow the PATH variable is not set in this context. However, I am at a complete loss to determine how to change the environment variable in the context of dovecot-sieve. And also, I am not sure why this would be required. Does somebody know how to fix this problem, or alternatively point me to the relevant part in the documentation? Thanks, Julien _______________________________________________ dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org Make sure import_environment setting includes PATH. Aki
Le 16/10/2024 à 11:46, Aki Tuomi via dovecot a écrit :
Make sure import_environment setting includes PATH.
Thank you for your reply.
I have added:
import_environment = TZ PATH
in /etc/dovecot/dovecot.conf
but I still get:
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.
Strangely, I no longer have the other three error messages (Error: program exec:/usr/lib/dovecot/sieve-pipe/sa-learn-spam.sh (2526990): Forcibly terminated with signal 15, Error: sieve: failed to pipe message to program `sa-learn-spam.sh': refer to server log for more information. and Error: sieve: Execution of script /usr/lib/dovecot/sieve-pipe/report-spam.sieve failed).
So it is not clear to me if the issue is fixed.
I have also never been able to enable a clear message in mail.log upon successful execution of report-spam.sieve.
Julien
participants (2)
-
Aki Tuomi
-
Julien Salort