Stop processing if the Sieve script is empty.
[citadel.git] / citadel / modules / sieve / serv_sieve.c
index b52bb3bdb51ecaf4ac8a08be9bfe5faa87b87e47..71e7f753261d2df122ee03318866d38f080669fc 100644 (file)
@@ -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);