X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsieve.c;h=cce70574ae927c451f165af0488e47215e27ac8c;hb=HEAD;hp=ee6bcec9e4afa0240ca803485592501d987e09c6;hpb=b39d860713ddd390339211be8d398c4d4b6680ba;p=citadel.git diff --git a/webcit/sieve.c b/webcit/sieve.c index ee6bcec9e..2e3d61585 100644 --- a/webcit/sieve.c +++ b/webcit/sieve.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996-2012 by the citadel.org team + * Copyright (c) 1996-2020 by the citadel.org team * * This program is open source software. You can redistribute it and/or * modify it under the terms of the GNU General Public License version 3. @@ -9,7 +9,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * FIXME: add logic to exclude the webcit-generated script from the manual script selection + * + * Implementation note: this was kind of hacked up when we switched from Sieve to custom rules. + * As a result there's probably some cruft in here... + * ajc 2020jul12 + * */ #include "webcit.h" @@ -22,220 +26,6 @@ CtxType CTX_SIEVESCRIPT = CTX_NONE; #define RULES_SCRIPT "__WebCit_Generated_Script__" -/* - * Helper function for output_sieve_rule() to output strings with quotes escaped - */ -void osr_sanitize(char *str) { - int i, len; - - if (str == NULL) return; - len = strlen(str); - for (i=0; i 0) { - for (i=0; i sizeof(WC_RULE_HEADER) - 1) && - (!strncasecmp(ChrPtr(Line), HKEY(WC_RULE_HEADER)))) + if ((StrLength(Line) > sizeof(WC_RULE_HEADER) - 1) && (!strncasecmp(ChrPtr(Line), HKEY(WC_RULE_HEADER)))) { StrBufSkip_NTokenS(Line, &pch, '|', 1); n = StrBufExtractNext_int(Line, &pch, '|'); @@ -959,7 +640,5 @@ InitModule_SIEVE /* fetch our room into WCC->ThisRoom, to evaluate while iterating over rooms with COND:THIS:THAT:ROOM */ RegisterNamespace("SIEVE:SCRIPT:LOOKUP_FILEINTO", 0, 1, tmplput_SieveRule_lookup_FileIntoRoom, NULL, CTX_SIEVESCRIPT); WebcitAddUrlHandler(HKEY("save_sieve"), "", 0, save_sieve, 0); - WebcitAddUrlHandler(HKEY("create_script"), "", 0, create_script, 0); - WebcitAddUrlHandler(HKEY("delete_script"), "", 0, delete_script, 0); WebcitAddUrlHandler(HKEY("display_sieve_add_or_delete"), "", 0, display_sieve_add_or_delete, 0); }