public
Fork of rails/rails
Description: Ruby on Rails - forked for implementing I18n patch
Homepage: http://rubyonrails.org
Clone URL: git://github.com/svenfuchs/rails.git
Nil charset caused subject line to be improperly quoted in implicitly 
multipart messages (closes #2662)


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3960 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
jamis (author)
Sat Mar 18 16:18:50 -0800 2006
commit  49efa02b9e8d868b2d28a3db76269d8b8fcde0a6
tree    0ec96c2e208dcecc1fff84ad85ba61dce3499871
parent  db0e8ff1c3496841d7a307794dacecd82e55ce6a
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Nil charset caused subject line to be improperly quoted in implicitly multipart messages #2662 [ehalvorsen+rails@runbox.com]
0
+
0
 * Parse content-type apart before using it so that sub-parts of the header can be set correctly #2918 [Jamis Buck]
0
 
0
 * Make custom headers work in subparts #4034 [elan@bluemandrill.com]
...
293
294
295
296
297
298
299
...
432
433
434
435
 
 
 
 
436
437
438
...
293
294
295
 
296
297
298
...
431
432
433
 
434
435
436
437
438
439
440
0
@@ -293,7 +293,6 @@ module ActionMailer
0
           end
0
           unless @parts.empty?
0
             @content_type = "multipart/alternative"
0
- @charset = nil
0
             @parts = sort_parts(@parts, @implicit_parts_order)
0
           end
0
         end
0
@@ -432,7 +431,10 @@ module ActionMailer
0
             m.parts << part
0
           end
0
           
0
- m.set_content_type(real_content_type, nil, ctype_attrs) if real_content_type =~ /multipart/
0
+ if real_content_type =~ /multipart/
0
+ ctype_attrs.delete "charset"
0
+ m.set_content_type(real_content_type, nil, ctype_attrs)
0
+ end
0
         end
0
 
0
         @mail = m
...
167
168
169
 
 
 
 
 
 
 
 
170
171
172
...
646
647
648
 
 
 
 
 
649
650
651
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
...
654
655
656
657
658
659
660
661
662
663
664
0
@@ -167,6 +167,14 @@ class TestMailer < ActionMailer::Base
0
     @implicit_parts_order = order if order
0
   end
0
 
0
+ def implicitly_multipart_with_utf8
0
+ recipients "no.one@nowhere.test"
0
+ subject "Foo áëô îü"
0
+ from "some.one@somewhere.test"
0
+ template "implicitly_multipart_example"
0
+ body ({ "recipient" => "no.one@nowhere.test" })
0
+ end
0
+
0
   def html_mail(recipient)
0
     recipients recipient
0
     subject "html mail"
0
@@ -646,6 +654,11 @@ EOF
0
     assert_match(/\nSubject: =\?utf-8\?Q\?Foo_.*?\?=/, mail.encoded)
0
   end
0
 
0
+ def test_implicitly_multipart_with_utf8
0
+ mail = TestMailer.create_implicitly_multipart_with_utf8
0
+ assert_match(/\nSubject: =\?utf-8\?Q\?Foo_.*?\?=/, mail.encoded)
0
+ end
0
+
0
   def test_explicitly_multipart_messages
0
     mail = TestMailer.create_explicitly_multipart_example(@recipient)
0
     assert_equal 3, mail.parts.length

Comments

    No one has commented yet.