diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-07-26 15:51:11 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-07-26 15:51:11 +0100 |
commit | d12c1e0ae5fc9a4beca05d62166a41ef6e657203 (patch) | |
tree | fa7019dd890135f59f4c563e68c676a70d0bc883 /spec/lib | |
parent | 27d6ad899f594bd9b79e54cdc5a3c17110f3b26c (diff) |
Backport https://github.com/mikel/mail/pull/405 to prevent stack overflow errors when parsing large mails with envelopes on memory limited systems.0.12.0.1hotfix/0.12.0.1
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/mail_handler/mail_handler_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index d6e7ba5d2..3e5176e87 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -9,6 +9,13 @@ end describe 'when creating a mail object from raw data' do + it "should be able to parse a large email without raising an exception", :focus => true do + m = Mail.new + m.add_file(:filename => "attachment.data", :content => "a" * (8 * 1024 * 1024)) + raw_email = "From jamis_buck@byu.edu Mon May 2 16:07:05 2005\r\n#{m.to_s}" + lambda { Mail::Message.new(raw_email) }.should_not raise_error + end + it 'should correctly parse a multipart email with a linebreak in the boundary' do mail = get_fixture_mail('space-boundary.email') mail.parts.size.should == 2 |