From 7778c0b9c6ae5d9b748d4b51f33aec99ce20c1f3 Mon Sep 17 00:00:00 2001 From: CaptainArk Date: Tue, 8 Mar 2016 20:21:56 +0100 Subject: [PATCH 1/2] Adding an option to configure the hostname in HELO when sending emails from Postfix Admin --- config.inc.php | 5 +++++ functions.inc.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config.inc.php b/config.inc.php index 3ceea21c..dd7e1ae0 100644 --- a/config.inc.php +++ b/config.inc.php @@ -125,6 +125,11 @@ $CONF['admin_email'] = ''; $CONF['smtp_server'] = 'localhost'; $CONF['smtp_port'] = '25'; +// SMTP Client +// Hostname (FQDN) of the server hosting Postfix Admin +// Used in the HELO when sending emails from Postfix Admin +$CONF['smtp_client'] = 'localhost.localdomain'; + // Encrypt // In what way do you want the passwords to be crypted? // md5crypt = internal postfix admin md5 diff --git a/functions.inc.php b/functions.inc.php index 81414b9a..cdd94ece 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1136,7 +1136,7 @@ function smtp_mail ($to, $from, $data, $body = "") { $smtpd_server = $CONF['smtp_server']; $smtpd_port = $CONF['smtp_port']; //$smtp_server = $_SERVER["SERVER_NAME"]; - $smtp_server = php_uname("n"); + $smtp_server = $CONF['smtp_client']; $errno = "0"; $errstr = "0"; $timeout = "30"; From 21c4ec0dd8b47dbbaf018dcc225c821b44177235 Mon Sep 17 00:00:00 2001 From: CaptainArk Date: Wed, 9 Mar 2016 19:57:23 +0100 Subject: [PATCH 2/2] smtp_client variable empty by default --- config.inc.php | 2 +- functions.inc.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.inc.php b/config.inc.php index dd7e1ae0..ecd89298 100644 --- a/config.inc.php +++ b/config.inc.php @@ -128,7 +128,7 @@ $CONF['smtp_port'] = '25'; // SMTP Client // Hostname (FQDN) of the server hosting Postfix Admin // Used in the HELO when sending emails from Postfix Admin -$CONF['smtp_client'] = 'localhost.localdomain'; +$CONF['smtp_client'] = ''; // Encrypt // In what way do you want the passwords to be crypted? diff --git a/functions.inc.php b/functions.inc.php index cdd94ece..5dd7a389 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1136,7 +1136,10 @@ function smtp_mail ($to, $from, $data, $body = "") { $smtpd_server = $CONF['smtp_server']; $smtpd_port = $CONF['smtp_port']; //$smtp_server = $_SERVER["SERVER_NAME"]; - $smtp_server = $CONF['smtp_client']; + $smtp_server = php_uname('n'); + if(!empty($CONF['smtp_client'])) { + $smtp_server = $CONF['smtp_client']; + } $errno = "0"; $errstr = "0"; $timeout = "30";