From: Timo Sirainen Date: Wed, 3 Jun 2026 12:25:49 +0000 (+0000) Subject: [PATCH 7/7] lib-sieve: Log an info line when opening a CPU-disabled script X-Git-Tag: archive/raspbian/1%2.4.1+dfsg1-6+rpi1+deb13u7^2~108 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dd94a2b112f23407f7be9f8fac60a812be1d1d49;p=dovecot.git [PATCH 7/7] lib-sieve: Log an info line when opening a CPU-disabled script sieve_binary_check_executable() blocks execution when a script's persisted cumulative CPU usage already exceeds sieve_max_cpu_time, but only logged the block at debug level. With cumulative tracking now sticky across redeliveries via the per-user sieve-rusage file, the script can stay blocked indefinitely until the resource_usage_timeout decay or admin intervention; operators benefit from a per-attempt record of that block at info level. Promote the existing debug log to e_info and include the cumulative CPU usage. The caller continues to emit its own error message on the failed open (lda-sieve, imap-sieve, imap-filter-sieve plugin paths). Gbp-Pq: Name 0007-lib-sieve-Log-an-info-line-when-opening-a-CPU-disabl.patch --- diff --git a/pigeonhole/src/lib-sieve/sieve-binary-file.c b/pigeonhole/src/lib-sieve/sieve-binary-file.c index a379828..8a83cb1 100644 --- a/pigeonhole/src/lib-sieve/sieve-binary-file.c +++ b/pigeonhole/src/lib-sieve/sieve-binary-file.c @@ -935,15 +935,23 @@ int sieve_binary_check_executable(struct sieve_binary *sbin, const char **client_error_r) { struct sieve_resource_usage rusage; + struct sieve_script *script = sbin->script; *client_error_r = NULL; sieve_error_args_init(&error_code_r, NULL); sieve_binary_get_resource_usage(sbin, &rusage); if (sieve_resource_usage_is_excessive(sbin->svinst, &rusage)) { - e_debug(sbin->event, - "Binary execution is blocked: " - "Cumulative resource usage limit exceeded"); + /* Cumulative resource usage is only tracked for personal + scripts. */ + i_assert(script != NULL); + i_assert(sieve_storage_is_personal(script->storage)); + + e_info(sbin->event, + "Personal sieve processing disabled for script '%s': " + "cumulative resource usage limit exceeded (%s)", + sieve_script_label(script), + sieve_resource_usage_get_summary(&rusage)); *error_code_r = SIEVE_ERROR_RESOURCE_LIMIT; *client_error_r = "cumulative resource usage limit exceeded"; return 0;