POP3.php (mrbs-1.9.4) | : | POP3.php (mrbs-1.10.0) | ||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com> | * @author Jim Jagielski (jimjag) <jimjag@gmail.com> | |||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> | * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> | |||
*/ | */ | |||
class POP3 | class POP3 | |||
{ | { | |||
/** | /** | |||
* The POP3 PHPMailer Version number. | * The POP3 PHPMailer Version number. | |||
* | * | |||
* @var string | * @var string | |||
*/ | */ | |||
const VERSION = '6.4.1'; | const VERSION = '6.5.3'; | |||
/** | /** | |||
* Default POP3 port number. | * Default POP3 port number. | |||
* | * | |||
* @var int | * @var int | |||
*/ | */ | |||
const DEFAULT_PORT = 110; | const DEFAULT_PORT = 110; | |||
/** | /** | |||
* Default timeout in seconds. | * Default timeout in seconds. | |||
skipping to change at line 311 | skipping to change at line 311 | |||
* | * | |||
* @param string $username | * @param string $username | |||
* @param string $password | * @param string $password | |||
* | * | |||
* @return bool | * @return bool | |||
*/ | */ | |||
public function login($username = '', $password = '') | public function login($username = '', $password = '') | |||
{ | { | |||
if (!$this->connected) { | if (!$this->connected) { | |||
$this->setError('Not connected to POP3 server'); | $this->setError('Not connected to POP3 server'); | |||
return false; | ||||
} | } | |||
if (empty($username)) { | if (empty($username)) { | |||
$username = $this->username; | $username = $this->username; | |||
} | } | |||
if (empty($password)) { | if (empty($password)) { | |||
$password = $this->password; | $password = $this->password; | |||
} | } | |||
//Send the Username | //Send the Username | |||
$this->sendString("USER $username" . static::LE); | $this->sendString("USER $username" . static::LE); | |||
skipping to change at line 340 | skipping to change at line 341 | |||
return false; | return false; | |||
} | } | |||
/** | /** | |||
* Disconnect from the POP3 server. | * Disconnect from the POP3 server. | |||
*/ | */ | |||
public function disconnect() | public function disconnect() | |||
{ | { | |||
$this->sendString('QUIT'); | $this->sendString('QUIT'); | |||
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command | ||||
. | ||||
// Try to get it. Ignore any failures here. | ||||
try { | ||||
$this->getResponse(); | ||||
} catch (Exception $e) { | ||||
//Do nothing | ||||
} | ||||
//The QUIT command may cause the daemon to exit, which will kill our con nection | //The QUIT command may cause the daemon to exit, which will kill our con nection | |||
//So ignore errors here | //So ignore errors here | |||
try { | try { | |||
@fclose($this->pop_conn); | @fclose($this->pop_conn); | |||
} catch (Exception $e) { | } catch (Exception $e) { | |||
//Do nothing | //Do nothing | |||
} | } | |||
// Clean up attributes. | ||||
$this->connected = false; | ||||
$this->pop_conn = false; | ||||
} | } | |||
/** | /** | |||
* Get a response from the POP3 server. | * Get a response from the POP3 server. | |||
* | * | |||
* @param int $size The maximum number of bytes to retrieve | * @param int $size The maximum number of bytes to retrieve | |||
* | * | |||
* @return string | * @return string | |||
*/ | */ | |||
protected function getResponse($size = 128) | protected function getResponse($size = 128) | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 16 lines changed or added |