email-forward-parser 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parser.js +16 -16
- package/package.json +1 -1
- package/test.js +25 -0
- package/test.txt +14 -0
package/lib/parser.js
CHANGED
|
@@ -18,22 +18,22 @@ var REGEXES = {
|
|
|
18
18
|
byte_order_mark : /[\uFEFF]/gm, // Outlook 2019
|
|
19
19
|
|
|
20
20
|
subject : [
|
|
21
|
-
/^Fw:(
|
|
22
|
-
/^VS:(
|
|
23
|
-
/^WG:(
|
|
24
|
-
/^RV:(
|
|
25
|
-
/^TR:(
|
|
26
|
-
/^I:(
|
|
27
|
-
/^FW:(
|
|
28
|
-
/^Vs:(
|
|
29
|
-
/^PD:(
|
|
30
|
-
/^ENC:(
|
|
31
|
-
/^Redir.:(
|
|
32
|
-
/^VB:(
|
|
33
|
-
/^VL:(
|
|
34
|
-
/^Videresend:(
|
|
35
|
-
/^İLT:(
|
|
36
|
-
/^Fwd:(
|
|
21
|
+
/^Fw:(.*)/m, // Outlook Live (cs, en, hr, hu, sk), Yahoo Mail (all locales)
|
|
22
|
+
/^VS:(.*)/m, // Outlook Live (da), New Outlook 2019 (da)
|
|
23
|
+
/^WG:(.*)/m, // Outlook Live (de), New Outlook 2019 (de)
|
|
24
|
+
/^RV:(.*)/m, // Outlook Live (es), New Outlook 2019 (es)
|
|
25
|
+
/^TR:(.*)/m, // Outlook Live (fr), New Outlook 2019 (fr)
|
|
26
|
+
/^I:(.*)/m, // Outlook Live (it), New Outlook 2019 (it)
|
|
27
|
+
/^FW:(.*)/m, // Outlook Live (nl, pt), New Outlook 2019 (cs, en, hu, nl, pt, ru, sk), Outlook 2019 (all locales)
|
|
28
|
+
/^Vs:(.*)/m, // Outlook Live (no)
|
|
29
|
+
/^PD:(.*)/m, // Outlook Live (pl), New Outlook 2019 (pl)
|
|
30
|
+
/^ENC:(.*)/m, // Outlook Live (pt-br), New Outlook 2019 (pt-br)
|
|
31
|
+
/^Redir.:(.*)/m, // Outlook Live (ro)
|
|
32
|
+
/^VB:(.*)/m, // Outlook Live (sv), New Outlook 2019 (sv)
|
|
33
|
+
/^VL:(.*)/m, // New Outlook 2019 (fi)
|
|
34
|
+
/^Videresend:(.*)/m, // New Outlook 2019 (no)
|
|
35
|
+
/^İLT:(.*)/m, // New Outlook 2019 (tr)
|
|
36
|
+
/^Fwd:(.*)/m // Gmail (all locales), Thunderbird (all locales)
|
|
37
37
|
],
|
|
38
38
|
|
|
39
39
|
separator : [
|
package/package.json
CHANGED
package/test.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const EmailForwardParser = require("./");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
|
|
4
|
+
MY_EMAIL_STRING = fs.readFileSync("./test.txt", "utf-8");
|
|
5
|
+
// MY_EMAIL_STRING = fs.readFileSync("./test_working.txt", "utf-8");
|
|
6
|
+
// const result = new EmailForwardParser().read(MY_EMAIL_STRING, "FW: FC-701 Contact Request by Gleam.io");
|
|
7
|
+
const result = new EmailForwardParser().read(MY_EMAIL_STRING, "Fwd:");
|
|
8
|
+
|
|
9
|
+
console.log(result.forwarded);
|
|
10
|
+
console.log(result);
|
|
11
|
+
// console.log(result.email.to);
|
|
12
|
+
// console.log(result.email.cc);
|
|
13
|
+
|
|
14
|
+
// {
|
|
15
|
+
// forwarded: false,
|
|
16
|
+
// message: null,
|
|
17
|
+
// email: {
|
|
18
|
+
// body: undefined,
|
|
19
|
+
// from: { address: undefined, name: undefined },
|
|
20
|
+
// to: undefined,
|
|
21
|
+
// cc: undefined,
|
|
22
|
+
// subject: undefined,
|
|
23
|
+
// date: undefined
|
|
24
|
+
// }
|
|
25
|
+
// }
|
package/test.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
Camille Le Bruchec
|
|
3
|
+
Head of Customer Success - Crisp
|
|
4
|
+
https://calendly.com/camille-crisp/30min-1
|
|
5
|
+
camille@crisp.chat
|
|
6
|
+
|
|
7
|
+
> Début du message réexpédié :
|
|
8
|
+
>
|
|
9
|
+
> De: Camille Le Bruchec <camille.lebruchec@icloud.com>
|
|
10
|
+
> Date: 19 avril 2022 à 16:38:24 UTC+2
|
|
11
|
+
> À: Camille Le Bruchec <camille@crisp.chat>
|
|
12
|
+
>
|
|
13
|
+
>
|
|
14
|
+
> Hello test 4
|