struct citsmtp { /* Information about the current session */
int command_state;
char helo_node[SIZ];
- struct usersupp vrfy_buffer;
+ struct ctdluser vrfy_buffer;
int vrfy_count;
char vrfy_match[SIZ];
char from[SIZ];
CtdlDecodeBase64(password, argbuf, SIZ);
lprintf(9, "Trying <%s>\n", password);
if (CtdlTryPassword(password) == pass_ok) {
- cprintf("235 2.0.0 Hello, %s\r\n", CC->usersupp.fullname);
+ cprintf("235 2.0.0 Hello, %s\r\n", CC->user.fullname);
lprintf(9, "SMTP authenticated login successful\n");
CC->internal_pgm = 0;
CC->cs_flags &= ~CS_STEALTH;
/*
* Back end for smtp_vrfy() command
*/
-void smtp_vrfy_backend(struct usersupp *us, void *data) {
+void smtp_vrfy_backend(struct ctdluser *us, void *data) {
if (!fuzzy_match(us, SMTP->vrfy_match)) {
++SMTP->vrfy_count;
- memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
+ memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
}
}
/*
* Back end for smtp_expn() command
*/
-void smtp_expn_backend(struct usersupp *us, void *data) {
+void smtp_expn_backend(struct ctdluser *us, void *data) {
if (!fuzzy_match(us, SMTP->vrfy_match)) {
}
++SMTP->vrfy_count;
- memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
+ memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
}
}
striplt(SMTP->from);
stripallbut(SMTP->from, '<', '>');
+ /* We used to reject empty sender names, until it was brought to our
+ * attention that RFC1123 5.2.9 requires that this be allowed. So now
+ * we allow it, but replace the empty string with a fake
+ * address so we don't have to contend with the empty string causing
+ * other code to fail when it's expecting something there.
+ */
if (strlen(SMTP->from) == 0) {
- cprintf("501 5.1.7 Empty sender name is not permitted\r\n");
- return;
+ strcpy(SMTP->from, "someone@somewhere.org");
}
/* If this SMTP connection is from a logged-in user, force the 'from'
datestring(nowstamp, sizeof nowstamp, time(NULL), DATESTRING_RFC822);
body = mallok(4096);
- /* FIXME
- it should be Received: from %s (real.name.dom [w.x.y.z])
- */
if (body != NULL) snprintf(body, 4096,
- "Received: from %s (%s)\n"
+ "Received: from %s (%s [%s])\n"
" by %s; %s\n",
SMTP->helo_node,
CC->cs_host,
+ CC->cs_addr,
config.c_fqdn,
nowstamp);
if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']);
if (msg->cm_fields['F'] != NULL) phree(msg->cm_fields['F']);
if (msg->cm_fields['O'] != NULL) phree(msg->cm_fields['O']);
- msg->cm_fields['A'] = strdoop(CC->usersupp.fullname);
+ msg->cm_fields['A'] = strdoop(CC->user.fullname);
msg->cm_fields['N'] = strdoop(config.c_nodename);
msg->cm_fields['H'] = strdoop(config.c_humannode);
msg->cm_fields['F'] = strdoop(CC->cs_inet_email);
*/
lprintf(7, "SMTP: processing outbound queue\n");
- if (getroom(&CC->quickroom, SMTP_SPOOLOUT_ROOM) != 0) {
+ if (getroom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
return;
}
* Initialize the SMTP outbound queue
*/
void smtp_init_spoolout(void) {
- struct quickroom qrbuf;
+ struct ctdlroom qrbuf;
/*
* Create the room. This will silently fail if the room already