X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fmail_fetch%2Fclass.POP3.php;h=f19b3cd96af174f0398dd89e74603a81c4df9b02;hb=6c84ba1ec45ab854c37b6f65c5b4d84ab1c7aad4;hp=e69294d85112a5786f959bfe8670421ec16a619f;hpb=ef610a28599b4611ce3f297f74fcce46a1ef6d1d;p=squirrelmail.git diff --git a/plugins/mail_fetch/class.POP3.php b/plugins/mail_fetch/class.POP3.php index e69294d8..f19b3cd9 100644 --- a/plugins/mail_fetch/class.POP3.php +++ b/plugins/mail_fetch/class.POP3.php @@ -1,20 +1,27 @@ -TIMEOUT = $timeout; - set_time_limit($timeout); + if (!ini_get('safe_mode')) + set_time_limit($timeout); } return true; } function update_timer () { - set_time_limit($this->TIMEOUT); + if (!ini_get('safe_mode')) + set_time_limit($this->TIMEOUT); return true; } @@ -74,6 +80,7 @@ class POP3 { // If MAILSERVER is set, override $server with it's value + if (!isset($port) || !$port) {$port = 110;} if(!empty($this->MAILSERVER)) $server = $this->MAILSERVER; @@ -83,7 +90,7 @@ class POP3 { return false; } - $fp = fsockopen("$server", $port, $errno, $errstr); + $fp = @fsockopen("$server", $port, $errno, $errstr); if(!$fp) { $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]"; @@ -104,25 +111,7 @@ class POP3 { } $this->FP = $fp; $this->BANNER = $this->parse_banner($reply); - $this->RFC1939 = $this->noop(); - if($this->RFC1939) { - $this->ERROR = _("POP3: premature NOOP OK, NOT an RFC 1939 Compliant server"); - $this->quit(); - return false; - } else - return true; - } - - function noop () { - - if(!isset($this->FP)) { - $this->ERROR = _("POP3 noop:") . ' ' . _("No connection to server"); - return false; - } else { - $cmd = "NOOP"; - $reply = $this->send_cmd( $cmd ); - return( $this->is_ok( $reply ) ); - } + return true; } function user ($user = "") { @@ -164,13 +153,7 @@ class POP3 { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; - $this->RFC1939 = $this->noop(); - if(!$this->RFC1939) { - $this->ERROR = _("POP3 pass:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); - $this->quit(); - return false; - } else - return $count; + return $count; } } } @@ -213,13 +196,7 @@ class POP3 { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; - $this->RFC1939 = $this->noop(); - if(!$this->RFC1939) { - $this->ERROR = _("POP3 apop:") . ' ' . _("NOOP failed. Server not RFC 1939 compliant"); - $this->quit(); - return false; - } else - return $count; + return $count; } } } @@ -329,7 +306,7 @@ class POP3 { $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]"; return false; } - list($junk,$num,$size) = explode(" ",$reply); + list($junk,$num,$size) = preg_split('/\s+/',$reply); return $size; } $cmd = "LIST"; @@ -352,7 +329,7 @@ class POP3 { $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list"); return false; } - list($thisMsg,$msgSize) = explode(" ",$line); + list($thisMsg,$msgSize) = preg_split('/\s+/',$line); settype($thisMsg,"integer"); if($thisMsg != $msgC) { @@ -422,7 +399,7 @@ class POP3 { return $last; } - $Vars = explode(" ",$reply); + $Vars = preg_split('/\s+/',$reply); $count = $Vars[1]; $size = $Vars[2]; settype($count,"integer"); @@ -553,7 +530,7 @@ class POP3 { $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]"; return false; } - list ($ok,$num,$myUidl) = explode(" ",$reply); + list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); return $myUidl; } else { $this->update_timer(); @@ -584,7 +561,7 @@ class POP3 { if(ereg("^\.\r\n",$line)) { break; } - list ($msg,$msgUidl) = explode(" ",$line); + list ($msg,$msgUidl) = preg_split('/\s+/',$line); $msgUidl = $this->strip_clf($msgUidl); if($count == $msg) { $UIDLArray[$msg] = $msgUidl; @@ -676,4 +653,4 @@ class POP3 { } // End class -?> +?> \ No newline at end of file