Record[] records = lookup.run();
switch (lookup.getResult()) {
case Lookup.SUCCESSFUL:
return records;
case Lookup.TYPE_NOT_FOUND:
throw new SendException("Host " + name + " has no address record ("
+ lookup.getErrorString() + ")",
EnhancedStatus.PERMANENT_UNABLE_TO_ROUTE, remoteMta);
case Lookup.HOST_NOT_FOUND:
throw new SendException("Host " + name + " is not found ("
+ lookup.getErrorString() + ")",
EnhancedStatus.PERMANENT_UNABLE_TO_ROUTE, remoteMta);
case Lookup.TRY_AGAIN:
throw new SendException(
"DNS network failure while looking up address of " + name
+ ": " + lookup.getErrorString(),
EnhancedStatus.TRANSIENT_DIRECTORY_SERVER_FAILURE,
remoteMta);
case Lookup.UNRECOVERABLE:
throw new SendException(
"Unrecoverable DNS error while looking up address of "
+ name + ": " + lookup.getErrorString(),
EnhancedStatus.PERMANENT_UNABLE_TO_ROUTE, remoteMta);
default:
throw new SendException(
"Unknown DNS status while looking up address of " + name
+ ": " + lookup.getResult() + ". "
+ lookup.getErrorString(),
EnhancedStatus.PERMANENT_INTERNAL_ERROR, remoteMta);
}