email-forward-parser 1.0.19 → 1.0.20

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.
Files changed (2) hide show
  1. package/lib/parser.js +8 -7
  2. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -130,7 +130,7 @@ var REGEXES = {
130
130
  ],
131
131
 
132
132
  original_subject : [
133
- /^Subject\s?:(.+)/im, // Apple Mail (en), Gmail (all locales), Outlook Live / 365 (all locales), New Outlook 2019 (en), Thunderbird (da, en), Missive (en)
133
+ /^\*?Subject\s?:\*?(.+)/im, // Apple Mail (en), Gmail (all locales), Outlook Live / 365 (all locales), New Outlook 2019 (en), Thunderbird (da, en), Missive (en)
134
134
  /^Předmět\s?:(.+)/im, // Apple Mail (cs), New Outlook 2019 (cs), Thunderbird (cs)
135
135
  /^Emne\s?:(.+)/im, // Apple Mail (da, no), New Outlook 2019 (da), Thunderbird (no)
136
136
  /^Betreff\s?:(.+)/im, // Apple Mail (de), New Outlook 2019 (de), Thunderbird (de)
@@ -172,7 +172,7 @@ var REGEXES = {
172
172
  ],
173
173
 
174
174
  original_from : [
175
- /^(\s*From\s?:(.+))$/m, // Apple Mail (en), Outlook Live / 365 (all locales), New Outlook 2019 (en), Thunderbird (da, en), Missive (en)
175
+ /^(\*?\s*From\s?:\*?(.+))$/m, // Apple Mail (en), Outlook Live / 365 (all locales), New Outlook 2019 (en), Thunderbird (da, en), Missive (en)
176
176
  /^(\s*Od\s?:(.+))$/m, // Apple Mail (cs, pl, sk), Gmail (cs, pl, sk), New Outlook 2019 (cs, pl, sk), Thunderbird (cs, sk)
177
177
  /^(\s*Fra\s?:(.+))$/m, // Apple Mail (da, no), Gmail (da, no), New Outlook 2019 (da), Thunderbird (no)
178
178
  /^(\s*Von\s?:(.+))$/m, // Apple Mail (de), Gmail (de), New Outlook 2019 (de), Thunderbird (de)
@@ -215,7 +215,7 @@ var REGEXES = {
215
215
  ],
216
216
 
217
217
  original_to : [
218
- /^\s*To\s?:(.+)$/m, // Apple Mail (en), Gmail (all locales), Outlook Live / 365 (all locales), Thunderbird (da, en), Missive (en)
218
+ /^\*?\s*To\s?:\*?(.+)$/m, // Apple Mail (en), Gmail (all locales), Outlook Live / 365 (all locales), Thunderbird (da, en), Missive (en)
219
219
  /^\s*Komu\s?:(.+)$/m, // Apple Mail (cs), New Outlook 2019 (cs, sk), Thunderbird (cs)
220
220
  /^\s*Til\s?:(.+)$/m, // Apple Mail (da, no), New Outlook 2019 (da), Thunderbird (no)
221
221
  /^\s*An\s?:(.+)$/m, // Apple Mail (de), New Outlook 2019 (de), Thunderbird (de)
@@ -278,7 +278,7 @@ var REGEXES = {
278
278
  ],
279
279
 
280
280
  original_cc : [
281
- /^\s*Cc\s?:(.+)$/m, // Apple Mail (en, da, es, fr, hr, it, pt, pt-br, ro, sk), Gmail (all locales), Outlook Live / 365 (all locales), New Outlook 2019 (da, de, en, fr, it, pt-br), Missive (en)
281
+ /^\*?\s*Cc\s?:\*?(.+)$/m, // Apple Mail (en, da, es, fr, hr, it, pt, pt-br, ro, sk), Gmail (all locales), Outlook Live / 365 (all locales), New Outlook 2019 (da, de, en, fr, it, pt-br), Missive (en)
282
282
  /^\s*CC\s?:(.+)$/m, // New Outlook 2019 (es, nl, pt), Thunderbird (da, en, es, fi, hr, hu, it, nl, no, pt, pt-br, ro, tr, uk)
283
283
  /^\s*Kopie\s?:(.+)$/m, // Apple Mail (cs, de, nl), New Outlook 2019 (cs), Thunderbird (cs)
284
284
  /^\s*Kopio\s?:(.+)$/m, // Apple Mail (fi), New Outlook 2019 (es)
@@ -321,7 +321,7 @@ var REGEXES = {
321
321
  /^\s*Dată\s?:(.+)$/m, // Apple Mail (ro), Thunderbird (ro)
322
322
  /^\s*Дата\s?:(.+)$/m, // Apple Mail (ru, uk), New Outlook 2019 (ru), Thunderbird (ru, uk)
323
323
  /^\s*Tarih\s?:(.+)$/m, // Apple Mail (tr), Thunderbird (tr)
324
- /^\s*Sent\s?:(.+)$/m, // Outlook Live / 365 (all locales)
324
+ /^\*?\s*Sent\s?:\*?(.+)$/m, // Outlook Live / 365 (all locales)
325
325
  /^\s*Päiväys\s?:(.+)$/m // Thunderbird (fi)
326
326
  ],
327
327
 
@@ -425,11 +425,12 @@ class Parser {
425
425
  // attempt it. The `forwarded` boolean gives the confirmation that the \
426
426
  // email was indeed forwarded (detected from the Subject part)
427
427
  if (forwarded === true) {
428
- // Second method: split via the Form part (New Outlook 2019)
428
+ // Second method: split via the Form part (New Outlook 2019, \
429
+ // Outlook Live / 365)
429
430
  _match = loopRegexes(this.__regexes.original_from, _body, "split");
430
431
 
431
432
  if (_match && _match.length > 3) {
432
- // The From has been detached by `split`, attach it back
433
+ // The From has been detached by the `split` operation, attach it back
433
434
  var _email = _match[1] + _match[_match.length - 1];
434
435
 
435
436
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-forward-parser",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Parses forwarded emails and extract content",
5
5
  "author": "Eliott Vincent <eliott@crisp.chat>",
6
6
  "main": "lib/index.js",