smtpServer.setPort(8025);
smtpServer.start();
}
private Filters createFilters() {
Filters filters = new Filters();
ClientFactory client = new ClientFactory();
client.setHelo("relay.localdomain");
BackendServer backendServer = new BackendServer();
backendServer.setHost("localhost");
backendServer.setPort(8026);
backendServer.setClientFactory(client);
RelayDestination relayDestination = new RelayDestination();
relayDestination.setBackendServer(backendServer);
RecipientSpecificationDestinationPair recipientDestinationMapper =
new RecipientSpecificationDestinationPair();
recipientDestinationMapper
.addRecipientSpecification(new RecipientSpecificationFactory()
.create(ExampleAddress.JANE));
recipientDestinationMapper.setDestination(relayDestination);
LookupDestinationFilter lookupDestinationFilter = new LookupDestinationFilter();
lookupDestinationFilter
.setRecipientDestinationMapper(recipientDestinationMapper);
filters.addFilter(lookupDestinationFilter);
filters.addFilter(new AcceptAllRecipient());
DestinationProcessorFilter destinationProcessFilter =
new DestinationProcessorFilter();
filters.addFilter(destinationProcessFilter);
return filters;
}