Index: trunk/roundcubemail/program/include/rcube_smtp.inc
===================================================================
--- trunk/roundcubemail/program/include/rcube_smtp.inc	(revision 804)
+++ trunk/roundcubemail/program/include/rcube_smtp.inc	(revision 805)
@@ -77,5 +77,5 @@
   if (!is_object($smtp_conn))
     {
-    $helo_host = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : (!empty($CONFIG['smtp_helo_host']) ? $CONFIG['smtp_helo_host'] : 'localhost');
+    $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);
 
