...
 
Commits (1)
  • Rob Swindell's avatar
    Optionally limit concurrent connections to mail server · de1db410
    Rob Swindell authored
    The mail (SMTP) server is a popular target of bots. Impose a maximum-concurrent-connections limit (optionally). Similar to the terminal server option, except, don't deduct the number of authenticated connections (I can add something like that if desired). The new config option is [mail] MaxConcurrentConnections in the ctrl/sbbs.ini (defaults to 0, no maximum).
    
    Fixed error responses in mail_server accept loop: was always sending POP3 error responses even if the connection was SMTP.
    
    Cleaned-up the service/port checking/logging in the mail_server accept loop: no strcmp() needed, log the protocol name (e.g. "SMTPS") instead of the service name (e.g. "submissions").
    de1db410
This diff is collapsed.
......@@ -126,6 +126,7 @@ typedef struct {
/* Login Attempt parameters */
struct login_attempt_settings login_attempt;
link_list_t* login_attempt_list;
uint max_concurrent_connections;
} mail_startup_t;
......
......@@ -591,6 +591,7 @@ void sbbs_read_ini(
mail->bind_retry_count=iniGetInteger(list,section,strBindRetryCount,global->bind_retry_count);
mail->bind_retry_delay=iniGetInteger(list,section,strBindRetryDelay,global->bind_retry_delay);
mail->login_attempt = get_login_attempt_settings(list, section, global);
mail->max_concurrent_connections = iniGetInteger(list, section, "MaxConcurrentConnections", 0);
}
/***********************************************************************/
......@@ -1042,6 +1043,8 @@ BOOL sbbs_write_ini(
break;
if(!iniSetInteger(lp,section,"ConnectTimeout",mail->connect_timeout,&style))
break;
if(!iniSetInteger(lp,section,"MaxConcurrentConnections",mail->max_concurrent_connections,&style))
break;
if(strcmp(mail->host_name,global->host_name)==0
|| (bbs != NULL && strcmp(bbs->host_name,cfg->sys_inetaddr)==0))
......