@Override public void init(Configuration config) throws ConfigurationException { setBlockSoftFail(config.getBoolean("blockSoftFail", false)); setBlockPermError(config.getBoolean("blockPermError", true)); }
public void configure(HierarchicalConfiguration handlerConfiguration) throws ConfigurationException { setBlockSoftFail(handlerConfiguration.getBoolean( "blockSoftFail", false)); setBlockPermError(handlerConfiguration.getBoolean("blockPermError", true)); }
@Test public void testSPFpermErrorRejectDisabled() throws Exception { MailAddress sender = new MailAddress("test@spf4.james.apache.org"); MailAddress rcpt = new MailAddress("test@localhost"); setupMockedSMTPSession("192.168.100.1", "spf4.james.apache.org"); SPFHandler spf = new SPFHandler(); spf.setDNSService(mockedDnsService); spf.setBlockPermError(false); assertThat(spf.doMail(mockedSMTPSession, sender).getResult()).describedAs("declined").isEqualTo(HookReturnCode.declined()); assertThat(spf.doRcpt(mockedSMTPSession, sender, rcpt).getResult()).describedAs("declined").isEqualTo(HookReturnCode.declined()); } }