/*
* Here's where our SMTP session begins its happy day.
*/
-void smtp_greeting(void)
+void smtp_greeting(int is_msa)
{
char message_to_spammer[1024];
memset(SMTP, 0, sizeof(struct citsmtp));
memset(SMTP_RECPS, 0, SIZ);
memset(SMTP_ROOMS, 0, SIZ);
+ SMTP->is_msa = is_msa;
/* If this config option is set, reject connections from problem
* addresses immediately instead of after they execute a RCPT
*/
- if (config.c_rbl_at_greeting) {
+ if ( (config.c_rbl_at_greeting) && (SMTP->is_msa == 0) ) {
if (rbl_check(message_to_spammer)) {
cprintf("550 %s\r\n", message_to_spammer);
CC->kill_me = 1;
#ifdef HAVE_OPENSSL
void smtps_greeting(void) {
CtdlStartTLS(NULL, NULL, NULL);
- smtp_greeting();
+ smtp_greeting(0);
}
#endif
* SMTP MSA port requires authentication.
*/
void smtp_msa_greeting(void) {
- smtp_greeting();
- SMTP->is_msa = 1;
+ smtp_greeting(1);
}
* LMTP is like SMTP but with some extra bonus footage added.
*/
void lmtp_greeting(void) {
- smtp_greeting();
+ smtp_greeting(0);
SMTP->is_lmtp = 1;
}
+/*
+ * Generic SMTP MTA greeting
+ */
+void smtp_mta_greeting(void) {
+ smtp_greeting(0);
+}
+
+
/*
* We also have an unfiltered LMTP socket that bypasses spam filters.
*/
void lmtp_unfiltered_greeting(void) {
- smtp_greeting();
+ smtp_greeting(0);
SMTP->is_lmtp = 1;
SMTP->is_unfiltered = 1;
}
CtdlRegisterServiceHook(config.c_smtp_port, /* SMTP MTA */
NULL,
- smtp_greeting,
+ smtp_mta_greeting,
smtp_command_loop,
NULL);