This project is archived and is in readonly mode.
Email multipart 2 years old bug
-
xdmx
Some code to test it:
*** notifications.rb:
def alert
@sent_on = Time.now @from = 'test@test.com' @recipients = 'test@test.com' @subject = 'test' @body = {:reqst => '<div style="color:red">test</div>'}end
*** alert.text.plain.erb:
<%= @reqst %>
*** alert.text.html.erb:
<%= @reqst %>
*** console:
x = Notifications.create_alert => #<TMail::Mail port=#<TMail::StringPort:id=0x..fdb902954> bodyport=#<TMail::StringPort:id=0x..fdb8fff88>> x.encoded => "Date: Sun, 12 Oct 2008 21:30:13 +0200\r\nFrom: test@test.com\r\nTo: test@test.com\r\nSubject: test\r\nMime-Version: 1.0\r\nContent-Type: multipart/alternative; boundary=mimepart_48f250492c08b_2098..fdbfb1b7e3e0\r\n\r\n\r\n--mimepart_48f250492c08b_2098..fdbfb1b7e3e0\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: Quoted-printable\r\nContent-Disposition: inline\r\n\r\n
test=\n\r\n--mimepart_48f250492c08b_2098..fdbfb1b7e3e0\r\nContent-Type: text/html; charset=utf-8\r\nContent-Transfer-Encoding: Quoted-printable\r\nContent-Disposition: inline\r\n\r\ntest=\n\r\n--mimepart_48f250492c08b_2098..fdbfb1b7e3e0--\r\n"As you can see is:
testIt adds that 3D (ascii: '=') and that cause the wrong rendering on a lot of email clients :( -
Theo Cushion
I've come across this on the formatting of links in text/plain emails. It is the encoding method "quoted-printable" that is responsible for converting '=' to '=3D'.
I found an explanation here: http://ask-leo.com/why_does_my_e...
So it would appear that this is not a bug, and probably a problem with the email client.
-
Barry Hess
Hmmm…I'm running into this as well. I have a multipart email that is sending "text/html" as one part. In order to fix, I need to set the part's transfer_encoding equal to "none" (p.transfer_encoding = "none" within a part block).
Since Rails is sending the email, it sort of is the client.
-
Barry Hess
In process of writing a patch. Then I just realized @Theo probably meant the '=3D's are fine and the problem is email clients that cannot interpret them are buggy.
I can confirm the '=3D's, but if the Rails team is saying the '=3D's are fine, then there is no reason to keep this ticket open.
-
Barry Hess
Further reason to close this and forget it ever happened -
We've found that transfer_encoding set to "none" triggers some spam filters out there to spam our emails. The best alternative seems to be to set to "none" in development so emails look nice in the console log and leave at "quoted-printable" in production and test.
-
Rohit Arondekar
- State changed from incomplete to wontfix
- Assigned user set to Mikel Lindsaar
Closing ticket based on Barry Hess's comments. If anybody thinks this ticket should remain open, just make a comment and I'll re-open it.