struct citsmtp { /* Information about the current session */
int command_state;
+ char helo_node[256];
struct usersupp vrfy_buffer;
int vrfy_count;
char vrfy_match[256];
*/
void smtp_hello(char *argbuf, int is_esmtp) {
+ safestrncpy(SMTP->helo_node, argbuf, sizeof SMTP->helo_node);
+
if (!is_esmtp) {
cprintf("250 Greetings and joyous salutations.\r\n");
}
else {
cvt = convert_internet_address(user, node, SMTP->from);
lprintf(9, "cvt=%d, citaddr=<%s@%s>\n", cvt, user, node);
- if (!strcasecmp(node, config.c_nodename)) { /* FIX use fcn */
+ if (CtdlHostAlias(node) == hostalias_localhost) {
cprintf("550 You must log in to send mail from %s\r\n",
- config.c_fqdn);
+ node);
strcpy(SMTP->from, "");
return;
}
generate_rfc822_datestamp(nowstamp, time(NULL));
body = mallok(4096);
+
if (body != NULL) sprintf(body,
"Received: from %s\n"
" by %s;\n"
" %s\n",
- "FIX.FIX.com",
+ SMTP->helo_node,
config.c_fqdn,
nowstamp);