-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:crisp-oss/email-bounce-parser
- Loading branch information
Showing
43 changed files
with
1,020 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,11 +35,13 @@ var ERROR_CODES_TYPES = { | |
"550 5.1.1" : "no_such_recipient", | ||
"550 5.2.1" : "recipient_disabled_or_recipient_rate_limited", | ||
"550 5.7.1" : "spam_content", | ||
"550 5.7.26" : "authentication_failure", | ||
"551" : "user_not_local", | ||
"552" : "action_aborted_exceeded_storage_allocation", | ||
"552 5.2.2" : "mailbox_over_quota", | ||
"552 5.2.3" : "message_size_limit", | ||
"553" : "action_not_taken_mailbox_name_not_allowed", | ||
"553 5.1.2" : "no_such_recipient", | ||
"554" : "transaction_failed", | ||
"554 5.7.1" : "spam_content", | ||
"555" : "parameters_not_recognized", | ||
|
@@ -78,19 +80,20 @@ var REGEXES = { | |
/Message rejected by\:\s+([\S\.]+?)$/m, // Outlook error | ||
/from (\S+) \[([\d\.]+)\](?:\:(\d+)\:)?/m, | ||
/conversation with (\S+)\[([\d\.]+)\](?:\:(\d+)\:)? timed out/m, | ||
/lost connection with (\S+)\[([\d\.]+)\](?:\:(\d+)\:)?/m, // "lost connection with mx.mail-data.net[134.244.220.69]" | ||
/Generating server: (\S+)(?:\[([\d\.]+)\])?(?:\:(\d+)\:)?/m // "Generating server: PH7PR02MB9549495.namprd02.prod.outlook.com" | ||
], | ||
|
||
error : [ | ||
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+) \(in reply to/, | ||
/said\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?)-(.+)/, | ||
/said\: (\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) (.+) \(in reply to/, | ||
/said\: (\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?)-(.+)/, | ||
/(\d{3}\-\'\d\.\d\.\d{1,3}) (.+)/, | ||
/LMTP error after .+?\:\<.+?\>\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) <.+?\>(.+)$/m, | ||
/remote server returned \'(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)\'/i, | ||
/The response from the remote server was:\s(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/, | ||
/refused to talk to me\: (\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/, | ||
/(?:error|reason)\:\s*?(\d{3}(?:[\s\-]\d\.\d\.\d{1,3})?) (.+)/i, | ||
/(\d{3}[\s\-]\d\.\d\.\d{1,3})/, | ||
/LMTP error after .+?\:\<.+?\>\: (\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) <.+?\>(.+)$/m, | ||
/remote server returned \'(\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) (.+)\'/i, | ||
/The response from the remote server was:\s(\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) (.+)/, | ||
/refused to talk to me\: (\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) (.+)/, | ||
/(?:error|reason)\:\s*?(\d{3}(?:[\s\-\#\']{1,2}\d\.\d\.\d{1,3})?) (.+)/i, | ||
/(\d{3}[\s\-\#\']{1,2}\d\.\d\.\d{1,3})/, | ||
/(\d{3}\-\'\d\.\d\.\d{1,3})/ | ||
], | ||
|
||
|
@@ -110,7 +113,7 @@ var REGEXES = { | |
|
||
recipient : [ | ||
/the following addresses had permanent fatal errors (?:.*?)\s\<(.+?)\>/i, | ||
/there was a temporary problem delivering your message to (.+?). Gmail will retry/i, | ||
/there was a temporary problem (?:while )?delivering your message to (.+?). Gmail will retry/i, | ||
/the following message to \<(.+?)\> was undeliverable/i, | ||
/to the following addresses:\s*(.+)/i, | ||
/^your message wasn't delivered to (.+?)\s/mi, // "Your message wasn't delivered to [email protected]" | ||
|
@@ -122,8 +125,8 @@ var REGEXES = { | |
], | ||
|
||
temporary_safe : /(temporary|temporarily)/i, | ||
blocked : /((?:is listed)|blocked|banned|denied|dnsbl)/i, | ||
spam : /(spam)/i, | ||
blocked : /((?:is listed)|blocked|block list|banned|denied|dnsbl)/i, | ||
spam : /(spam|unsolicited)/i, | ||
|
||
enhanced_types : { | ||
no_such_recipient : [ | ||
|
@@ -150,13 +153,13 @@ var REGEXES = { | |
], | ||
|
||
reputation : [ | ||
/(rate limited due to IP reputation)/i | ||
/(rate limited due to IP reputation)/i, | ||
/(new or untrusted IP)/i | ||
] | ||
}, | ||
|
||
error_code : [ | ||
/(\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" | ||
/(\d{3})\-\'(\d\.\d\.\d{1,3})/, // "550-'5.4.1" or "550-'5.4.11" or "550-'5.4.110" | ||
/(\d{3})[\s\-\#\']{1,2}(\d\.\d\.\d{1,3})/, // "550 5.4.1" or "550 #5.4.1" or "550-5.4.1" or "550-'5.4.1" | ||
/(\d{3})/ // "550" | ||
] | ||
}; | ||
|
@@ -552,6 +555,7 @@ class Parser { | |
_str = _str.replace(this.__regexes.line_break_double_indent_single, "\n\n"); | ||
|
||
// Replace single Line-break with regular space | ||
// TODO: re2 doesn't support lookbehinds, so for now we use a pure-JS regex | ||
_str = _str.replace(/(?<!\n)\n(?!\n)/gm, " "); | ||
|
||
// Replace long indent with double Line-break | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "email-bounce-parser", | ||
"version": "1.0.20", | ||
"version": "1.0.22", | ||
"description": "Parses bounce emails and extract errors", | ||
"author": "Eliott Vincent <[email protected]>", | ||
"main": "lib/index.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mta6.am0.yahoodns.net[76.159.240.37] said: 421 | ||
4.7.0 [TSS04] Messages from 39.177.48.16 temporarily deferred due to | ||
unexpected volume or user complaints - 4.16.55.1; see | ||
https://postmaster.yahooinc.com/error-codes (in reply to MAIL FROM command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host alt1.gmail-smtp-in.l.google.com[124.215.9.62] said: | ||
450-4.2.1 The user you are trying to contact is receiving mail at a rate | ||
that 450-4.2.1 prevents additional messages from being delivered. Please | ||
resend your 450-4.2.1 message at a later time. If the user is able to | ||
receive mail at that 450-4.2.1 time, your message will be delivered. For | ||
more information, please 450-4.2.1 visit 450 4.2.1 | ||
https://support.google.com/mail/?p=ReceivingRate | ||
f15-20020a056402354f00b00548d4febb0bsi965249edd.614 - gsmtp (in reply to | ||
RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mta6.am0.yahoodns.net[76.159.240.27] said: 450 User is | ||
receiving mail too quickly tnmpmscs (in reply to RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mx2.emailsrvr.com[180.166.34.2] said: 451 4.7.1 | ||
Received too many messages from a new or untrusted IP: 93.177.84.61 | ||
(Z27/6DC2420) (G28) (in reply to RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host | ||
etzzogal-com0i.mail.protection.outlook.com[140.74.42.63] said: 451 4.7.500 | ||
Server busy. Please try again later from [39.177.48.16]. (S77714) | ||
[QE2FRA04FT039.eop-fra04.prod.protection.outlook.com | ||
2023-11-23T18:53:22.058Z 10DSKD34941BC6NE] (in reply to end of DATA | ||
command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mxb.mailgun.org[43.106.31.24] said: | ||
550 5.0.1 Recipient rejected (in reply to RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mx1.hc3459-45.iphmx.com[193.183.64.148] said: | ||
550 #5.1.0 Address rejected. (in reply to RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host | ||
outlook-com.olc.protection.outlook.com[140.74.15.33] said: 550 5.7.1 | ||
Unfortunately, messages from [31.57.142.204] weren't sent. Please contact | ||
your Internet service provider since part of their network is on our block | ||
list (S3140). You can also refer your provider to | ||
http://mail.live.com/mail/troubleshooting.aspx#errors. | ||
[WP1FDK33EO054.eop-nam02.prod.protection.outlook.com | ||
2023-01-01T00:00:00.001Z 03SDKS32D1WER234] (in reply to MAIL FROM command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host | ||
gmail-smtp-in.l.google.com[124.205.72.62] said: 550-5.7.1 [93.177.87.181 | ||
19] Gmail has detected that this message is likely 550-5.7.1 suspicious due | ||
to the very low reputation of the sending domain. To 550-5.7.1 best protect | ||
our users from spam, the message has been blocked. 550-5.7.1 Please visit | ||
550 5.7.1 https://support.google.com/mail/answer/188131 for more | ||
information. h6-20020a05640250c600b0054ab00d6afesi892868edb.356 - gsmtp (in | ||
reply to end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host smtpz4.laposte.net[106.29.142.66] said: 550 5.7.1 | ||
Service refuse. Veuillez essayer plus tard. service refused, please try | ||
later. LPN007_510 (in reply to end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host aspmx.l.google.com[124.205.72.62] said: | ||
550-5.7.26 Unauthenticated email from acme.com is not accepted due to | ||
domain's 550-5.7.26 DMARC policy. Please contact the administrator of | ||
acme.com domain 550-5.7.26 if this was a legitimate mail. Please visit | ||
550-5.7.26 https://support.google.com/mail/answer/2451690 to learn about | ||
the 550 5.7.26 DMARC initiative. | ||
v10-20020a170906488a11b0098d8390816asi945962ejq.756 - gsmtp (in reply to | ||
end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mx.zoho.eu[158.203.221.166] said: 554 5.2.3 | ||
MailPolicy violation Error delivering to mailboxes (in reply to end of DATA | ||
command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host burns.eiro.biz. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host | ||
balancer_haproxy.email.locaweb.com.br[1.13.102.292] said: 554 5.4.0 Error: | ||
too many hops (in reply to end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host out41.mail.ovh.net. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mxplan3.mail.ovh.net[49.32.197.262] | ||
said: 554 5.7.105 SenderFilterAgent; Sender denied as sender's email | ||
address is on SenderFilterConfig list (in reply to end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host vero.in.mest.micro.com[81.280.22.8] | ||
said: 554 5.7.1 <[email protected]>: Recipient address rejected: | ||
BLOCK-SEND-ER. (in reply to RCPT TO command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mx01.mail.icloud.com[71.75.155.43] said: 554 | ||
5.7.1 [CS01] Message rejected due to local policy. Please visit | ||
https://support.apple.com/en-us/HT204137 (in reply to end of DATA command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
This is the mail system at host mailer.acme.email. | ||
|
||
I'm sorry to have to inform you that your message could not | ||
be delivered to one or more recipients. It's attached below. | ||
|
||
For further assistance, please send mail to postmaster. | ||
|
||
If you do so, please include this problem report. You can | ||
delete your own text from the attached returned message. | ||
|
||
The mail system | ||
|
||
<[email protected]>: host mail2.etecsa.net[118.252.213.4] said: 554 5.7.1 | ||
Service unavailable; Client host [39.177.48.171] blocked using | ||
0spam.fusionzero.com; Received: from mailer-2w.outbound.crisp.email | ||
([39.177.48.171]) Fri, 22 Sep 2023 01:01:01 +0000 Subject: Backlinking is | ||
not that crazy anymore (in reply to RCPT TO command) |
Oops, something went wrong.