This project is archived and is in readonly mode.
[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
-
José Valim March 29th, 2010 @ 07:41 PM
- Assigned user set to Mikel Lindsaar
- Milestone cleared.
Thanks for patch! I guess Mikel is already working on it so I'm assigning it to him.
-
Mikel Lindsaar March 29th, 2010 @ 09:45 PM
Yes, I am working on this and while the above patch "works" unfortunately there are a lot of edge cases where it doesn't and the ActionMailer test suite does not cover these.
Mail 2.2 should address this problem in header encoding, once I know this is good, I'll be doing something similar to this.
Mikel
-
Yehuda Katz (wycats) March 29th, 2010 @ 09:47 PM
- State changed from new to hold
-
Mikel Lindsaar March 30th, 2010 @ 01:26 PM
Working on this today and tonight. Should have new version of mail shortly that handles this stuff.
-
Mikel Lindsaar March 31st, 2010 @ 01:09 PM
- State changed from hold to open
Mail new version is giving: 196 tests, 439 assertions, 13 failures, 6 errors in ActionMailer. Will take me a little time to make sure this is all correct. Should be able to submit full patch to ActionMailer shortly, some of the old tests rely on quoting.rb and I want to nuke it, so am going to refactor.
-
Mikel Lindsaar April 20th, 2010 @ 05:49 AM
- State changed from open to resolved
This is now rolled into core by these commits
Mikel
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
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>