class AddDeliveredToHeader extends GenericMailet {

    @Override
    public void service(Mail mail) throws MessagingException {
        for (MailAddress recipient: mail.getRecipients()) {
            mail.addSpecificHeaderForRecipient(PerRecipientHeaders.Header.builder()
                .name(DELIVERED_TO)
                .value(recipient.asString())
                .build(), recipient);
        }
    }

}