1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 18:27:43 +00:00

Handle SMTP 2xx

This commit is contained in:
M66B 2022-09-03 17:29:53 +02:00
parent 0eeded4062
commit b6030ecd83

View file

@ -2002,13 +2002,30 @@ public class SMTPTransport extends Transport {
break;
default:
// handle remaining 4xy & 5xy codes
// handle remaining 2xy, 4xy & 5xy codes
if (retCode >= 400 && retCode <= 499) {
// assume address is valid, although we don't really know
validUnsent.add(ia);
} else if (retCode >= 500 && retCode <= 599) {
// assume address is invalid, although we don't really know
invalid.add(ia);
} else if (retCode >= 200 && retCode <= 299) {
// see RFC 5321 section 4.3.2
// assume address is valid, although we don't really know
valid.add(ia);
if (!reportSuccess)
break;
// user wants exception even when successful, including
// details of the return code
// create and chain the exception
sfex = new SMTPAddressSucceededException(ia, cmd, retCode,
lastServerResponse);
if (mex == null)
mex = sfex;
else
mex.setNextException(sfex);
} else {
// completely unexpected response, just give up
if (logger.isLoggable(Level.FINE))