alecpl
2008-04-13 875a482d3c47218b8d191bb07fdb16373a80b1d4
program/include/rcube_smtp.inc
@@ -62,21 +62,21 @@
  $smtp_host_url = parse_url($CONFIG['smtp_server']);
  
  // overwrite port
  if ($smtp_host_url['host'] && $smtp_host_url['port'])
  if (isset($smtp_host_url['host']) && isset($smtp_host_url['port']))
    {
    $smtp_host = $smtp_host_url['host'];
    $smtp_port = $smtp_host_url['port'];
    }
  // re-write smtp host
  if ($smtp_host_url['host'] && $smtp_host_url['scheme'])
  if (isset($smtp_host_url['host']) && isset($smtp_host_url['scheme']))
    $smtp_host = sprintf('%s://%s', $smtp_host_url['scheme'], $smtp_host_url['host']);
  // create Net_SMTP object and connect to server
  if (!is_object($smtp_conn))
  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);
    // set debugging
@@ -112,7 +112,7 @@
      if (PEAR::isError($result))
        {
        smtp_reset();
        $response[] .= "Authentication failure: ".$result->getMessage();
        $response[] .= 'Authentication failure: ' . $result->getMessage() . ' (Code: ' . $result->getCode() . ')';
        return FALSE;
        }
      }