/** * @see org.apache.james.protocols.smtp.DNSService#getSMTPHostAddresses(java.lang.String) */ public Iterator<HostAddress> getSMTPHostAddresses(String domainName) throws TemporaryResolutionException { try { return dns.getSMTPHostAddresses(domainName); } catch (org.apache.james.dnsservice.api.TemporaryResolutionException e) { throw new TemporaryResolutionException(e.getMessage()); } }
throw new TemporaryResolutionException("DNSService is temporary not reachable"); } else { return r; throw new TemporaryResolutionException("DNSService is temporary not reachable");
throw new TemporaryResolutionException("DNSService is temporary not reachable"); } else { return r; throw new TemporaryResolutionException("DNSService is temporary not reachable");
@Test public void deliverShouldReturnTemporaryFailureOnTemporaryResolutionException() throws Exception { Mail mail = FakeMail.builder().recipients(MailAddressFixture.ANY_AT_JAMES, MailAddressFixture.OTHER_AT_JAMES).build(); when(dnsHelper.retrieveHostAddressIterator(MailAddressFixture.JAMES_APACHE_ORG)).thenThrow(new TemporaryResolutionException()); ExecutionResult executionResult = testee.deliver(mail); assertThat(executionResult.getExecutionState()).isEqualTo(ExecutionResult.ExecutionState.TEMPORARY_FAILURE); }
/** * @see org.apache.james.protocols.smtp.DNSService#findMXRecords(java.lang.String) */ public Collection<String> findMXRecords(String hostname) throws TemporaryResolutionException { try { return dns.findMXRecords(hostname); } catch (org.apache.james.dnsservice.api.TemporaryResolutionException e) { throw new TemporaryResolutionException(e.getMessage()); } }