Upon updating to WordPress 2.3, I started receiving emails with garbled subject lines. I host a site that's in two languages. I have Backups scheduled for the English side and for the Serbian side. The Serbian emailed backups are the ones with garbled subject lines.
Here's an example of the full email header under WordPress 2.3:
Return-path: <xxx@xxx.xxx.net>
Envelope-to: xxx@xxx.org
Delivery-date: Fri, 12 Oct 2007 14:00:51 -0700
Received: from xxx by xxx.xxx.net with local-bsmtp (Exim 4.63)
(envelope-from <xxx@xxx.xxx.net>)
id 1IgRco-0001qY-Hc
for xxx@xxx.org; Fri, 12 Oct 2007 14:00:51 -0700
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
xxx.xxx.net
X-Spam-Level: **
X-Spam-Status: No, score=2.8 required=5.0 tests=AWL,NO_RELAYS,TVD_SPACE_RATIO
autolearn=no version=3.2.3
Received: from xxx by xxx.xxx.net with local (Exim 4.63)
(envelope-from <xxx@xxx.xxx.net>)
id 1IgRco-0001qU-Cb
for xxx@xxx.org; Fri, 12 Oct 2007 14:00:50 -0700
To: xxx@xxx.org
Subject: =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0KHR?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?gNC/?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0YHQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?utC4?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?INCa?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0YPQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?u9GC?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0YPR?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?gNC9?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0Lgg?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0Lgg?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0KPQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?vNC1?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0YLQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?vdC4?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0YfQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?utC4?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?INCm?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0LXQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?vdGC?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0LDR?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?gCDQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?odCy?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?LiDQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?odCw?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?0LLQ?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?sCBE?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?YXRh?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?YmFz?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?ZSBC?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?YWNr?= =?boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139?B?dXA=?=
Date: Fri, 12 Oct 2007 16:00:50 -0500
From: "xxx@xxx.org" <wordpress@xxx.org>
Message-ID: <2460fefa021c7cd42affd4885a4b0c66@www.xxx.org>
X-Priority: 3
MIME-Version: 1.0
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="b1_2460fefa021c7cd42affd4885a4b0c66"
--b1_2460fefa021c7cd42affd4885a4b0c66
Content-Type: text/plain; charset = "boundary===WPBACKUP-BY-SKIPPY-673bbfba0160c960007e24748b748139"
Content-Transfer-Encoding: 8bit
Here's a full header from an emailed backup before WordPress 2.3:
Return-path: <xxx@xxx.xxx.net>
Envelope-to: xxx@xxx.org
Delivery-date: Fri, 28 Sep 2007 12:25:22 -0700
Received: from xxx by xxx.xxx.net with local-bsmtp (Exim 4.63)
(envelope-from <xxx@xxx.xxx.net>)
id 1IbLSj-0000JX-Mp
for xxx@xxx.org; Fri, 28 Sep 2007 12:25:21 -0700
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
xxx.xxx.net
X-Spam-Level: **
X-Spam-Status: No, score=2.3 required=5.0 tests=AWL,NO_RELAYS,TVD_SPACE_RATIO
autolearn=no version=3.2.3
Received: from xxx by xxx.xxx.net with local (Exim 4.63)
(envelope-from <xxx@xxx.xxx.net>)
id 1IbLSj-0000JT-Hy
for xxx@xxx.org; Fri, 28 Sep 2007 12:25:21 -0700
To: xxx@xxx.org
Subject: =?UTF-8?B?0KHRgNC/0YHQutC4INCa0YPQu9GC0YPRgNC90Lgg0Lgg0KPQvNC10YLQvdC4?= =?UTF-8?B?0YfQutC4INCm0LXQvdGC0LDRgCDQodCyLiDQodCw0LLQsCBEYXRhYmFzZSBC?= =?UTF-8?B?YWNrdXA=?=
Date: Fri, 28 Sep 2007 14:25:21 -0500
From: "xxx@xxx.org" <xxx@xxx.org>
Message-ID: <27251d9ea384fc81f6fa8190ef7cc5d7@www.xxx.org>
X-Priority: 3
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="b1_27251d9ea384fc81f6fa8190ef7cc5d7"
--b1_27251d9ea384fc81f6fa8190ef7cc5d7
Content-Type: text/plain; charset = "UTF-8"
Content-Transfer-Encoding: 8bit
I am using WP-DB-Backup 2.1.3. I updated from WordPress 2.2.3.
No other emails are behaving strangely. I think this is mainly because you did such a thorough job in making sure that emails were well-formed before sending them out, something older version of WP never did. :)
I was checking the wp_mail function (line 134) in the WP 2.3 /wp-includes/pluggable.php and it has changed significantly since WP 2.2.3. It looks like any preformed headers are extensively modified and/or exploded out, which is probably causing your custom boundary to be used as the charset.
I will look into doing a translation for WP-DB-Backup for you.
ye, i use wpdb 2.1.3 for wp2.3 have the same problem. i read about pluggable.php and phpmailer class. because pluggable.php in wp2.3 is changed from wp2.2, so cause wpdb garbled subject.
i mod wpdb 2.1.3 so wpdb can use in wp2.3, my mod as follow:
in code , strong code is new add, because wp_mail() in pluggable.php can't get correct charset, then mail subject is garbled, so i add charset into phpmailer. if your blog is not utf-8, you must change it into your blog's charset, you can also use this code replace
$phpmailer->CharSet = get_bloginfo( 'charset' );
Your mod does not work. The new wp_mail() function in WP 2.3 takes any custom headers sent to it and parses them to make sure they're formed correctly. It already checks and adds the correct character set.
The problem is that as it parses through the headers of emails from WP-DB-Backup it uses the custom boundary as the charset which, in turn, is causing the garbled email subject line.
Here is what I did to fix it. In line 712 of wp-db-backup.php, I removed:
; boundary=\"$boundary\"
It was this part of line 712 that was causing the custom boundary used by WP-DB-Backup to be used as the CharSet. The emails now send correctly with the right header information.
This, of course, is a bug in the new wp_mail() function which I'll be notifying the coders about. wp_mail() should be recognizing that a custom boundary has been set and should use it, instead of trying to apply its own.
Upon updating to WordPress 2.3, I started receiving emails with garbled subject lines. I host a site that's in two languages. I have Backups scheduled for the English side and for the Serbian side. The Serbian emailed backups are the ones with garbled subject lines.
Here's an example of the full email header under WordPress 2.3:
Here's a full header from an emailed backup before WordPress 2.3:
Ghidra99,
What version of the plugin are you using?
What version of WordPress did you upgrade from?
Are other emails from your 2.3 install, such as the ones notifying you of new comments, behaving any differently?
And by the way, is there any chance you could do a Serbian translation for this plugin?
filosofo,
I am using WP-DB-Backup 2.1.3. I updated from WordPress 2.2.3.
No other emails are behaving strangely. I think this is mainly because you did such a thorough job in making sure that emails were well-formed before sending them out, something older version of WP never did. :)
I was checking the
wp_mailfunction (line 134) in the WP 2.3/wp-includes/pluggable.phpand it has changed significantly since WP 2.2.3. It looks like any preformed headers are extensively modified and/or exploded out, which is probably causing your custom boundary to be used as the charset.I will look into doing a translation for WP-DB-Backup for you.
ye, i use wpdb 2.1.3 for wp2.3 have the same problem. i read about pluggable.php and phpmailer class. because pluggable.php in wp2.3 is changed from wp2.2, so cause wpdb garbled subject.
i mod wpdb 2.1.3 so wpdb can use in wp2.3, my mod as follow:
function setup_phpmailer(&$phpmailer) {
if ( $this->useMailer ) :
$phpmailer->AddAttachment($this->diskfile, $this->filename);
$phpmailer->Body = $this->message;
$phpmailer->CharSet = "utf-8";
$phpmailer->CustomHeader = array();
endif;
return true;
}
in code , strong code is new add, because wp_mail() in pluggable.php can't get correct charset, then mail subject is garbled, so i add charset into phpmailer. if your blog is not utf-8, you must change it into your blog's charset, you can also use this code replace
$phpmailer->CharSet = get_bloginfo( 'charset' );
wpdb 2.1.3 mod file is uploaded to here:
http://www.divshare.com/download/2357736-a1f
thanks for a lot!
sdec040721,
Your mod does not work. The new
wp_mail()function in WP 2.3 takes any custom headers sent to it and parses them to make sure they're formed correctly. It already checks and adds the correct character set.The problem is that as it parses through the headers of emails from WP-DB-Backup it uses the custom
boundaryas thecharsetwhich, in turn, is causing the garbled email subject line.Here is what I did to fix it. In line 712 of
wp-db-backup.php, I removed:; boundary=\"$boundary\"It was this part of line 712 that was causing the custom boundary used by WP-DB-Backup to be used as the CharSet. The emails now send correctly with the right header information.
This, of course, is a bug in the new
wp_mail()function which I'll be notifying the coders about.wp_mail()should be recognizing that a custom boundary has been set and should use it, instead of trying to apply its own.i test my mod , it works very well. how do you test my mod? your mod remove boundary is another method, thanks you!
if you copy above code , you must replace “ with english ".
you can download my mod file replace origin file, too.
btw: ghidra99, your blog is not utf-8 charset?
filosofo,
Thanks for adding those diffs on Trac. Hopefully, they get this issue resolved for the next release.
I've updated the plugin in version 2.1.4 to avoid the header problems.
RSS feed for this topic
Reply
You must log in to post.