Index: wp-includes/class-pop3.php
===================================================================
--- wp-includes/class-pop3.php	(revision 11172)
+++ wp-includes/class-pop3.php	(working copy)
@@ -50,6 +50,9 @@
         if( !empty($server) ) {
             // Do not allow programs to alter MAILSERVER
             // if it is already specified. They can get around
+    var $ALLOWLOGIN = FALSE;    //  Allow or disallow login()
+                                //  when APOP auth failed
+
             // this if they -really- want to, so don't count on it.
             if(empty($this->MAILSERVER))
                 $this->MAILSERVER = $server;
@@ -180,6 +183,8 @@
             } else {
                 $AuthString = $banner;
                 $AuthString .= $pass;
+                if (! $this->ALLOWLOGIN)
+                	return false;
                 $APOPString = md5($AuthString);
                 $cmd = "APOP $login $APOPString";
                 $reply = $this->send_cmd($cmd);
@@ -190,6 +195,8 @@
                 } else {
                     //  Auth successful.
                     $count = $this->last("count");
+                    if (! $this->ALLOWLOGIN)
+                	    return false;
                     $this->COUNT = $count;
                     return $count;
                 }
@@ -212,7 +219,7 @@
                 return false;
             } else {
                 $count = $this->pass($pass);
-                if( (!$count) || ($count == -1) ) {
+                if ($count == -1) {
                     //  Preserve the error generated by last() and pass()
                     return false;
                 } else
@@ -480,7 +487,7 @@
         $fp = $this->FP;
         $cmd = "QUIT";
         fwrite($fp,"$cmd\r\n");
-        $reply = fgets($fp,$this->BUFFER);
+        $reply = @fgets($fp,$this->BUFFER);
         $reply = $this->strip_clf($reply);
         if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
         fclose($fp);
