mailparser
This commit is contained in:
1337
test/mailparser.js
Normal file
1337
test/mailparser.js
Normal file
File diff suppressed because it is too large
Load Diff
63
test/nested.eml
Normal file
63
test/nested.eml
Normal file
@@ -0,0 +1,63 @@
|
||||
From: u@example.com
|
||||
Content-Type: multipart/mixed;
|
||||
boundary="----=_NextPart_000_0D48_01CE140D.19527DD0"
|
||||
|
||||
|
||||
------=_NextPart_000_0D48_01CE140D.19527DD0
|
||||
Content-Type: multipart/related;
|
||||
boundary="----=_NextPart_001_0D49_01CE140D.19527DD0"
|
||||
|
||||
|
||||
------=_NextPart_001_0D49_01CE140D.19527DD0
|
||||
Content-Type: multipart/alternative;
|
||||
boundary="----=_NextPart_002_0D4A_01CE140D.19527DD0"
|
||||
|
||||
|
||||
------=_NextPart_002_0D4A_01CE140D.19527DD0
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
Content-Type: text/plain;
|
||||
charset="utf-8"
|
||||
|
||||
|
||||
Dear Sir,
|
||||
|
||||
Good evening.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
------=_NextPart_002_0D4A_01CE140D.19527DD0
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
Content-Type: text/html;
|
||||
charset="utf-8"
|
||||
|
||||
<p>Dear Sir</p>
|
||||
<p>Good evening.</p>
|
||||
<p></p>
|
||||
------=_NextPart_002_0D4A_01CE140D.19527DD0--
|
||||
|
||||
------=_NextPart_000_0D48_01CE140D.19527DD0
|
||||
Content-Type: multipart/alternative; boundary="===============1276485360=="
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
|
||||
--===============1276485360==
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
|
||||
|
||||
The footer
|
||||
|
||||
--===============1276485360==
|
||||
Content-Type: text/html; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
<p>The footer</p>
|
||||
|
||||
--===============1276485360==--
|
||||
------=_NextPart_000_0D48_01CE140D.19527DD0--
|
||||
|
22
test/windowsfail.js
Normal file
22
test/windowsfail.js
Normal file
@@ -0,0 +1,22 @@
|
||||
var MailParser = require("../lib/mailparser").MailParser,
|
||||
testCase = require('nodeunit').testCase,
|
||||
utillib = require("util"),
|
||||
encodinglib = require("encoding");
|
||||
|
||||
// This test fails in windows as iconv-lite does not support CP949
|
||||
exports["ks_c_5601-1987"] = function(test){
|
||||
var encodedText = "Subject: =?ks_c_5601-1987?B?vcU=?=\r\n"+
|
||||
"Content-Type: text/plain; charset=ks_c_5601-1987\r\n"+
|
||||
"Content-Transfer-Encoding: base64\r\n"+
|
||||
"\r\n"+
|
||||
"vcU=",
|
||||
mail = new Buffer(encodedText, "utf-8");
|
||||
|
||||
var mailparser = new MailParser();
|
||||
mailparser.end(mail);
|
||||
mailparser.on("end", function(mail){
|
||||
test.equal(mail.subject, "신");
|
||||
test.equal(mail.text.trim(), "신");
|
||||
test.done();
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user