Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#33037 closed defect (bug) (invalid)

Mail not being send in PHP 5.5.25 and 5.6.9 /PCRE 8.36

Reported by: jrf Owned by:
Priority: normal Milestone:
Component: Mail Version:
Severity: normal Keywords:
Cc: Focuses:

Description

Mail is not being send and a preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 728 error is logged.

This is a PHP bug affecting PHP version 5.5.25 and 5.6.9 when run as an apache handler (i.e. mod_php) (status for 5.5.26 and 5.6.10 unconfirmed) and possibly more versions - including custom compilations - which include PCRE Library Version 8.36.

PHPMailer has not been patched for this bug, though a work-around has been published:

class myMailer extends PHPMailer {
    public static function validateAddress($address, $patternselect = 'php')
    {
        return parent::validateAddress($address, $patternselect);
    }
}

This work-around forces the PHPMailer class to fall back to using the PHP filter extension which *should* be available by default since 5.2.0, but may not always be in custom PHP compilations.

While this is not a WP bug in and of itself, it does have an impact on any WP website running on a PHP version using PCRE 8.36.

References:
​https://github.com/PHPMailer/PHPMailer/issues/429
​https://github.com/PHPMailer/PHPMailer/issues/425
​https://github.com/PHPMailer/PHPMailer/issues/424
​https://github.com/PHPMailer/PHPMailer/issues/439
​http://www.exakat.io/wordpress-not-sending-mail-while-php-5-6-9-does/

Change History (9)

#1 @jrf
11 years ago

Looks like PCRE 8.37 might have the same issue and that the issue also affects PHP 5.4.41+.

Last edited 11 years ago by jrf (previous) (diff)

#2 @ocean90
11 years ago

@jrf Does this only happen with PHPMailer 5.2.10 (#28909)?

#3 @jrf
11 years ago

@jrf Does this only happen with PHPMailer 5.2.10

No, it does not. The original blogpost which brought this to my attention is from a user (PHP dev) who is/was using 4.2, now 4.2.2 which contains PHPMailer 5.2.7.
Also, I checked the commits in PHPMailer before filing this report and that particular regex has not been changed since 2013: ​https://github.com/PHPMailer/PHPMailer/blame/master/class.phpmailer.php#l1000

Last edited 11 years ago by jrf (previous) (diff)

#4 @ocean90
11 years ago

  • Version trunk

#5 @jrf
11 years ago

Update: it seems that the problem in the PHP PCRE package has been resolved, though obviously this does not mean that all servers running that package will have updated to the latest, so the issue may still impact unwitting users.

Ref:
​https://github.com/gplessis/dotdeb-php/issues/85
​https://github.com/gplessis/dotdeb-php/issues/81

This ticket was mentioned in ​Slack in #core-passwords by jjj. ​View the logs.


11 years ago

This ticket was mentioned in ​Slack in #core by jorbin. ​View the logs.


11 years ago

#8 @jorbin
11 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

Thanks @jrf for bringing this up and pointing out that it's now fixed upstream. I don't think we should modify PHPMailer to workaround this issue since PCRE has been updated to fix it. This does give people a place to look to find out info if they run into problems which is good.

#9 @jrf
11 years ago

Fine by me, at least people Googling it might now be able to find it.

All the same, the "average" WP user won't understand this and probably just search on or report "wordpress mail not working", so maybe inform support team ?

Note: See TracTickets for help on using tickets.