• Resolved demon_ru

    (@demon_ru)


    classes/class-s2-core.php (356):

    $header['From'] = mb_encode_mimeheader($this->myname, 'UTF-8', 'Q') . " <" . $this->myemail . ">";
                            $header['Reply-To'] = mb_encode_mimeheader($this->myname, 'UTF-8', 'Q') . " <" . $this->myemail . ">";

    longest string “from” is splitted to several rows with dilimiter “\n”.

    wp-includes/pluggable.php
    function wp_mail (line 266).
    of all the header lines is only the first.

    Yes. It is bug of wordpress. Now even publishing a test email is not sent, as in Russian in the “from” substituted largish text.

    https://www.ads-software.com/plugins/subscribe2/

Viewing 9 replies - 1 through 9 (of 9 total)
  • @demon_ru,

    Looking at some of the comments here some of your issue may be down to your PHP version and server configuration also.

    Thread Starter demon_ru

    (@demon_ru)

    PHP 5.3.27
    I can not clearly explained the problem.
    After converting a string to Quoted-Printable, it becomes long. According to the RFC is transferred to another line.
    wp_mail trying to adjust header “from” (as it seems right). It spoils this header, as it leaves only one row of the total value of the (first).

    Did I fix this server configuration?

    @demon_ru,

    Thank you for trying to explain further. So is the issue in Subscribe2, the wp_mail() function or the PHPMailer library?

    Thread Starter demon_ru

    (@demon_ru)

    It’s the issue in wp_mail() function of WordPress.
    And your plugin users are affected by this error ??

    @demon_ru,

    Are you using the UTF-8 character set on your site? (In the DB_COLLATE and DB_CHARSET values of wp-config.php and in the database charset in PHPMyAdmin)

    Also, I think the issue comes from the addAnAddress funtion in the PHPMailer class, in particular this line:
    $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim

    Thread Starter demon_ru

    (@demon_ru)

    UTF-8 on my site, on mysql backend.
    I am sure all is correct.

    headers:

    from: line1
    line2
    line3 <[email protected]>
    Reply-To: line4
    ...

    wp-includes/pluggable.php
    line 249 foreach
    Analyzed only the first line. And headers becomes:

    from: <line1>
    Reply-To: line4

    And the letter was not sent, as this line does not contain a domain.

    @demon_ru,

    I think this is coming from wp_mail() after all but I can’t quite figure out exactly when and where it’s happening just yet – I’m getting there bit by bit though and could perhaps offer a fix if I get a better idea of when it happens.

    @demon_ru,

    You could try this plugin which plug the core wp_mail function with a multibyte version:
    https://kimmo.suominen.com/sw/mbmail/

    It does look quite old now though.

    I have I have just reported a WP bug for this issue: https://core.trac.www.ads-software.com/ticket/28473

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Bug with long header value "from"’ is closed to new replies.