* emailadmin: use connection timeout preference in openConnection calls, and increase defaulttimeout if applicable;

This commit is contained in:
Klaus Leithoff 2012-08-02 14:31:41 +00:00
parent 7f3e8b6ce8
commit f51f5f50f3
2 changed files with 96 additions and 87 deletions

View File

@ -511,6 +511,12 @@ class defaultimap extends Net_IMAP
static $supportedAuthMethods;
//error_log(__METHOD__.function_backtrace());
//error_log(__METHOD__.__LINE__.($_adminConnection?' Adminconnection':' ').array2string($this));
$timeout = felamimail_bo::getTimeOut();
// either there is a $_timeout given with the openConnection call, or not, if there is a timeout
// set in prefs greater then the timeout given, use this one
// basically this means you may increase timeouts, but cannot decrease it below 20
if ($timeout>$_timeout) $_timeout = $timeout;
unset($this->_connectionErrorObject);
if($_adminConnection) {

View File

@ -104,6 +104,9 @@ class emailadmin_sieve extends Net_Sieve
return 'die';
}
$this->_timeout = 10; // socket::connect sets the/this timeout on connection
$timeout = felamimail_bo::getTimeOut('SIEVE');
if ($timeout>$this->_timeout) $this->_timeout = $timeout;
if(PEAR::isError($this->error = $this->connect($sieveHost , $sievePort, null, $useTLS) ) ){
if ($this->debug) error_log(__CLASS__.'::'.__METHOD__.": error in connect($sieveHost,$sievePort): ".$this->error->getMessage());
$isConError[$_icServerID] = "SIEVE: error in connect($sieveHost,$sievePort): ".$this->error->getMessage();