Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test case for an email with no mime header and no content-type

  • Loading branch information...
commit b6e837129f8e615273ca95e8982a64f4f9a34e7e 1 parent c106be0
@Vagabond authored
Showing with 18 additions and 0 deletions.
  1. +9 −0 src/mimemail.erl
  2. +9 −0 testdata/Plain-text-only-no-content-type.eml
View
9 src/mimemail.erl
@@ -899,6 +899,15 @@ parse_example_mails_test_() ->
?assertEqual(<<"This message contains only plain text.\r\n">>, Body)
end
},
+ {"parse a plain text email with no content type",
+ fun() ->
+ Decoded = Getmail("Plain-text-only-no-content-type.eml"),
+ ?assertEqual(5, tuple_size(Decoded)),
+ {Type, SubType, _Headers, _Properties, Body} = Decoded,
+ ?assertEqual({<<"text">>, <<"plain">>}, {Type, SubType}),
+ ?assertEqual(<<"This message contains only plain text.\r\n">>, Body)
+ end
+ },
{"parse a plain text email with no MIME header",
fun() ->
{Type, SubType, _Headers, _Properties, Body} =
View
9 testdata/Plain-text-only-no-content-type.eml
@@ -0,0 +1,9 @@
+Message-Id: <F5B196D4-10CD-4876-822F-59C5C39D520E@fusedsolutions.com>
+From: Micah Warren <micahw@fusedsolutions.com>
+To: test@devmicah.fusedsolutions.com
+Content-Transfer-Encoding: 7bit
+X-Smtp-Server: mail.fusedsolutions.com:micahw@fusedsolutions.com
+Subject: Plain text only
+Date: Mon, 1 Jun 2009 14:50:15 -0400
+
+This message contains only plain text.
Please sign in to comment.
Something went wrong with that request. Please try again.