Fixed XF\EmailBounce\Parser::getBounceTypeFromStatus does not handle statuses with multiple digits

DragonByte Tech

Well-known member
Affected version
2.3.7
Amazon SES will sometimes send a status such as 5.1.10, which will explicitly fail on this regex:
PHP:
if (!$statusCode || !preg_match('#^\d\.\d\.\d$#', $statusCode))

Suggested fix:
PHP:
if (!$statusCode || !preg_match('#^\d+\.\d+\.\d+$#', $statusCode))
 
Especially .edu email services have a tendency to use double digits, which is why bounce processing for .edu addresses often fails.
 
Here's an example (AWS SNS Topic) of a double digit status code often used by .edu providers:
Code:
"bounceType\":\"Transient\",\"bounceSubType\":\"General\",\"bouncedRecipients\":[{\"emailAddress\":\"xxx@iup.edu\",\"action\":\"failed\",\"status\":\"5.4.14\",\"diagnosticCode\":\"smtp;554 5.4.14 Hop count exceeded - possible mail loop ATTR34
.edu email has a high bounce rate due to users moving on after their study or employment. Especially on forums with an older userbase.
Often the .edu email is forwarded to another inbox, if that no longer accepts email it will send it back. Forwarding chains or loops are common in this subset of users.
Microsoft Exchange Server uses these double digit status codes and MES is often used by .edu providers.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.8).

Change log:
Email bounce parser now handles multi-digit status codes (#1240)
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom