Hello,

I have a small problem with dovecot-lda. I am using Debian 12 Bookworm:

root@lnxmail01:~# dovecot --version
2.3.13 (89f716dc2)


Historically grown (probably still from sendmail times, long time ago) I always used procmail for local e-mail delivery. This also included the call for spamc for SpamAssassin.

I have now changed this and set up a route via sieve. There is a small script for this:

root@lnxmail01:~# cat /usr/lib/dovecot/sieve-filter/spamc-filter.sh
#!/bin/bash

/usr/bin/spamc


My sieve configuration says (in extracts):

root@lnxmail01:~# head -12 ~meini/.dovecot.sieve
## Generated by Roundcube Webmail SieveRules Plugin ##

require ["body","comparator-i;ascii-numeric","copy","envelope","fileinto","imap4flags","include","regex","relational","spamtestplus","vacation","variables","spamtest"];

include :global "spamc";

# rule:[Spam]
if spamtest :value "ge" :comparator "i;ascii-numeric" "5"
{
        fileinto "Spam";
        stop;
}


In general, this has been working for many months without any problems. But sometimes the whole thing fails due to a timeout:

Jul 7 22:00:13 lnxmail01 dovecot: lda(meini)<766014><G9l7JcPzimY+sAsAmbNf3A>: Error: program exec:/usr/lib/dovecot/sieve-filter/spamc-filter.sh (766016): Execution timed out (> 10000 msecs) Jul 7 22:00:13 lnxmail01 dovecot: lda(meini)<766014><G9l7JcPzimY+sAsAmbNf3A>: Error: program exec:/usr/lib/dovecot/sieve-filter/spamc-filter.sh (766016): Forcibly terminated with signal 15 Jul 7 22:00:13 lnxmail01 dovecot: lda(meini)<766014><G9l7JcPzimY+sAsAmbNf3A>: Panic: output stream (temp iostream in /tmp/dovecot.lda. for (program client seekable output)) is missing error handling Jul 7 22:00:13 lnxmail01 dovecot: lda(meini)<766014><G9l7JcPzimY+sAsAmbNf3A>: Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(backtrace_append+0x42) [0x7ff00aee04e2] -> /usr/lib/dovecot/libdovecot.so.0(backtrace_get+0x1e) [0x7ff00aee05fe] -> /usr/lib/dovecot/libdovecot.so.0(+0xfc49b) [0x7ff00aeec49b] -> /usr/lib/dovecot/libdovecot.so.0(+0xfc501) [0x7ff00aeec501] -> /usr/lib/dovecot/libdovecot.so.0(+0x53aee) [0x7ff00ae43aee] -> /usr/lib/dovecot/libdovecot.so.0(o_stream_unref+0x5e) [0x7ff00af1003e] -> /usr/lib/dovecot/libdovecot.so.0(program_client_destroy+0x8e) [0x7ff00ae6ee6e] -> /usr/lib/dovecot/modules/sieve/lib90_sieve_extprograms_plugin.so(sieve_extprogram_destroy+0x18) [0x7ff00aacd8f8] -> /usr/lib/dovecot/modules/sieve/lib90_sieve_extprograms_plugin.so(+0x556d) [0x7ff00aacb56d] -> /usr/lib/dovecot/libdovecot-sieve.so.0(sieve_interpreter_continue+0xea) [0x7ff00ab4c9ba] -> /usr/lib/dovecot/libdovecot-sieve.so.0(ext_include_execute_include+0x2c7) [0x7ff00ab72e17] -> /usr/lib/dovecot/libdovecot-sieve.so.0(sieve_interpreter_continue+0xea) [0x7ff00ab4c9ba] -> /usr/lib/dovecot/libdovecot-sieve.so.0(sieve_multiscript_run+0x82) [0x7ff00ab62b32] -> /usr/lib/dovecot/modules/lib90_sieve_plugin.so(+0x37a3) [0x7ff00abd47a3] -> /usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0x176) [0x7ff00b11f906] -> /usr/lib/dovecot/dovecot-lda(main+0x879) [0x55ef085e4fb9] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7ff00ac3ad0a] -> /usr/lib/dovecot/dovecot-lda(_start+0x2a) [0x55ef085e56ea]



The worst thing is that the entire mail is lost (/dev/null)!

Then I tried to set the timeout higher (than the current 10 seconds):

root@lnxmail01:~# doveconf | grep -A 12 ^plugin
plugin {
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_execute_exec_timeout = 60s
  sieve_extension_exec_timeout = 60s
  sieve_extensions = +vnd.dovecot.filter +spamtest +spamtestplus
  sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
  sieve_filter_socket_dir = sieve-filter
  sieve_global = /usr/lib/dovecot/sieve-global
  sieve_plugins = sieve_extprograms
  sieve_spamtest_max_value = 5
  sieve_spamtest_status_header = X-Spam-Level
  sieve_spamtest_status_type = strlen
}


I have set both the values for "sieve_execute_exec_timeout" and "sieve_extension_exec_timeout" to 60 sec, but according to the log, this does not seem to affect the 10000 msec mentioned therein.

The SpamAssassin daemon has enough child processes to handle the requests (most of them were idle at the time of the error).

How can I configure that the external script gets more time for execution? And what can I do so that - should the script terminate contrary to expectations or be killed in the timeout - the mail is not lost but simply processed further?

Many thanks & best regards
Meinhard
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to