email-bounce-parser 1.0.9 → 1.0.11

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 +35 -5
  2. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -44,7 +44,7 @@ var REGEXES = {
44
44
  ],
45
45
 
46
46
  email_server : [
47
- /host (\S+)\[([\d\.]+)\](?:\:(\d+)\:)? said/m,
47
+ /host (\S+)\[([\d\.]+)\](?:\:(\d+)\:)? (?:said|refused to talk)/m,
48
48
  /\: connect to (.+)\[(.+)\](?:\:(\d+)\:)?/m,
49
49
  /Name service error for name\=(\S+)\s/m,
50
50
  /RCPT TO\:\<(.+?)\>/m,
@@ -78,10 +78,22 @@ var REGEXES = {
78
78
  spam : /(spam)/i,
79
79
 
80
80
  enhanced_types_no_such_recipient : [
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"
84
- /(account|user|mailbox) (is )?(terminated|disabled|not found|unavailable|invalid)/i
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"
84
+ /((?:account|user|mailbox) (?:is )?(?:terminated|disabled|not found|unavailable|invalid))/i
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
+
95
+ enhanced_types_mailbox_full : [
96
+ /(out of storage|(?:mailbox (?:is )?full)|(?:user (?:is )?over quota))/i
85
97
  ],
86
98
 
87
99
  error_code : [
@@ -318,6 +330,24 @@ class Parser {
318
330
  if (_match && _match.length > 1) {
319
331
  _type = "no_such_recipient";
320
332
  }
333
+
334
+ _match = loopRegexes(this.__regexes.enhanced_types_server_unknown, str);
335
+
336
+ if (!_type && _match && _match.length > 1) {
337
+ _type = "server_unknown";
338
+ }
339
+
340
+ _match = loopRegexes(this.__regexes.enhanced_types_server_timeout, str);
341
+
342
+ if (!_type && _match && _match.length > 1) {
343
+ _type = "server_timeout";
344
+ }
345
+
346
+ _match = loopRegexes(this.__regexes.enhanced_types_mailbox_full, str);
347
+
348
+ if (!_type && _match && _match.length > 1) {
349
+ _type = "mailbox_full";
350
+ }
321
351
  }
322
352
  }
323
353
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-bounce-parser",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Parses bounce emails and extract errors",
5
5
  "author": "Eliott Vincent <eliott@crisp.chat>",
6
6
  "main": "lib/index.js",