WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 5 months ago

#5252 accepted defect (bug)

base64-encoded post-by-email post garbled.

Reported by: kallewoof Owned by: westi
Milestone: Future Release Priority: normal
Severity: normal Version: 2.3
Component: Mail Keywords: needs-patch
Focuses: Cc:

Description

When posting-by-email, my cellphone submits code using "content-transfer-encoding: base64". The message appears (output from wp-mail.php) like so:

Author = [my email] <p><p><b>Content-type:</b> text/plain, <b>Content-Transfer-Encoding:</b> base64, <b>boundary:</b> </p>
<p><b>Raw content:</b><br /><pre>SnVzdCB0ZXN0aW5nIHBvc3RpbmcgZnJvbSBteSBjZWxsLiBTdHJ1Y2sgbWUgd2hpbGUgcmVh
ZGluZyAgUmFwaCBLb3N0ZXIncyBwb3N0cyBhYm91dCB0aGUgZmlyZXMgaW4gQ2FsIHRoYXQg
YmVpbmcgYWJsZSB0byBwb3N0IHRvIHlvdXIgYmxvZyBmcm9tIGEgY2VsbHBob25lIGlzIGEg
dXNlZnVsIGZlYXR1cmUuIA==</pre></p>
<p><b>Author:</b> 1</p>
<p><b>Posted title:</b> =?utf-8?B?Q2VsbHBob25lIHBvc3RpbmcgaW4gV1A=?=<br />
<b>Posted content:</b><br /><pre>SnVzdCB0ZXN0aW5nIHBvc3RpbmcgZnJvbSBteSBjZWxsLiBTdHJ1Y2sgbWUgd2hpbGUgcmVh
ZGluZyAgUmFwaCBLb3N0ZXIncyBwb3N0cyBhYm91dCB0aGUgZmlyZXMgaW4gQ2FsIHRoYXQg
YmVpbmcgYWJsZSB0byBwb3N0IHRvIHlvdXIgYmxvZyBmcm9tIGEgY2VsbHBob25lIGlzIGEg
dXNlZnVsIGZlYXR1cmUuIA==</pre></p><p>Mission complete, message <strong>1</strong> deleted.</p>

The provided patch detects base64-encoded content transfers and base64_decodes them. For some reason (I'm no utf8-expert) the TITLE of the post has "=?utf-8?B?" prepended to the actual base64 content (see above), which means a check for this string + a cropping is needed or base64_decode will not decode the post title properly.

Attachments (1)

wp-mail-base64-patch.diff (1023 bytes) - added by kallewoof 7 years ago.
wp-mail.php patch for base64 encoding

Download all attachments as: .zip

Change History (7)

kallewoof7 years ago

wp-mail.php patch for base64 encoding

comment:1 Viper007Bond7 years ago

  • Component changed from General to Administration
  • Keywords has-patch 2nd-opinion added
  • Milestone changed from 2.5 to 2.4

comment:2 rene_e6 years ago

Hi, thanks for the patch. Had the same problem, was solved with the patch. But the title shouldn't be decoded, it's not encoded in base64 (cause it's no content). So by removing the second part of the patch, it works flawlessly with Moto-EZX email client.

comment:3 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added; has-patch removed

See also #5204

comment:4 Denis-de-Bernardy5 years ago

  • Component changed from Administration to Mail
  • Keywords 2nd-opinion removed
  • Owner anonymous deleted

comment:5 westi5 years ago

  • Component changed from Mail to Blog by Email
  • Milestone changed from 2.9 to Future Release
  • Owner set to westi
  • Status changed from new to accepted

Moving all blog-by-email bugs to a seperate component and out of 2.9.

This will all be address by a new canonical blog-by-email plugin which is under development and will hopefully be available by the time 2.9 is released.

comment:6 nacin5 months ago

  • Component changed from Blog by Email to Mail
Note: See TracTickets for help on using tickets.