email-bounce-parser 1.0.17 → 1.0.18
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/README.md +4 -2
- package/lib/parser.js +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ console.log(result);
|
|
|
53
53
|
// email: {
|
|
54
54
|
// body: "This is the mail system at host mailer.acme.email [...] (in reply to RCPT TO command)",
|
|
55
55
|
// intro: "This is the mail system at host mailer.acme.email [...] The mail system",
|
|
56
|
-
// error: "<
|
|
56
|
+
// error: "<john@yipee.com>: host smtp.secureserver.net[92.240.81.0] said: [...] (in reply to RCPT TO command)"
|
|
57
57
|
// },
|
|
58
58
|
//
|
|
59
59
|
// data: {
|
|
@@ -62,7 +62,7 @@ console.log(result);
|
|
|
62
62
|
// basic: "550",
|
|
63
63
|
// enhanced: "5.1.1"
|
|
64
64
|
// },
|
|
65
|
-
// label: "<
|
|
65
|
+
// label: "<john@yipee.com> Recipient not found.",
|
|
66
66
|
//
|
|
67
67
|
// type: "action_not_taken",
|
|
68
68
|
//
|
|
@@ -76,6 +76,8 @@ console.log(result);
|
|
|
76
76
|
// }
|
|
77
77
|
// },
|
|
78
78
|
//
|
|
79
|
+
// recipient: "john@yipee.com",
|
|
80
|
+
//
|
|
79
81
|
// server: {
|
|
80
82
|
// hostname: "smtp.secureserver.net",
|
|
81
83
|
// ip: "92.240.81.0",
|
package/lib/parser.js
CHANGED
|
@@ -82,16 +82,16 @@ var REGEXES = {
|
|
|
82
82
|
],
|
|
83
83
|
|
|
84
84
|
error : [
|
|
85
|
-
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d
|
|
86
|
-
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d
|
|
87
|
-
/(\d{3}\-\'\d\.\d\.\d
|
|
88
|
-
/LMTP error after .+?\:\<.+?\>\: (\d{3}(?:[\s\-]\d\.\d\.\d
|
|
89
|
-
/remote server returned \'(\d{3}(?:[\s\-]\d\.\d\.\d
|
|
90
|
-
/The response from the remote server was:\s(\d{3}(?:[\s\-]\d\.\d\.\d
|
|
91
|
-
/refused to talk to me\: (\d{3}(?:[\s\-]\d\.\d\.\d
|
|
92
|
-
/(?:error|reason)\:\s*?(\d{3}(?:[\s\-]\d\.\d\.\d
|
|
93
|
-
/(\d{3}[\s\-]\d\.\d\.\d
|
|
94
|
-
/(\d{3}\-\'\d\.\d\.\d
|
|
85
|
+
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+) \(in reply to/,
|
|
86
|
+
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?)-(.+)/,
|
|
87
|
+
/(\d{3}\-\'\d\.\d\.\d{1,3}) (.+)/,
|
|
88
|
+
/LMTP error after .+?\:\<.+?\>\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) <.+?\>(.+)$/m,
|
|
89
|
+
/remote server returned \'(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)\'/i,
|
|
90
|
+
/The response from the remote server was:\s(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/,
|
|
91
|
+
/refused to talk to me\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/,
|
|
92
|
+
/(?:error|reason)\:\s*?(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/i,
|
|
93
|
+
/(\d{3}[\s\-]\d\.\d\.\d{1,3})/,
|
|
94
|
+
/(\d{3}\-\'\d\.\d\.\d{1,3})/
|
|
95
95
|
],
|
|
96
96
|
|
|
97
97
|
error_lax : [
|
|
@@ -113,7 +113,7 @@ var REGEXES = {
|
|
|
113
113
|
/the following message to \<(.+?)\> was undeliverable/i,
|
|
114
114
|
/to the following addresses:\s*(.+)/i,
|
|
115
115
|
/^\<(.+?)\>:/m,
|
|
116
|
-
/^(.+?)\s?\n?\s*[\[|<]mailto\:(.+?)[\]|>]/mi, // "john@acme.com<mailto:john@acme.com>"
|
|
116
|
+
/^(.+?)\s?(?:\s\(.*?\))?\n?\s*[\[|<]mailto\:(.+?)[\]|>]/mi, // "john@acme.com<mailto:john@acme.com>" or "john@acme.com[mailto:john@acme.com]" or "john@acme.com (john@acme.com)<mailto:john@acme.com>"
|
|
117
117
|
/^your message wasn't delivered to (.+?)\s/mi, // "Your message wasn't delivered to john@acme.com"
|
|
118
118
|
/^your message to (.+?) couldn\'t/mi, // "Your message to john@acme.com couldn't"
|
|
119
119
|
/\<(.+?)\> \(expanded from \<.+?\>\)\:/, // "<john@acme.com> (expanded from <john@digiflex.com>): "
|
|
@@ -135,7 +135,7 @@ var REGEXES = {
|
|
|
135
135
|
|
|
136
136
|
enhanced_types_server_unknown : [
|
|
137
137
|
/(does not accept mail)/i,
|
|
138
|
-
/(domain name not
|
|
138
|
+
/(domain (?:name\s+)?(?:\S+\s)?(?:not found|does not exist))/i, // "domain does not exist" or "domain name does not exist" or "domain acme.com does not exist" or "domain name acme.com does not exist"
|
|
139
139
|
/(no route to host)/i
|
|
140
140
|
],
|
|
141
141
|
|
|
@@ -148,8 +148,8 @@ var REGEXES = {
|
|
|
148
148
|
],
|
|
149
149
|
|
|
150
150
|
error_code : [
|
|
151
|
-
/(\d{3})[\s\-](\d\.\d\.\d
|
|
152
|
-
/(\d{3})\-\'(\d\.\d\.\d
|
|
151
|
+
/(\d{3})[\s\-](\d\.\d\.\d{1,3})/, // "550 5.4.1" or "550-5.4.1" or "550-5.4.11" or "550-5.4.110"
|
|
152
|
+
/(\d{3})\-\'(\d\.\d\.\d{1,3})/, // "550-'5.4.1" or "550-'5.4.11" or "550-'5.4.110"
|
|
153
153
|
/(\d{3})/ // "550"
|
|
154
154
|
]
|
|
155
155
|
};
|