*
* SMTP delivery backend for the Deliver class.
*
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
if (!$pop_server) {
$pop_server = 'localhost';
}
- $popConnection = fsockopen($pop_server, $pop_port, $err_no, $err_str);
+ $popConnection = @fsockopen($pop_server, $pop_port, $err_no, $err_str);
if (!$popConnection) {
error_log("Error connecting to POP Server ($pop_server:$pop_port)"
. " $err_no : $err_str");
+ return false;
} else {
$tmp = fgets($popConnection, 1024); /* banner */
if (substr($tmp, 0, 3) != '+OK') {
- return(0);
+ return false;
}
fputs($popConnection, "USER $user\r\n");
$tmp = fgets($popConnection, 1024);
if (substr($tmp, 0, 3) != '+OK') {
- return(0);
+ return false;
}
fputs($popConnection, 'PASS ' . $pass . "\r\n");
$tmp = fgets($popConnection, 1024);
if (substr($tmp, 0, 3) != '+OK') {
- return(0);
+ return false;
}
fputs($popConnection, "QUIT\r\n"); /* log off */
fclose($popConnection);
}
+ return true;
}
/**