]> code.citadel.org Git - citadel.git/blobdiff - webcit/sieve.c
* Remove 4096 byte limit on sieve scripts.
[citadel.git] / webcit / sieve.c
index 0f9687d3552c50cb79c8e66f9936de3d3b608307..dc511b4ab83c6bd6d7696a9808486784cdf518d5 100644 (file)
@@ -5,7 +5,7 @@
 #include "webcit.h"
 
 #define MAX_SCRIPTS    100
-#define MAX_RULES      25
+#define MAX_RULES      50
 #define RULES_SCRIPT   "__WebCit_Generated_Script__"
 
 
@@ -49,7 +49,7 @@ void display_sieve(void)
        int i;
        int rules_script_is_active = 0;
 
-       if (!serv_info.serv_supports_sieve) {
+       if (!WC->serv_info->serv_supports_sieve) {
                display_no_sieve();
                return;
        }
@@ -620,9 +620,9 @@ void save_sieve(void) {
                                serv_getln(buf, sizeof buf);
                                if (buf[0] == '4') {
                                        snprintf(this_name, sizeof this_name, "text_%s", script_names[i]);
-                                       striplt((char*)BSTR(this_name)); /* TODO: get rid of typecast*/
-                                       serv_printf("%s", bstr(this_name));
-                                       serv_puts("000");
+                                       striplt((char *)BSTR(this_name)); /* TODO: get rid of typecast*/
+                                       serv_write(BSTR(this_name), strlen(BSTR(this_name)));
+                                       serv_puts("\n000");
                                }
                        }
                }
@@ -651,12 +651,14 @@ void display_add_remove_scripts(char *message)
        
        wprintf("<div id=\"content\" class=\"service\">\n");
 
-       if (message != NULL) wprintf(message);
+       if (message != NULL) {
+               wprintf("%s", message);
+       }
 
        wprintf("<table border=0 cellspacing=10><tr valign=top><td>\n");
 
        svput("BOXTITLE", WCS_STRING, _("Add a new script"));
-       do_template("beginbox", NULL);
+       do_template("beginboxx", NULL);
 
        wprintf(_("To create a new script, enter the desired "
                "script name in the box below and click 'Create'."));
@@ -672,7 +674,7 @@ void display_add_remove_scripts(char *message)
        do_template("endbox", NULL);
 
        svput("BOXTITLE", WCS_STRING, _("Edit scripts"));
-       do_template("beginbox", NULL);
+       do_template("beginboxx", NULL);
        wprintf("<br /><div align=center><a href=\"display_sieve\">%s</a><br /><br />\n",
                _("Return to the script editing screen")
        );
@@ -681,7 +683,7 @@ void display_add_remove_scripts(char *message)
        wprintf("</td><td>");
 
        svput("BOXTITLE", WCS_STRING, _("Delete scripts"));
-       do_template("beginbox", NULL);
+       do_template("beginboxx", NULL);
 
        wprintf(_("To delete an existing script, select the script "
                "name from the list and click 'Delete'."));