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);
+ lprintf(9, "Delivering to local room <%s>\n", recipient);
CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0);
}
}
strcat(SMTP->valid.recp_local, user);
SMTP->valid.num_local += 1;
+ SMTP->number_of_recipients += 1;
return;
case rfc822_room_delivery:
}
strcat(SMTP->valid.recp_room, user);
SMTP->valid.num_room += 1;
+ SMTP->number_of_recipients += 1;
return;
case rfc822_address_on_citadel_network:
- cprintf("250 Delivering to room '%s'\r\n", user);
- /* FIXME */
+ cprintf("250 '%s' is a valid network user.\r\n", user);
+ if (SMTP->valid.num_ignet > 0) {
+ strcat(SMTP->valid.recp_ignet, "|");
+ }
+ strcat(SMTP->valid.recp_ignet, user);
+ SMTP->valid.num_ignet += 1;
+ SMTP->number_of_recipients += 1;
return;
case rfc822_no_such_user:
}
else {
cprintf("250 Remote recipient %s ok\r\n", recp);
-
-
+ SMTP->number_of_recipients += 1;
return;
}
return;
time_t submitted = 0L;
struct CtdlMessage *bmsg = NULL;
int give_up = 0;
+ struct recptypes *valid;
+ int successful_bounce = 0;
lprintf(9, "smtp_do_bounce() called\n");
strcpy(bounceto, "");
lprintf(7, "No bounce address specified\n");
bounce_msgid = (-1L);
}
-/* FIXME this won't work
- else if (mes_type = alias(bounceto), mes_type == MES_ERROR) {
- lprintf(7, "Invalid bounce address <%s>\n", bounceto);
- bounce_msgid = (-1L);
- }
- else {
- bounce_msgid = CtdlSubmitMsg(bmsg,
- bounceto,
- "", mes_type);
+
+ /* Can we deliver the bounce to the original sender? */
+ valid = validate_recipients(bounceto);
+ if (valid != NULL) {
+ if (valid->num_error == 0) {
+ CtdlSubmitMsg(bmsg, valid, "");
+ successful_bounce = 1;
+ }
}
- */
- TRACE;
- /* Otherwise, go to the Aide> room */
- lprintf(9, "bounce to room?\n");
- if (bounce_msgid < 0L) bounce_msgid = CtdlSubmitMsg(bmsg,
- NULL, AIDEROOM);
+ /* If not, post it in the Aide> room */
+ if (successful_bounce == 0) {
+ CtdlSubmitMsg(bmsg, NULL, AIDEROOM);
+ }
}
CtdlFreeMessage(bmsg);