WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 21 months ago

#10587 new defect (bug)

POP3 class does not differentiate between 0 messages and failure to login

Reported by: robfelty Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.9
Component: Mail Keywords: needs-patch close
Focuses: Cc:

Description

The login function in wp-includes/class-pop3.php states that it returns false on failure, but it also returns false if there are no messages. These should be 2 different scenarios. I have fixed the problem. Here is an svn diff:

$ svn diff ../../../wp-includes/class-pop3.php
Index: ../../../wp-includes/class-pop3.php
===================================================================
--- ../../../wp-includes/class-pop3.php (revision 11572)
+++ ../../../wp-includes/class-pop3.php (working copy)
@@ -212,7 +212,8 @@
                 return false;
             } else {
                 $count = $this->pass($pass);
-                if( (!$count) || ($count == -1) ) {
+                if( ($count===false) || ($count == -1) ) {
+                echo "count=$count\n";
                     //  Preserve the error generated by last() and pass()
                     return false;
                 } else

Attachments (1)

class-pop3.diff (566 bytes) - added by robfelty 6 years ago.

Download all attachments as: .zip

Change History (6)

@robfelty6 years ago

comment:1 @robfelty6 years ago

  • Keywords has-patch needs-testing added

comment:2 @nacin5 years ago

This is an external, so this should be reported upstream. I don't think we should be making such a change.

Does this affect our usage of class-pop3 at all?

Is class-pop3 current?

comment:3 @nacin5 years ago

  • Keywords needs-patch added; email has-patch needs-testing removed
  • Milestone changed from Unassigned to Future Release

Looks like class-pop3 can use an update eventually. http://sourceforge.net/projects/squirrelmail/develop

comment:4 @aaroncampbell4 years ago

  • Keywords close added

We're upgrading the SquirrelMail POP3 class in #17064 but it doesn't look like it fixes this. However, I think this is a bug that needs to be reported to the SquirrelMail project.

For now if you receive false, just check POP3->ERROR. If it's empty then you got 0 messages and if it contains an error then the error explains what went wrong.

I recommend closing as wontfix. This is currently one of our few libraries that looks like we haven't modified at all.

comment:5 @codebykat21 months ago

  • Cc kat@… added
Note: See TracTickets for help on using tickets.