SMTP->message_originated_locally = 0;
}
+const char *smtp_get_Recipients(void)
+{
+ if (SMTP == NULL)
+ return NULL;
+ else return SMTP->from;
+}
/*
* Implements the "MAIL From:" command
}
}
- valid = validate_recipients(recp);
+ valid = validate_recipients(recp,
+ smtp_get_Recipients (),
+ (CC->logged_in)? POST_LOGGED_IN:POST_EXTERNAL);
if (valid->num_error != 0) {
cprintf("599 5.1.1 Error: %s\r\n", valid->errormsg);
free_recipients(valid);
msg->cm_fields['V'] = strdup(SMTP->recipients);
/* Submit the message into the Citadel system. */
- valid = validate_recipients(SMTP->recipients);
+ valid = validate_recipients(SMTP->recipients,
+ smtp_get_Recipients (),
+ (CC->logged_in)? POST_LOGGED_IN:POST_EXTERNAL);
/* If there are modules that want to scan this message before final
* submission (such as virus checkers or spam filters), call them now
}
/* Can we deliver the bounce to the original sender? */
- valid = validate_recipients(bounceto);
+ valid = validate_recipients(bounceto, smtp_get_Recipients (), 0);
if (valid != NULL) {
if (valid->num_error == 0) {
CtdlSubmitMsg(bmsg, valid, "");
CTDL_MODULE_INIT(smtp)
{
- CtdlRegisterServiceHook(config.c_smtp_port, /* SMTP MTA */
- NULL,
- smtp_mta_greeting,
- smtp_command_loop,
- NULL,
- CitadelServiceSMTP_MTA);
+ if (!threading)
+ {
+ CtdlRegisterServiceHook(config.c_smtp_port, /* SMTP MTA */
+ NULL,
+ smtp_mta_greeting,
+ smtp_command_loop,
+ NULL,
+ CitadelServiceSMTP_MTA);
#ifdef HAVE_OPENSSL
- CtdlRegisterServiceHook(config.c_smtps_port,
- NULL,
- smtps_greeting,
- smtp_command_loop,
- NULL,
- CitadelServiceSMTPS_MTA);
+ CtdlRegisterServiceHook(config.c_smtps_port,
+ NULL,
+ smtps_greeting,
+ smtp_command_loop,
+ NULL,
+ CitadelServiceSMTPS_MTA);
#endif
- CtdlRegisterServiceHook(config.c_msa_port, /* SMTP MSA */
- NULL,
- smtp_msa_greeting,
- smtp_command_loop,
- NULL,
- CitadelServiceSMTP_MSA);
-
- CtdlRegisterServiceHook(0, /* local LMTP */
- file_lmtp_socket,
- lmtp_greeting,
- smtp_command_loop,
- NULL,
- CitadelServiceSMTP_LMTP);
-
- CtdlRegisterServiceHook(0, /* local LMTP */
- file_lmtp_unfiltered_socket,
- lmtp_unfiltered_greeting,
- smtp_command_loop,
- NULL,
- CitadelServiceSMTP_LMTP_UNF);
-
- smtp_init_spoolout();
- CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
- CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);
- CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
-
+ CtdlRegisterServiceHook(config.c_msa_port, /* SMTP MSA */
+ NULL,
+ smtp_msa_greeting,
+ smtp_command_loop,
+ NULL,
+ CitadelServiceSMTP_MSA);
+
+ CtdlRegisterServiceHook(0, /* local LMTP */
+ file_lmtp_socket,
+ lmtp_greeting,
+ smtp_command_loop,
+ NULL,
+ CitadelServiceSMTP_LMTP);
+
+ CtdlRegisterServiceHook(0, /* local LMTP */
+ file_lmtp_unfiltered_socket,
+ lmtp_unfiltered_greeting,
+ smtp_command_loop,
+ NULL,
+ CitadelServiceSMTP_LMTP_UNF);
+
+ smtp_init_spoolout();
+ CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
+ CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);
+ CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
+ }
+
/* return our Subversion id for the Log */
return "$Id$";
}