email-bounce-parser 1.0.8 → 1.0.10

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 +23 -2
  2. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -78,11 +78,20 @@ var REGEXES = {
78
78
  spam : /(spam)/i,
79
79
 
80
80
  enhanced_types_no_such_recipient : [
81
- /((?:invalid mailbox))/i,
82
- /((?:do(e)?sn\'t exist))/i, // Some Chinese SMTP return "dosn't" instead of "doesn't"
81
+ /(recipient address rejected: access denied)/i, // Outlook DBEB for invalid addresses
82
+ /(invalid mailbox)/i,
83
+ /(do(e)?sn\'t exist)/i, // Some Chinese SMTP return "dosn't" instead of "doesn't"
83
84
  /(account|user|mailbox) (is )?(terminated|disabled|not found|unavailable|invalid)/i
84
85
  ],
85
86
 
87
+ enhanced_types_server_unknown : [
88
+ /(does not accept mail)/i
89
+ ],
90
+
91
+ enhanced_types_server_timeout : [
92
+ /(timeout|timed[\s\-]out)/i
93
+ ],
94
+
86
95
  error_code : [
87
96
  /(\d{3})[\s\-](\d\.\d\.\d)/,
88
97
  /(\d{3})/
@@ -317,6 +326,18 @@ class Parser {
317
326
  if (_match && _match.length > 1) {
318
327
  _type = "no_such_recipient";
319
328
  }
329
+
330
+ _match = loopRegexes(this.__regexes.enhanced_types_server_unknown, str);
331
+
332
+ if (_match && _match.length > 1) {
333
+ _type = "server_unknown";
334
+ }
335
+
336
+ _match = loopRegexes(this.__regexes.enhanced_types_server_timeout, str);
337
+
338
+ if (_match && _match.length > 1) {
339
+ _type = "server_timeout";
340
+ }
320
341
  }
321
342
  }
322
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-bounce-parser",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Parses bounce emails and extract errors",
5
5
  "author": "Eliott Vincent <eliott@crisp.chat>",
6
6
  "main": "lib/index.js",