CtdlSaveMsgPointerInRoom(SMTP_SPOOLOUT_ROOM, newmsgid, 0);
}
+ /* If other rooms are specified, drop them there too. */
+ if (recps != NULL)
+ if (recps->num_room > 0)
+ for (i=0; i<num_tokens(recps->recp_room, '|'); ++i) {
+ extract(recipient, recps->recp_room, i);
+ lprintf(9, "Delivering to local room <%s>\n",
+ recipient);
+ CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0);
+ }
+
/* Bump this user's messages posted counter. */
lprintf(9, "Updating user\n");
lgetuser(&CC->usersupp, CC->curr_user);
}
}
- if ((ret->num_local + ret->num_internet +
- ret->num_ignet + ret->num_error) == 0) {
+ if ((ret->num_local + ret->num_internet + ret->num_ignet +
+ ret->num_room + ret->num_error) == 0) {
++ret->num_error;
strcpy(ret->errormsg, "No recipients specified.");
}
}
valid = validate_recipients(recp);
- lprintf(9, "validate_recipients(%s)\n", recp);
- lprintf(9, " num_local = %d\n", valid->num_local);
- lprintf(9, " num_internet = %d\n", valid->num_internet);
- lprintf(9, " num_ignet = %d\n", valid->num_ignet);
- lprintf(9, " num_error = %d\n", valid->num_error);
- lprintf(9, " errormsg = %s\n", valid->errormsg);
- lprintf(9, " display_recp = %s\n", valid->display_recp);
-
if (valid->num_error > 0) {
cprintf("%d %s\n",
- ERROR + NO_SUCH_USER,
- valid->errormsg);
+ ERROR + NO_SUCH_USER, valid->errormsg);
phree(valid);
return;
}
int number_of_rooms;
int delivery_mode;
int message_originated_locally;
+ struct recptypes *valid;
};
enum { /* Command states for login authentication */
*/
void smtp_rset(void) {
memset(SMTP, 0, sizeof(struct citsmtp));
- if (SMTP_RECPS != NULL) strcpy(SMTP_RECPS, "");
- if (SMTP_ROOMS != NULL) strcpy(SMTP_ROOMS, "");
- if (CC->logged_in) logout(CC);
+ if (CC->logged_in) {
+ logout(CC);
+ }
cprintf("250 Zap!\r\n");
}
void smtp_data_clear(void) {
strcpy(SMTP->from, "");
SMTP->number_of_recipients = 0;
- SMTP->number_of_rooms = 0;
SMTP->delivery_mode = 0;
SMTP->message_originated_locally = 0;
- if (SMTP_RECPS != NULL) strcpy(SMTP_RECPS, "");
- if (SMTP_ROOMS != NULL) strcpy(SMTP_ROOMS, "");
+ memset(SMTP->valid, 0, sizeof(struct recptypes));
}
cvt = convert_internet_address(user, node, SMTP->from);
lprintf(9, "cvt=%d, citaddr=<%s@%s>\n", cvt, user, node);
if ( (cvt != 0) || (strcasecmp(user, CC->usersupp.fullname))) {
- cprintf("550 <%s> is not your address.\r\n", SMTP->from);
+ cprintf("550 <%s> is not your address.\r\n",
+ SMTP->from);
strcpy(SMTP->from, "");
return;
}
switch(cvt) {
case rfc822_address_locally_validated:
+ SMTP->valid.num_local += 1;
+ strcat
+ return;
case rfc822_address_on_citadel_network:
cprintf("250 %s is a valid recipient.\r\n", user);
CtdlReallocUserData(SYM_SMTP_RECPS,
struct usersupp userbuf;
char *instr; /* Remote delivery instructions */
struct CtdlMessage *imsg;
- struct recptypes *valid;
lprintf(9, "smtp_message_delivery() called\n");