@@ -35,11 +35,13 @@ var ERROR_CODES_TYPES = {
35
35
"550 5.1.1" : "no_such_recipient" ,
36
36
"550 5.2.1" : "recipient_disabled_or_recipient_rate_limited" ,
37
37
"550 5.7.1" : "spam_content" ,
38
+ "550 5.7.26" : "authentication_failure" ,
38
39
"551" : "user_not_local" ,
39
40
"552" : "action_aborted_exceeded_storage_allocation" ,
40
41
"552 5.2.2" : "mailbox_over_quota" ,
41
42
"552 5.2.3" : "message_size_limit" ,
42
43
"553" : "action_not_taken_mailbox_name_not_allowed" ,
44
+ "553 5.1.2" : "no_such_recipient" ,
43
45
"554" : "transaction_failed" ,
44
46
"554 5.7.1" : "spam_content" ,
45
47
"555" : "parameters_not_recognized" ,
@@ -78,19 +80,20 @@ var REGEXES = {
78
80
/ M e s s a g e r e j e c t e d b y \: \s + ( [ \S \. ] + ?) $ / m, // Outlook error
79
81
/ f r o m ( \S + ) \[ ( [ \d \. ] + ) \] (?: \: ( \d + ) \: ) ? / m,
80
82
/ c o n v e r s a t i o n w i t h ( \S + ) \[ ( [ \d \. ] + ) \] (?: \: ( \d + ) \: ) ? t i m e d o u t / m,
83
+ / l o s t c o n n e c t i o n w i t h ( \S + ) \[ ( [ \d \. ] + ) \] (?: \: ( \d + ) \: ) ? / m, // "lost connection with mx.mail-data.net[134.244.220.69]"
81
84
/ G e n e r a t i n g s e r v e r : ( \S + ) (?: \[ ( [ \d \. ] + ) \] ) ? (?: \: ( \d + ) \: ) ? / m // "Generating server: PH7PR02MB9549495.namprd02.prod.outlook.com"
82
85
] ,
83
86
84
87
error : [
85
- / s a i d \: ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) \( i n r e p l y t o / ,
86
- / s a i d \: ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) - ( .+ ) / ,
88
+ / s a i d \: ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) \( i n r e p l y t o / ,
89
+ / s a i d \: ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) - ( .+ ) / ,
87
90
/ ( \d { 3 } \- \' \d \. \d \. \d { 1 , 3 } ) ( .+ ) / ,
88
- / L M T P e r r o r a f t e r .+ ?\: \< .+ ?\> \: ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) < .+ ?\> ( .+ ) $ / m,
89
- / r e m o t e s e r v e r r e t u r n e d \' ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) \' / i,
90
- / T h e r e s p o n s e f r o m t h e r e m o t e s e r v e r w a s : \s ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / ,
91
- / r e f u s e d t o t a l k t o m e \: ( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / ,
92
- / (?: e r r o r | r e a s o n ) \: \s * ?( \d { 3 } (?: [ \s \- ] \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / i,
93
- / ( \d { 3 } [ \s \- ] \d \. \d \. \d { 1 , 3 } ) / ,
91
+ / L M T P e r r o r a f t e r .+ ?\: \< .+ ?\> \: ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) < .+ ?\> ( .+ ) $ / m,
92
+ / r e m o t e s e r v e r r e t u r n e d \' ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) \' / i,
93
+ / T h e r e s p o n s e f r o m t h e r e m o t e s e r v e r w a s : \s ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / ,
94
+ / r e f u s e d t o t a l k t o m e \: ( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / ,
95
+ / (?: e r r o r | r e a s o n ) \: \s * ?( \d { 3 } (?: [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) ? ) ( .+ ) / i,
96
+ / ( \d { 3 } [ \s \- \# \' ] { 1 , 2 } \d \. \d \. \d { 1 , 3 } ) / ,
94
97
/ ( \d { 3 } \- \' \d \. \d \. \d { 1 , 3 } ) /
95
98
] ,
96
99
@@ -110,7 +113,7 @@ var REGEXES = {
110
113
111
114
recipient : [
112
115
/ t h e f o l l o w i n g a d d r e s s e s h a d p e r m a n e n t f a t a l e r r o r s (?: .* ?) \s \< ( .+ ?) \> / i,
113
- / t h e r e w a s a t e m p o r a r y p r o b l e m d e l i v e r i n g y o u r m e s s a g e t o ( .+ ?) . G m a i l w i l l r e t r y / i,
116
+ / t h e r e w a s a t e m p o r a r y p r o b l e m (?: w h i l e ) ? d e l i v e r i n g y o u r m e s s a g e t o ( .+ ?) . G m a i l w i l l r e t r y / i,
114
117
/ t h e f o l l o w i n g m e s s a g e t o \< ( .+ ?) \> w a s u n d e l i v e r a b l e / i,
115
118
/ t o t h e f o l l o w i n g a d d r e s s e s : \s * ( .+ ) / i,
116
119
/ ^ y o u r m e s s a g e w a s n ' t d e l i v e r e d t o ( .+ ?) \s / mi, // "Your message wasn't delivered to [email protected] "
@@ -122,8 +125,8 @@ var REGEXES = {
122
125
] ,
123
126
124
127
temporary_safe : / ( t e m p o r a r y | t e m p o r a r i l y ) / i,
125
- blocked : / ( (?: i s l i s t e d ) | b l o c k e d | b a n n e d | d e n i e d | d n s b l ) / i,
126
- spam : / ( s p a m ) / i,
128
+ blocked : / ( (?: i s l i s t e d ) | b l o c k e d | b l o c k l i s t | b a n n e d | d e n i e d | d n s b l ) / i,
129
+ spam : / ( s p a m | u n s o l i c i t e d ) / i,
127
130
128
131
enhanced_types : {
129
132
no_such_recipient : [
@@ -150,13 +153,13 @@ var REGEXES = {
150
153
] ,
151
154
152
155
reputation : [
153
- / ( r a t e l i m i t e d d u e t o I P r e p u t a t i o n ) / i
156
+ / ( r a t e l i m i t e d d u e t o I P r e p u t a t i o n ) / i,
157
+ / ( n e w o r u n t r u s t e d I P ) / i
154
158
]
155
159
} ,
156
160
157
161
error_code : [
158
- / ( \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"
159
- / ( \d { 3 } ) \- \' ( \d \. \d \. \d { 1 , 3 } ) / , // "550-'5.4.1" or "550-'5.4.11" or "550-'5.4.110"
162
+ / ( \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"
160
163
/ ( \d { 3 } ) / // "550"
161
164
]
162
165
} ;
@@ -552,6 +555,7 @@ class Parser {
552
555
_str = _str . replace ( this . __regexes . line_break_double_indent_single , "\n\n" ) ;
553
556
554
557
// Replace single Line-break with regular space
558
+ // TODO: re2 doesn't support lookbehinds, so for now we use a pure-JS regex
555
559
_str = _str . replace ( / (?< ! \n ) \n (? ! \n ) / gm, " " ) ;
556
560
557
561
// Replace long indent with double Line-break
0 commit comments