X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=program%2Finclude%2Frcube_smtp.inc;h=309d420c2c166639928ff748214fe641e8c5164a;hb=3adad46e27086084a8b28a32fc4fbc953dbfef6c;hp=6049418f3ee6e5d5c1cf3a6894a8754b324aafd4;hpb=48e8459231a1efa3e97284d07a328776a5b7485b;p=roundcube.git diff --git a/program/include/rcube_smtp.inc b/program/include/rcube_smtp.inc index 6049418..309d420 100644 --- a/program/include/rcube_smtp.inc +++ b/program/include/rcube_smtp.inc @@ -15,7 +15,7 @@ | Author: Thomas Bruederli | +-----------------------------------------------------------------------+ - $Id: rcube_smtp.inc 1360 2008-05-07 09:38:44Z thomasb $ + $Id: rcube_smtp.inc 2155 2008-12-16 13:00:55Z alec $ */ @@ -76,13 +76,14 @@ function smtp_mail($from, $recipients, &$headers, &$body, &$response) // create Net_SMTP object and connect to server if (!is_object($SMTP_CONN)) { - $helo_host = empty($CONFIG['smtp_helo_host']) ? (empty($_SERVER['SERVER_NAME']) ? 'localhost' : $_SERVER['SERVER_NAME']) : $CONFIG['smtp_helo_host']; - $SMTP_CONN = new Net_SMTP($smtp_host, $smtp_port, $helo_host); - - // set debugging - if ($CONFIG['debug_level'] & 8) - $SMTP_CONN->setDebug(TRUE); + if (!empty($CONFIG['smtp_helo_host'])) + $helo_host = $CONFIG['smtp_helo_host']; + else if (!empty($_SERVER['SERVER_NAME'])) + $helo_host = preg_replace('/:\d+$/', '', $_SERVER['SERVER_NAME']); + else + $helo_host = 'localhost'; + $SMTP_CONN = new Net_SMTP($smtp_host, $smtp_port, $helo_host); // try to connect to server and exit on failure $result = $SMTP_CONN->connect($smtp_timeout);