diff options
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/CHANGELOG | 2 | ||||
-rwxr-xr-x | actionmailer/lib/action_mailer/vendor/tmail/base64.rb | 2 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/vendor/tmail/quoting.rb | 2 | ||||
-rw-r--r-- | actionmailer/test/fixtures/raw_base64_decoded_string | bin | 0 -> 8576 bytes | |||
-rw-r--r-- | actionmailer/test/fixtures/raw_base64_encoded_string | 1 | ||||
-rw-r--r-- | actionmailer/test/quoting_test.rb | 38 | ||||
-rw-r--r-- | actionmailer/test/tmail_test.rb | 1 |
7 files changed, 43 insertions, 3 deletions
diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG index df13a43ca1..3b9283bc03 100644 --- a/actionmailer/CHANGELOG +++ b/actionmailer/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix attachment decoding when using the TMail C extension. #7861 [orangechicken] + * Increase mail delivery test coverage. #8692 [kamal] * Register alternative template engines using ActionMailer::Base.register_template_extension('haml'). #7534 [cwd, Josh Peek] diff --git a/actionmailer/lib/action_mailer/vendor/tmail/base64.rb b/actionmailer/lib/action_mailer/vendor/tmail/base64.rb index 8f89a489dc..5713827521 100755 --- a/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/base64.rb @@ -42,7 +42,7 @@ module TMail end def rb_decode( str, strict = false ) - str.unpack('m') + str.unpack('m').first end begin diff --git a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb index 694242349d..a7e5c44710 100644 --- a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb @@ -78,7 +78,7 @@ module TMail end def unquote_base64_and_convert_to(text, to, from) - convert_to(Base64.decode(text).first, to, from) + convert_to(Base64.decode(text), to, from) end begin diff --git a/actionmailer/test/fixtures/raw_base64_decoded_string b/actionmailer/test/fixtures/raw_base64_decoded_string Binary files differnew file mode 100644 index 0000000000..99b00ea162 --- /dev/null +++ b/actionmailer/test/fixtures/raw_base64_decoded_string diff --git a/actionmailer/test/fixtures/raw_base64_encoded_string b/actionmailer/test/fixtures/raw_base64_encoded_string new file mode 100644 index 0000000000..eacca525ae --- /dev/null +++ b/actionmailer/test/fixtures/raw_base64_encoded_string @@ -0,0 +1 @@ +R0lGODlhSwF3APcAAP/////39/j29f/v7vfv7u/v7//m5f7k4vfl5f/e3vff3/Lh4f/a2PXb2N/f3/fW1v/V1PDU0/TTz/fPzv/MzO/OzfHLx/fHxv/Fw//Cv+7ExO/EwMzMzPi/vfW8tPG8vO28t/+3tee9vfe1svC1tb+/v+e1tfCzr/+uq+izrO+urueurv+mpt+ureerpe6lpeilpf+ZzOaknd2lpK+vr/+Zme+dneadnOCdnOealv+Rjd+alu+VleaVlN2VlPeNi8yZmdeUk/CLi+aNjN+PjeaMh8GUlNaPjf+ChfiDg9+Kgs+NivCEhJmZmfd/etGKh+aDg/97e96Dg92Eeu99euZ8fNWBf/9zc917ePdzc+V5dtd8eo+Pj+51ctB9e+dzct91cL98fO9sbf9mZs9zbNZxceZsauhqZN1rZt9qatRtZexkZdBtYtdqan9/f8JubuhiX95kYdZkYcxmZt9hWqpsbN5cWd5aU+VXUNRZWbxgYOBSS8lYTtRTUsBZV8dUSd1LUaVaWtxKQ85LS2ZmZtVHRN9DO71KStlCOtBAPb5ERMRCQtg7M+U0PMk9PdQ5OZVHR98xMdgxMdsvKrI6OswzM7s2MNsqKk9PT7Y1K6o3N90nHtYpIdApKbQvL9ckLN4hIcwnI7MtIt4gG+gdHdYiGbspJtMgILIpKc4gF9ccGLUkH84bG80dEL8gIMIfGD8/P8QbG4sqKqwiGcwYD4QpKcYYEKchGc4TD7MaFsUUFNcQBr0WEuANDaYdEuAKAMQQB7wREYwdGqAXEDMzM74OCbMQEM4JANYFAK0PD8YJAOAAAMQHB6QQEKYPALsIEbwHB3oZGZsQCr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wzwccZQPiIAfV/kEJ1iBCVCwZS53mcs1fq0NbGxj+4rXxCtQQZazbAI2e6ADb+6ACDSgZCVbwM4VsACe82yBCVDAzxkYqZQFXb0AfIAEhvbAj9HrXkY3utEjKPN9y3xiE1/5yj5mM5uHDGc40xnPFaiABEQtgQiQmtQPkAAFJAABCsR30K8e3QVUsIEP1HrTTcZ1rnU9ghOQwNJXHoGvq0yCIX8gvSIg8psv0IELNPsCFMgzqCMw7Qc8oAHXxja2GfCABDwAArAG99wS8IIOWOACRN4ABVjtZ3a3u92GPvShaz3vWtP6yM328wQuMAF+81vV045AA/8Cfm0FFLzgCDB4wROgAAbwNtwPN1oARjCCC1TgAkpmwAESkAAGdNzjH2dAAijAYWZ3QAMXMPLFL2DnfbO7396WQLUfsG2CN2ABClhAzhGwc57v3AAIOMABFOBwiBf9YxRAQQcmIIEKPGAATzfAAAwwdaobIOhXnwCfVz4Bi2e93+1etcwZ0ICxM0ABC094z3s+AAIggO0GIADcox5oo9edXgfoAAYoYG0DOAQAAQA84J8+eMIbQAITQPXhZe5txo+d42cv+NUlz/O2I4AAl8c8Adi+ec6z3e6fl9cA2q0Av5fe9KcHgAGqne2Nt37jChD61as+dalL/fKb1/zmBTBdgN0LIAC+/z3vBwBl0BdfVwmAAAMgcADUN9/0CJd80GdPdalHnfCEz33vf7994AM/8N8nvvHFP6gBZDwBAzC94AkfgOZX3/rWv378nx6A4Q8f8N4PvEMAP37+6ykgADs=
\ No newline at end of file diff --git a/actionmailer/test/quoting_test.rb b/actionmailer/test/quoting_test.rb index 77bd769be9..243c982fc9 100644 --- a/actionmailer/test/quoting_test.rb +++ b/actionmailer/test/quoting_test.rb @@ -30,9 +30,41 @@ class QuotingTest < Test::Unit::TestCase mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject")) assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject end + + def test_rb_decode + encoded, decoded = expected_base64_strings + assert_equal decoded, TMail::Base64.rb_decode(encoded) + end + + def test_rb_encode + encoded, decoded = expected_base64_strings + assert_equal encoded.length, TMail::Base64.rb_encode(decoded).length + end + + def test_rb_decode_should_match_c_decode_if_available + encoded, decoded = expected_base64_strings + + begin + require 'tmail/base64.so' + assert_equal TMail::Base64.rb_decode(encoded), TMail::Base64.c_decode(encoded) + rescue LoadError + # No .so + end + end + + def test_rb_encode_should_match_c_encode_if_available + encoded, decoded = expected_base64_strings + + begin + require 'tmail/base64.so' + assert_equal TMail::Base64.rb_encode(decoded), TMail::Base64.c_encode(decoded) + rescue LoadError + # No .so + end + end private - + # This whole thing *could* be much simpler, but I don't think Tempfile, # popen and others exist on all platforms (like Windows). def execute_in_sandbox(code) @@ -54,4 +86,8 @@ class QuotingTest < Test::Unit::TestCase File.delete(test_name) rescue nil File.delete(res_name) rescue nil end + + def expected_base64_strings + [ File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_encoded_string"), File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_decoded_string") ] + end end diff --git a/actionmailer/test/tmail_test.rb b/actionmailer/test/tmail_test.rb index dcba4b5ff3..b40d8945c5 100644 --- a/actionmailer/test/tmail_test.rb +++ b/actionmailer/test/tmail_test.rb @@ -16,6 +16,7 @@ class TMailMailTest < Test::Unit::TestCase mail = TMail::Mail.parse(fixture) assert_equal 2, mail.attachments.length assert_equal "image/png", mail.attachments.first.content_type + assert_equal 1902, mail.attachments.first.length assert_equal "application/pkcs7-signature", mail.attachments.last.content_type end end |