}
return result;
}
private SPFResult check() {
DefaultSPF spf = new DefaultSPF(new Slf4jToJspfLoggerAdapter());
spf.setUseBestGuess(false);
// null reverse path should correspond to empty string
String fromNonNull =
mailTransaction.getFrom() == null ? "" : mailTransaction
.getFrom();
String helo = mailTransaction.getMessageContext().getHelo();
String heloNonNull =
helo == null ? "["
+ mailTransaction.getRemoteInetAddress()
.getHostAddress() + "]" : helo;
SPFResult result =
spf.checkSPF(mailTransaction.getRemoteInetAddress()
.getHostAddress(), fromNonNull, heloNonNull);
logger.debug("SPF check result: {} {}", result.getResult(), result
.getExplanation());
return result;
}