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

Include twit-listed sender name in quotes in log message

Since mail server log messages have their white-space condensed, it was not obvious why some sender's name would match a twitlist.cfg line that filters names beginning with a space: "\ *" because the initial space of the sender's name was condensed/combined with space before it in the log message.
parent ed1f4ab1
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2472 passed
...@@ -3221,9 +3221,9 @@ static void smtp_thread(void* arg) ...@@ -3221,9 +3221,9 @@ static void smtp_thread(void* arg)
/* Twit-listing (sender's name and e-mail addresses) here */ /* Twit-listing (sender's name and e-mail addresses) here */
SAFEPRINTF(path,"%stwitlist.cfg",scfg.ctrl_dir); SAFEPRINTF(path,"%stwitlist.cfg",scfg.ctrl_dir);
if(fexist(path) && (findstr(sender,path) || findstr(sender_addr,path))) { if(fexist(path) && (findstr(sender,path) || findstr(sender_addr,path))) {
lprintf(LOG_NOTICE,"%04d %s %s !FILTERING TWIT-LISTED SENDER: %s <%s> (%lu total)" lprintf(LOG_NOTICE,"%04d %s %s !FILTERING TWIT-LISTED SENDER: '%s' <%s> (%lu total)"
,socket, client.protocol, client_id, sender, sender_addr, ++stats.msgs_refused); ,socket, client.protocol, client_id, sender, sender_addr, ++stats.msgs_refused);
SAFEPRINTF2(tmp,"Twit-listed sender: %s <%s>", sender, sender_addr); SAFEPRINTF2(tmp,"Twit-listed sender: '%s' <%s>", sender, sender_addr);
spamlog(&scfg, (char*)client.protocol, "REFUSED", tmp, host_name, host_ip, rcpt_addr, reverse_path); spamlog(&scfg, (char*)client.protocol, "REFUSED", tmp, host_name, host_ip, rcpt_addr, reverse_path);
sockprintf(socket,client.protocol,session, "554 Sender not allowed."); sockprintf(socket,client.protocol,session, "554 Sender not allowed.");
continue; continue;
...@@ -3294,10 +3294,10 @@ static void smtp_thread(void* arg) ...@@ -3294,10 +3294,10 @@ static void smtp_thread(void* arg)
SAFECOPY(rcpt_addr,iniReadString(rcptlst,section ,smb_hfieldtype(RECIPIENTNETADDR),rcpt_to,value)); SAFECOPY(rcpt_addr,iniReadString(rcptlst,section ,smb_hfieldtype(RECIPIENTNETADDR),rcpt_to,value));
if((i=putsmsg(&scfg,usernum,telegram_buf))==0) if((i=putsmsg(&scfg,usernum,telegram_buf))==0)
lprintf(LOG_INFO,"%04d %s %s Created telegram (%ld/%lu bytes) from %s to %s <%s>" lprintf(LOG_INFO,"%04d %s %s Created telegram (%ld/%lu bytes) from '%s' to '%s' <%s>"
,socket, client.protocol, client_id, length, (ulong)strlen(telegram_buf), sender_addr, rcpt_to, rcpt_addr); ,socket, client.protocol, client_id, length, (ulong)strlen(telegram_buf), sender_addr, rcpt_to, rcpt_addr);
else else
lprintf(LOG_ERR,"%04d %s %s !ERROR %d creating telegram from %s to %s <%s>" lprintf(LOG_ERR,"%04d %s %s !ERROR %d creating telegram from '%s' to '%s' <%s>"
,socket, client.protocol, client_id, i, sender_addr, rcpt_to, rcpt_addr); ,socket, client.protocol, client_id, i, sender_addr, rcpt_to, rcpt_addr);
} }
iniFreeStringList(sec_list); iniFreeStringList(sec_list);
...@@ -4765,7 +4765,7 @@ static void smtp_thread(void* arg) ...@@ -4765,7 +4765,7 @@ static void smtp_thread(void* arg)
} }
if(i<scfg.total_qhubs) { /* found matching QWKnet Hub */ if(i<scfg.total_qhubs) { /* found matching QWKnet Hub */
lprintf(LOG_INFO,"%04d %s %s Routing mail for %s <%s> to QWKnet Hub: %s" lprintf(LOG_INFO,"%04d %s %s Routing mail for '%s' <%s> to QWKnet Hub: %s"
,socket, client.protocol, client_id, rcpt_addr, p, scfg.qhub[i]->id); ,socket, client.protocol, client_id, rcpt_addr, p, scfg.qhub[i]->id);
fprintf(rcptlst,"[%u]\n",rcpt_count++); fprintf(rcptlst,"[%u]\n",rcpt_count++);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment