From: Art Cancro Date: Tue, 28 Feb 2012 16:25:12 +0000 (-0500) Subject: Stop processing if the Sieve script is empty. X-Git-Tag: v8.11~155^2 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=51f4a1b3c13bf039d2eac1c62b4e41c45f4c56a3 Stop processing if the Sieve script is empty. --- diff --git a/citadel/modules/sieve/serv_sieve.c b/citadel/modules/sieve/serv_sieve.c index b52bb3bdb..71e7f7532 100644 --- a/citadel/modules/sieve/serv_sieve.c +++ b/citadel/modules/sieve/serv_sieve.c @@ -889,7 +889,14 @@ void sieve_do_room(char *roomname) { return; } - /* FIXME this is where we have to check for empty scripts */ + /* + * Check to see whether the script is empty and should not be processed. + * A script is considered non-empty if it contains at least one semicolon. + */ + if ((strchr(get_active_script(&u), ';') == NULL)) { + syslog(LOG_DEBUG, "Sieve script is empty. No processing is required."); + return; + } syslog(LOG_DEBUG, "Rules found. Performing Sieve processing for <%s>", roomname);