email-bounce-parser 1.0.10 → 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.
- package/lib/parser.js +14 -4
- 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,
|
|
@@ -81,7 +81,7 @@ var REGEXES = {
|
|
|
81
81
|
/(recipient address rejected: access denied)/i, // Outlook DBEB for invalid addresses
|
|
82
82
|
/(invalid mailbox)/i,
|
|
83
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
|
|
84
|
+
/((?:account|user|mailbox) (?:is )?(?:terminated|disabled|not found|unavailable|invalid))/i
|
|
85
85
|
],
|
|
86
86
|
|
|
87
87
|
enhanced_types_server_unknown : [
|
|
@@ -92,6 +92,10 @@ var REGEXES = {
|
|
|
92
92
|
/(timeout|timed[\s\-]out)/i
|
|
93
93
|
],
|
|
94
94
|
|
|
95
|
+
enhanced_types_mailbox_full : [
|
|
96
|
+
/(out of storage|(?:mailbox (?:is )?full)|(?:user (?:is )?over quota))/i
|
|
97
|
+
],
|
|
98
|
+
|
|
95
99
|
error_code : [
|
|
96
100
|
/(\d{3})[\s\-](\d\.\d\.\d)/,
|
|
97
101
|
/(\d{3})/
|
|
@@ -329,15 +333,21 @@ class Parser {
|
|
|
329
333
|
|
|
330
334
|
_match = loopRegexes(this.__regexes.enhanced_types_server_unknown, str);
|
|
331
335
|
|
|
332
|
-
if (_match && _match.length > 1) {
|
|
336
|
+
if (!_type && _match && _match.length > 1) {
|
|
333
337
|
_type = "server_unknown";
|
|
334
338
|
}
|
|
335
339
|
|
|
336
340
|
_match = loopRegexes(this.__regexes.enhanced_types_server_timeout, str);
|
|
337
341
|
|
|
338
|
-
if (_match && _match.length > 1) {
|
|
342
|
+
if (!_type && _match && _match.length > 1) {
|
|
339
343
|
_type = "server_timeout";
|
|
340
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
|
+
}
|
|
341
351
|
}
|
|
342
352
|
}
|
|
343
353
|
|