String statusText;
if (spfResult.getExplanation().isEmpty())
statusText = "Blocked by SPF";
else
statusText = "Blocked - see: " + spfResult.getExplanation();
throw new RejectException(550, statusText);
} else if (spfResult.equals(SPFErrorConstants.TEMP_ERROR_CONV)) {
throw new RejectException(451,
"Temporarily rejected: Problem on SPF lookup");
} else if (rejectOnPermanentError
&& spfResultCode.equals(SPFErrorConstants.PERM_ERROR_CONV)) {
throw new RejectException(550, "Blocked - invalid SPF record");
}
return chain.verifyRecipient(recipientContext);
}