[Svn] r2016 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Mon Oct 27 11:03:55 CET 2008


Author: alec
Date: 2008-10-27 05:03:55 -0500 (Mon, 27 Oct 2008)
New Revision: 2016

Modified:
   trunk/roundcubemail/program/include/rcube_smtp.inc
Log:
#1485518: validate SERVER_NAME for smtp_helo_host setting


Modified: trunk/roundcubemail/program/include/rcube_smtp.inc
===================================================================
--- trunk/roundcubemail/program/include/rcube_smtp.inc	2008-10-27 07:32:38 UTC (rev 2015)
+++ trunk/roundcubemail/program/include/rcube_smtp.inc	2008-10-27 10:03:55 UTC (rev 2016)
@@ -76,14 +76,19 @@
   // 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'];
+    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);
 
     // set debugging
     if ($CONFIG['debug_level'] & 8)
       $SMTP_CONN->setDebug(TRUE);
 
-
     // try to connect to server and exit on failure
     $result = $SMTP_CONN->connect($smtp_timeout);
     if (PEAR::isError($result))

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list