connection instead of waiting for them to execute a RCPT command.
(Still need to implement client config option.)
* Bumped the rev level and compatible export file level to 7.04 because
we amended the config file format.
* usually more strict because you're not really supposed to dump/load and
* upgrade at the same time.
*/
* usually more strict because you're not really supposed to dump/load and
* upgrade at the same time.
*/
-#define REV_LEVEL 703 /* This version */
+#define REV_LEVEL 704 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
#define REV_MIN 591 /* Oldest compatible database */
-#define EXPORT_REV_MIN 701 /* Oldest compatible export files */
+#define EXPORT_REV_MIN 704 /* Oldest compatible export files */
#define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
obtain SERVER_TYPE codes for your implementations */
#define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
obtain SERVER_TYPE codes for your implementations */
int c_funambol_port; /* Funambol port */
char c_funambol_source[256]; /* Funambol sync source */
char c_funambol_auth[256]; /* Funambol auth details */
int c_funambol_port; /* Funambol port */
char c_funambol_source[256]; /* Funambol sync source */
char c_funambol_auth[256]; /* Funambol auth details */
+ char c_rbl_at_greeting; /* Check RBL's at connect instead of after RCPT */
/*
* Here's where our SMTP session begins its happy day.
*/
/*
* Here's where our SMTP session begins its happy day.
*/
-void smtp_greeting(void) {
+void smtp_greeting(void)
+{
+ char message_to_spammer[1024];
strcpy(CC->cs_clientname, "SMTP session");
CC->internal_pgm = 1;
strcpy(CC->cs_clientname, "SMTP session");
CC->internal_pgm = 1;
memset(SMTP_RECPS, 0, SIZ);
memset(SMTP_ROOMS, 0, SIZ);
memset(SMTP_RECPS, 0, SIZ);
memset(SMTP_ROOMS, 0, SIZ);
+ /* 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 (rbl_check(message_to_spammer)) {
+ cprintf("550 %s\r\n", message_to_spammer);
+ CC->kill_me = 1;
+ /* no need to free(valid), it's not allocated yet */
+ return;
+ }
+ }
+
+ /* Otherwise we're either clean or we check later. */
cprintf("220 %s ESMTP Citadel server ready.\r\n", config.c_fqdn);
}
cprintf("220 %s ESMTP Citadel server ready.\r\n", config.c_fqdn);
}
- if ( (!CC->logged_in)
- && (!SMTP->is_lmtp) ) {
- if (rbl_check(message_to_spammer)) {
- cprintf("550 %s\r\n", message_to_spammer);
- /* no need to free(valid), it's not allocated yet */
- return;
+ if ( (!CC->logged_in) /* Don't RBL authenticated users */
+ && (!SMTP->is_lmtp) ) { /* Don't RBL LMTP clients */
+ if (config.c_rbl_at_greeting == 0) { /* Don't RBL again if we already did it */
+ if (rbl_check(message_to_spammer)) {
+ cprintf("550 %s\r\n", message_to_spammer);
+ /* no need to free(valid), it's not allocated yet */
+ return;
+ }
cprintf("%d\n", config.c_funambol_port);
cprintf("%s\n", config.c_funambol_source);
cprintf("%s\n", config.c_funambol_auth);
cprintf("%d\n", config.c_funambol_port);
cprintf("%s\n", config.c_funambol_source);
cprintf("%s\n", config.c_funambol_auth);
+ cprintf("%d\n", config.c_rbl_at_greeting);
/* Export the control file */
get_control();
/* Export the control file */
get_control();
client_getln(buf, sizeof buf); config.c_funambol_port = atoi(buf);
client_getln(config.c_funambol_source, sizeof config.c_funambol_source);
client_getln(config.c_funambol_auth, sizeof config.c_funambol_auth);
client_getln(buf, sizeof buf); config.c_funambol_port = atoi(buf);
client_getln(config.c_funambol_source, sizeof config.c_funambol_source);
client_getln(config.c_funambol_auth, sizeof config.c_funambol_auth);
+ client_getln(buf, sizeof buf); config.c_rbl_at_greeting = atoi(buf);
config.c_enable_fulltext = 0; /* always disable */
put_config();
config.c_enable_fulltext = 0; /* always disable */
put_config();