Silence fsockopen since errors are handled internally.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 20 Jul 2007 16:53:10 +0000 (16:53 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 20 Jul 2007 16:53:10 +0000 (16:53 +0000)
Use more sensible return values for this function.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12560 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver_SMTP.class.php

index 490f21b7af9bce9378cc159e4219d2f67e55e983..431ad74cce9828fc327fcc85f96ed7e28a084086 100644 (file)
@@ -430,28 +430,30 @@ class Deliver_SMTP extends Deliver {
         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;
     }
 
     /**