From 8ffd08a7398d044dc7e9f5deecc76a29c6aa270e Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 17 Apr 2011 05:34:02 -0400
Subject: [PATCH] - Aplied fixes from trunk

---
 program/include/rcube_smtp.php |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/program/include/rcube_smtp.php b/program/include/rcube_smtp.php
index 81f212d..6216838 100644
--- a/program/include/rcube_smtp.php
+++ b/program/include/rcube_smtp.php
@@ -105,7 +105,7 @@
 
     $this->conn = new Net_SMTP($smtp_host, $smtp_port, $helo_host);
 
-    if($RCMAIL->config->get('smtp_debug'))
+    if ($RCMAIL->config->get('smtp_debug'))
       $this->conn->setDebug(true, array($this, 'debug_handler'));
 
     // try to connect to server and exit on failure
@@ -118,6 +118,13 @@
       return false;
     }
 
+    // workaround for timeout bug in Net_SMTP 1.5.[0-1] (#1487843)
+    if (method_exists($this->conn, 'setTimeout')
+      && ($timeout = ini_get('default_socket_timeout'))
+    ) {
+      $this->conn->setTimeout($timeout);
+    }
+
     $smtp_user = str_replace('%u', $_SESSION['username'], $CONFIG['smtp_user']);
     $smtp_pass = str_replace('%p', $RCMAIL->decrypt($_SESSION['password']), $CONFIG['smtp_pass']);
     $smtp_auth_type = empty($CONFIG['smtp_auth_type']) ? NULL : $CONFIG['smtp_auth_type'];

--
Gitblit v1.9.1