class SMTPAuthUserIs extends GenericMatcher {

    @Override
    public Collection<MailAddress> match(Mail mail) {
        return AttributeUtils
            .getValueAndCastFromMail(mail, Mail.SMTP_AUTH_USER, String.class)
            .filter(users::contains)
            .map(ignored -> mail.getRecipients())
            .orElse(null);
    }

}