lprintf(CTDL_DEBUG, "Action is REJECT\n");
/* If we don't know who sent the message, do a DISCARD instead. */
- if (strlen(cs->sender) == 0) {
+ if (IsEmptyStr(cs->sender)) {
lprintf(CTDL_INFO, "Unknown sender. Doing DISCARD instead of REJECT.\n");
return ctdl_discard(s, my);
}
sprintf(&text[strlen(text)], CTDLSIEVECONFIGSEPARATOR);
}
- /* Save the config */
- quickie_message("Citadel", NULL, NULL, u->config_roomname,
- text,
- 4,
- "Sieve configuration"
- );
-
- free (text);
- /* And delete the old one */
- if (u->config_msgnum > 0) {
- CtdlDeleteMessages(u->config_roomname, &u->config_msgnum, 1, "");
+ if (yes_write_to_disk)
+ {
+ /* Save the config */
+ quickie_message("Citadel", NULL, NULL, u->config_roomname,
+ text,
+ 4,
+ "Sieve configuration"
+ );
+
+ /* And delete the old one */
+ if (u->config_msgnum > 0) {
+ CtdlDeleteMessages(u->config_roomname, &u->config_msgnum, 1, "");
+ }
}
+ free (text);
+
}
/* First see if the supplied value is ok */
- if (strlen(script_name) == 0) {
+ if (IsEmptyStr(script_name)) {
ok = 1;
}
else {
if (!strcasecmp(subcmd, "putscript")) {
extract_token(script_name, argbuf, 1, '|', sizeof script_name);
- if (strlen(script_name) > 0) {
+ if (!IsEmptyStr(script_name)) {
cprintf("%d Transmit script now\n", SEND_LISTING);
script_content = CtdlReadMessageBody("000", config.c_maxmsglen, NULL, 0);
msiv_putscript(&u, script_name, script_content);