MailBounceDetector icon indicating copy to clipboard operation
MailBounceDetector copied to clipboard

Parsing extended status codes

Open p231970 opened this issue 8 years ago • 0 comments

I got extended delivery status code which crashes detector. Action: failed Status: 5.7.133 Diagnostic-Code: smtp;550 5.7.133 RESOLVER.RST.SenderNotAuthenticatedForGroup; authentication required; Delivery restriction check failed because the sender was not authenticated when sending to this group

I propose this to fix an issue:

    private static BounceStatus ParseBounceStatus(string statusCode, IDictionary<int, string> statusCodes)
    {
        var value = int.Parse(statusCode);
        if (statusCodes.ContainsKey(value))
            return new BounceStatus(value, statusCodes[value]);
        else
            return new BounceStatus(value, "");
    }

p231970 avatar Jan 30 '17 13:01 p231970