Skip to content
Snippets Groups Projects
Commit 952a25f1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

More commonization of "CLIENT BLOCKED" log messages

parent f7ba1e65
No related branches found
No related tags found
No related merge requests found
Pipeline #4993 failed
...@@ -1122,13 +1122,13 @@ static bool pop3_client_thread(pop3_t* pop3) ...@@ -1122,13 +1122,13 @@ static bool pop3_client_thread(pop3_t* pop3)
,socket, client.protocol, host_ip, attempted.count-attempted.dupes, attempted.user, seconds_to_str(banned, ban_duration)); ,socket, client.protocol, host_ip, attempted.count-attempted.dupes, attempted.user, seconds_to_str(banned, ban_duration));
} }
else else
lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT IP ADDRESS BLOCKED",socket, client.protocol, host_ip); lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT BLOCKED in ip.can",socket, client.protocol, host_ip);
sockprintf(socket,client.protocol,session,"-ERR Access denied."); sockprintf(socket,client.protocol,session,"-ERR Access denied.");
return false; return false;
} }
if(trashcan(&scfg,host_name,"host")) { if(trashcan(&scfg,host_name,"host")) {
lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT HOSTNAME BLOCKED: %s" lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT BLOCKED in host.can: %s"
,socket, client.protocol, host_ip, host_name); ,socket, client.protocol, host_ip, host_name);
sockprintf(socket,client.protocol,session,"-ERR Access denied."); sockprintf(socket,client.protocol,session,"-ERR Access denied.");
return false; return false;
...@@ -3036,14 +3036,14 @@ static bool smtp_client_thread(smtp_t* smtp) ...@@ -3036,14 +3036,14 @@ static bool smtp_client_thread(smtp_t* smtp)
spam_block_exempt = find2strs(host_ip, host_name, spam_block_exemptions); spam_block_exempt = find2strs(host_ip, host_name, spam_block_exemptions);
if(trashcan(&scfg,host_ip,"ip") if(trashcan(&scfg,host_ip,"ip")
|| ((!spam_block_exempt) && findstr(host_ip,spam_block))) { || ((!spam_block_exempt) && findstr(host_ip,spam_block))) {
lprintf(LOG_NOTICE,"%04d %s !CLIENT IP ADDRESS BLOCKED: %s (%lu total)" lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT BLOCKED in ip.can (%lu total)"
,socket, client.protocol, host_ip, ++stats.sessions_refused); ,socket, client.protocol, host_ip, ++stats.sessions_refused);
sockprintf(socket,client.protocol,session,"550 CLIENT IP ADDRESS BLOCKED: %s", host_ip); sockprintf(socket,client.protocol,session,"550 CLIENT IP ADDRESS BLOCKED: %s", host_ip);
return false; return false;
} }
if(trashcan(&scfg,host_name,"host")) { if(trashcan(&scfg,host_name,"host")) {
lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT HOSTNAME BLOCKED: %s (%lu total)" lprintf(LOG_NOTICE,"%04d %s [%s] !CLIENT BLOCKED in host.can: %s (%lu total)"
,socket, client.protocol, host_ip, host_name, ++stats.sessions_refused); ,socket, client.protocol, host_ip, host_name, ++stats.sessions_refused);
sockprintf(socket,client.protocol,session,"550 CLIENT HOSTNAME BLOCKED: %s", host_name); sockprintf(socket,client.protocol,session,"550 CLIENT HOSTNAME BLOCKED: %s", host_name);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment