Ticket #5420: wp-mail.2.diff

File wp-mail.2.diff, 796 bytes (added by Bobcat, 4 years ago)

Don't issue 500 error if no messages; Check for user/password failure

  • wp-mail.php

     
    1414if (!$pop3->connect(get_option('mailserver_url'), get_option('mailserver_port'))) 
    1515        wp_die($pop3->ERROR); 
    1616 
    17 $count = $pop3->login(get_option('mailserver_login'), get_option('mailserver_pass')); 
    18 if (0 == $count) wp_die(__('There doesn’t seem to be any new mail.')); 
     17if (!$pop3->user(get_option('mailserver_login'))) 
     18        wp_die($pop3->ERROR); 
    1919 
     20$count = $pop3->pass(get_option('mailserver_pass')); 
     21if (false === $count) 
     22        wp_die($pop3->ERROR); 
     23if (0 == $count) 
     24        echo "<p>There doesn't seem to be any new mail.</p>\n"; // will fall-through to end of for loop 
    2025 
    2126for ($i=1; $i <= $count; $i++) : 
    2227