if (!read_spoolcontrol_file(&sc, filename))
{
end_critical_section(S_NETCONFIGS);
- snprintf(errmsgbuf, n, "This mailing list only accepts posts from subscribers.");
+ snprintf(errmsgbuf, n,
+ "This mailing list only accepts posts from subscribers.");
return (ERROR + NO_SUCH_USER);
}
end_critical_section(S_NETCONFIGS);
found = is_recipient (sc, RemoteIdentifier);
free_spoolcontrol_struct(&sc);
- if (found)
+ if (found) {
return (0);
- else
+ }
+ else {
+ snprintf(errmsgbuf, n,
+ "This mailing list only accepts posts from subscribers.");
return (ERROR + NO_SUCH_USER);
+ }
}
return (0);
}
this_recp_cooked[j] = '\0';
invalid = 0;
+ errmsg[0] = 0;
switch(mailtype) {
case MES_LOCAL:
if (!strcasecmp(this_recp, "sysop")) {
err = CtdlDoIHavePermissionToPostInThisRoom(errmsg,
sizeof errmsg,
RemoteIdentifier,
- Flags);
+ Flags
+ );
if (err)
{
- cprintf("%d %s\n", err, errmsg);
++ret->num_error;
invalid = 1;
}
break;
}
if (invalid) {
- if (IsEmptyStr(ret->errormsg)) {
- snprintf(append, sizeof append,
- "Invalid recipient: %s",
- this_recp);
+ if (IsEmptyStr(errmsg)) {
+ snprintf(append, sizeof append, "Invalid recipient: %s", this_recp);
}
else {
- snprintf(append, sizeof append, ", %s", this_recp);
+ snprintf(append, sizeof append, "%s", errmsg);
}
- if ( (strlen(ret->errormsg) + strlen(append)) < SIZ) {
+ if ( (strlen(ret->errormsg) + strlen(append) + 3) < SIZ) {
+ if (!IsEmptyStr(ret->errormsg)) {
+ strcat(ret->errormsg, "; ");
+ }
strcat(ret->errormsg, append);
}
}
valid_to = validate_recipients(recp, NULL, 0);
if (valid_to->num_error > 0) {
- cprintf("%d Invalid recipient (To)\n", ERROR + NO_SUCH_USER);
+ cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_to->errormsg);
free_recipients(valid_to);
return;
}
valid_cc = validate_recipients(cc, NULL, 0);
if (valid_cc->num_error > 0) {
- cprintf("%d Invalid recipient (CC)\n", ERROR + NO_SUCH_USER);
+ cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_cc->errormsg);
free_recipients(valid_to);
free_recipients(valid_cc);
return;
valid_bcc = validate_recipients(bcc, NULL, 0);
if (valid_bcc->num_error > 0) {
- cprintf("%d Invalid recipient (BCC)\n", ERROR + NO_SUCH_USER);
+ cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_bcc->errormsg);
free_recipients(valid_to);
free_recipients(valid_cc);
free_recipients(valid_bcc);
/** check for ImportantMessages (these display in a div overlaying the main screen) */
if (!IsEmptyStr(WC->ImportantMessage)) {
- wprintf("<div id=\"important_message\">\n");
- wprintf("<span class=\"imsg\">"
- "%s</span><br />\n", WC->ImportantMessage);
- wprintf("</div>\n");
- wprintf("<script type=\"text/javascript\">\n"
- " setTimeout('hide_imsg_popup()', 3000); \n"
+ wprintf("<div id=\"important_message\">\n"
+ "<span class=\"imsg\">");
+ escputs(WC->ImportantMessage);
+ wprintf("</span><br />\n"
+ "</div>\n"
+ "<script type=\"text/javascript\">\n"
+ " setTimeout('hide_imsg_popup()', 5000); \n"
"</script>\n");
- safestrncpy(WC->ImportantMessage, "", sizeof WC->ImportantMessage);
+ WC->ImportantMessage[0] = 0;
}
if ( (WC->logged_in) && (!unset_cookies) ) {