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

If SMTP-transmit-relay is enabled by no relay server, disable

log an error message and disable the transmit-relay in this detected-misconfiguration case.

Fixes issue #315 reported by Nelgin.
parent 977b5cab
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2533 passed
......@@ -5281,11 +5281,11 @@ static SOCKET sendmail_negotiate(CRYPT_SESSION *session, smb_t *smb, smbmsg_t *m
server=mx2; /* Give second mx record a try */
}
lprintf(LOG_DEBUG,"%04d SEND resolving SMTP hostname: %s", sock, server);
lprintf(LOG_DEBUG,"%04d SEND resolving SMTP hostname: '%s'", sock, server);
ip_addr=resolve_ip(server);
if(ip_addr==INADDR_NONE) {
SAFEPRINTF(err, "Error resolving hostname %s", server);
lprintf(LOG_WARNING,"%04d SEND !Failure resolving hostname: %s", sock, server);
SAFEPRINTF(err, "Error resolving hostname '%s'", server);
lprintf(LOG_WARNING,"%04d SEND !Failure resolving hostname: '%s'", sock, server);
continue;
}
......@@ -6113,6 +6113,11 @@ void mail_server(void* arg)
if(chdir(startup->ctrl_dir)!=0)
lprintf(LOG_ERR,"!ERROR %d (%s) changing directory to: %s", errno, strerror(errno), startup->ctrl_dir);
if((startup->options & MAIL_OPT_RELAY_TX) && startup->relay_server[0] == '\0') {
lprintf(LOG_ERR, "SMTP-Transmit-Relay enabled, but no relay server (hostname or IP address) configured. Disabling.");
startup->options &= ~MAIL_OPT_RELAY_TX;
}
/* Initial configuration and load from CNF files */
SAFECOPY(scfg.ctrl_dir,startup->ctrl_dir);
lprintf(LOG_INFO,"Loading configuration files from %s", scfg.ctrl_dir);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment