class IsSenderInRRTLoop extends GenericMatcher {

    @Override
    public Collection<MailAddress> match(Mail mail) {
        try {
            if (mail.hasSender()) {
                recipientRewriteTable.getResolvedMappings(mail.getMaybeSender().get().getLocalPart(), mail.getMaybeSender().get().getDomain());
            }
        } catch (RecipientRewriteTable.TooManyMappingException e) {
            return mail.getRecipients();
        } catch (Exception e) {
            LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while executing RRT");
        }
        return ImmutableList.of();
    }

    @Inject public  IsSenderInRRTLoop(RecipientRewriteTable recipientRewriteTable);

}