@Override public HookResult doRcpt(SMTPSession session, MailAddress sender, MailAddress rcpt) { if ((wNetworks == null) || (!wNetworks.matchInetNetwork(session.getRemoteAddress().getAddress().getHostAddress()))) { return super.doRcpt(session, sender, rcpt); } else { LOGGER.info("IpAddress {} is whitelisted. Skip greylisting.", session.getRemoteAddress().getAddress().getHostAddress()); } return HookResult.DECLINED; }
Iterator<String> data = getGreyListData(ipAddress, sender, recip); updateTriplet(ipAddress, sender, recip, count, time); insertTriplet(ipAddress, sender, recip, count, time); cleanupAutoWhiteListGreyList(time - autoWhiteListLifeTime); cleanupGreyList(time - unseenLifeTime);
@Override public HookResult doRcpt(SMTPSession session, MaybeSender sender, MailAddress rcpt) { if (!session.isRelayingAllowed()) { return doGreyListCheck(session, sender,rcpt); } else { LOGGER.info("IpAddress {} is allowed to send. Skip greylisting.", session.getRemoteAddress().getAddress().getHostAddress()); } return HookResult.DECLINED; } }
/** * @see org.apache.james.protocols.smtp.core.fastfail.AbstractGreylistHandler#doRcpt(org.apache.james.protocols.smtp.SMTPSession, org.apache.mailet.MailAddress, org.apache.mailet.MailAddress) */ public HookResult doRcpt(SMTPSession session, MailAddress sender, MailAddress rcpt) { if ((wNetworks == null) || (!wNetworks.matchInetNetwork(session.getRemoteIPAddress()))) { return super.doRcpt(session, sender, rcpt); } else { session.getLogger().info("IpAddress " + session.getRemoteIPAddress() + " is whitelisted. Skip greylisting."); } return new HookResult(HookReturnCode.DECLINED); }