email-bounce-parser 1.0.13 → 1.0.15

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 +21 -17
  2. package/package.json +1 -1
package/lib/parser.js CHANGED
@@ -61,33 +61,36 @@ var REGEXES = {
61
61
  ],
62
62
 
63
63
  command : [
64
- /\(in reply to end of ([A-Z\s]+) command\)$/m, // 'end of' command
65
- /\(in reply to ([A-Z\s]+) command\)$/m, // default
66
- /timed out while sending ([A-Z\s]+)$/m, // command timed out
67
- /error after ([A-Z\s]+)/m // 'after' command
64
+ /\(in reply to end of ([A-Z\s]+) command\)$/m, // "in reply to end of DATA command"
65
+ /\(in reply to ([A-Z\s]+) command\)$/m, // "in reply to RCPT TO command"
66
+ /timed out while sending ([A-Z\s]+)$/m, // "timed out while sending (RCPT TO)", "timed out while sending RCPT TO"
67
+ /error after ([A-Z\s]+)/m, // "LMTP error after RCPT TO"
68
+ /while sending end of ([a-z\s]+)/m // "while sending end of data"
68
69
  ],
69
70
 
70
71
  email_server : [
71
72
  /host (\S+)\[([\d\.]+)\](?:\:(\d+)\:)? (?:said|refused to talk)/m,
72
73
  /^(\S+) rejected your message/m,
73
- /\: connect to (.+)\[(.+)\](?:\:(\d+)\:)?/m,
74
+ /\: connect to (.+)\[(.+)\](?:\:(\d+)\:)?/m, // "connect to acme.com[132.145.223.95]:25:"
74
75
  /Name service error for name\=(\S+)\s/m,
75
76
  /RCPT TO\:\<(.+?)\>/m,
76
77
  /Message rejected by\:\s+([\S\.]+?)$/m, // Outlook error
77
- /from (\S+) \[([\d\.]+)\](?:\:(\d+)\:)?/m
78
+ /from (\S+) \[([\d\.]+)\](?:\:(\d+)\:)?/m,
79
+ /conversation with (\S+)\[([\d\.]+)\](?:\:(\d+)\:)? timed out/m,
80
+ /Generating server: (\S+)(?:\[([\d\.]+)\])?(?:\:(\d+)\:)?/m // "Generating server: PH7PR02MB9549495.namprd02.prod.outlook.com"
78
81
  ],
79
82
 
80
83
  error : [
81
- /said\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+) \(in reply to/m,
82
- /said\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?)-(.+)/m,
83
- /(\d{3}\-\'\d\.\d\.\d\d?) (.+)/m,
84
+ /said\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+) \(in reply to/,
85
+ /said\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?)-(.+)/,
86
+ /(\d{3}\-\'\d\.\d\.\d\d?) (.+)/,
84
87
  /LMTP error after (?:.+?)\:\<.+?\>\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) <.+?\>(.+)$/m,
85
- /Remote Server returned \'(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)\'/m,
86
- /The response from the remote server was:\s(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/m,
87
- /refused to talk to me\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/m,
88
- /(?:error|reason)\:\s*?(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/mi,
89
- /(\d{3}[\s\-]\d\.\d\.\d\d?)/m,
90
- /(\d{3}\-\'\d\.\d\.\d\d?)/m
88
+ /remote server returned \'(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)\'/i,
89
+ /The response from the remote server was:\s(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/,
90
+ /refused to talk to me\: (\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/,
91
+ /(?:error|reason)\:\s*?(\d{3}(?:[\s\-]\d\.\d\.\d\d?)?) (.+)/i,
92
+ /(\d{3}[\s\-]\d\.\d\.\d\d?)/,
93
+ /(\d{3}\-\'\d\.\d\.\d\d?)/
91
94
  ],
92
95
 
93
96
  error_lax : [
@@ -111,6 +114,7 @@ var REGEXES = {
111
114
 
112
115
  enhanced_types_no_such_recipient : [
113
116
  /(recipient address rejected: access denied)/i, // Outlook DBEB for invalid addresses
117
+ /(no such (?:account|user|mailbox|recipient))/i,
114
118
  /((?:terminated|disabled|inactive|not found|unavailable|invalid) (?:account|user|mailbox|recipient))/i,
115
119
  /(do(e)?sn\'t exist)/i, // Some Chinese SMTP return "dosn't" instead of "doesn't"
116
120
  /(user (?:.+?) does not exist)/i,
@@ -126,7 +130,7 @@ var REGEXES = {
126
130
  ],
127
131
 
128
132
  enhanced_types_mailbox_full : [
129
- /(out of storage|(?:mailbox (?:is )?full)|(?:user (?:is )?over quota))/i
133
+ /(out of storage|(?:mailbox (?:is )?full)|(?:user (?:is )?over quota))/i // "user is over quota" (iCloud)
130
134
  ],
131
135
 
132
136
  error_code : [
@@ -493,7 +497,7 @@ class Parser {
493
497
  var _match = loopRegexes(this.__regexes.command, str);
494
498
 
495
499
  if (_match && _match.length > 1) {
496
- _command = _match[1];
500
+ _command = trimString(_match[1]).toUpperCase();
497
501
  }
498
502
 
499
503
  return _command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-bounce-parser",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Parses bounce emails and extract errors",
5
5
  "author": "Eliott Vincent <eliott@crisp.chat>",
6
6
  "main": "lib/index.js",