This project is archived and is in readonly mode.

#4294 ✓resolved
yuanyi

[PATCH] Remove quote_fields from ActionMailer

Reported by yuanyi | March 29th, 2010 @ 06:07 PM | in 3.0.2

This bug happened only when there're multibyte chars in subject and the length of quoted subject is more than 40, ActionMailer and Mail gem will quote the subject twice and make it garbled.

For example, if I set mail's subject to a multibyte string like: "\350\277\231\346\230\257\344\270\200\344\270\252\351\202\256\344\273\266\346", ActionMailer will quote the subject to:

Subject: =?UTF8?B?5oKo5Yia5Yia5Zyo5oqi5bqn572R5Yib5bu65LqG5AuIDkuKrmlrDmtLvliqgh?=

and Mail gem will quote and fold it again, because it's all ASCII char now, Mail gem will fold it only, so it becames:

Subject: =?UTF8?B?5oKo5Yia5Yia5Zyo5oqi5bqn572R5Yib5bu65LqG5A
    uIDkuKrmlrDmtLvliqgh?=

but it should be:

Subject: =?UTF8?B?5oKo5Yia5Yia5Zyo5oqi5bqn572R5Yib5bu65LqG5A==?=
    =?UTF8?B?uIDkuKrmlrDmtLvliqgh?=

so the mail subject is garbled in mailbox.

This patch will move quote_fields! to old_api and add a test to ensure ActionMailer won't quote header fields anymore.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages