]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 7/7] lib-sieve: Log an info line when opening a CPU-disabled script
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Jun 2026 12:25:49 +0000 (12:25 +0000)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
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

pigeonhole/src/lib-sieve/sieve-binary-file.c

index a379828156e97f31fdc46cd454215e5a51bb7658..8a83cb1e60f4f8aa69af19b3a75f18bb9b8fbf79 100644 (file)
@@ -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;