}
@Override
public FilterReply verifyRecipient(RecipientContext recipientContext)
throws RejectExceptionExt {
SPFResult spfResult = spfChecker.getResult();
String spfResultCode = spfResult.getResult();
if (spfResultCode.equals(SPFErrorConstants.FAIL_CONV)) {
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");