From 51f4a1b3c13bf039d2eac1c62b4e41c45f4c56a3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 28 Feb 2012 11:25:12 -0500 Subject: [PATCH] Stop processing if the Sieve script is empty. --- citadel/modules/sieve/serv_sieve.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.30.2