* but WITHOUT ANY WARRANTY; without even the implied warranty of
* 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
*/
#include "webcit.h"
#define MAX_RULES 50
#define RULES_SCRIPT "__WebCit_Generated_Script__"
+
/*
* Helper function for output_sieve_rule() to output strings with quotes escaped
*/
serv_printf("{");
}
-
/* Do action */
if (!strcasecmp(action, "keep")) {
serv_printf("vacation :addresses [%s]\n\"%s\";", my_addresses, automsg);
}
-
/* Do 'final' action */
if (!strcasecmp(final, "stop")) {
serv_printf("stop;");
}
-
/* Close the braces if we're in a conditional loop */
if (strcasecmp(hfield, "all")) {
serv_printf("}");
}
-
/* End of rule. */
}
-
/*
* Translate the fields from the rule editor into something we can save...
*/
}
-
/*
* save sieve config
*/
int bigaction;
char script_names[MAX_SCRIPTS][64];
int num_scripts = 0;
- int active_script = (-1); /* this throws a 'set but not used' warning , check this ! */
int i;
char this_name[64];
char buf[256];
if (buf[0] == '1') while (serv_getln(buf, sizeof(buf)), strcmp(buf, "000")) {
if (num_scripts < MAX_SCRIPTS) {
extract_token(script_names[num_scripts], buf, 0, '|', 64);
- if (extract_int(buf, 1) > 0) {
- active_script = num_scripts;
- }
++num_scripts;
}
}
return;
}
+
/*
* create a new script
* take the web environment script name and create it on the citadel server
}
-
-
/*
* delete a script
*/
do_template("sieve_add");
wDumpContent(1);
}
-
/*
int Done = 0;
SieveListing *Ruleset;
- if (WCC->KnownSieveScripts != NULL)
+ if (WCC->KnownSieveScripts != NULL) {
return WCC->KnownSieveScripts;
+ }
serv_puts("MSIV listscripts");
Line = NewStrBuf();
++num_scripts;
}
}
- if ((num_scripts > 0) && (rules_script_active == 0))
+
+ if ((num_scripts > 0) && (rules_script_active == 0)) {
PutBstr(HKEY("__SIEVE:EXTERNAL_SCRIPT"), NewStrBufPlain(HKEY("1")));
+ }
if (num_scripts > have_rules_script)
{
(vRuleset != NULL))
{
Ruleset = (SieveListing *) vRuleset;
-
- /*
- * its the webcit rule? we don't need to load that here.
- */
- if (Ruleset->IsRulesScript)
- continue;
-
- if (!serv_printf("MSIV getscript|%s", ChrPtr(Ruleset->Name)))
- break;
+ serv_printf("MSIV getscript|%s", ChrPtr(Ruleset->Name));
StrBuf_ServGetln(Line);
if (GetServerStatus(Line, NULL) == 1)
{
Ruleset->Content = NewStrBuf();
+ Done = 0;
while(!Done && (rc = StrBuf_ServGetln(Line), rc >= 0) )
if ( (StrLength(Line)==3) &&
!strcmp(ChrPtr(Line), "000"))