class JmapMDN {

    public Message generateMDNMessage(Message originalMessage, MailboxSession mailboxSession) throws ParseException, IOException, InvalidOriginMessageForMDNException {

        Username username = mailboxSession.getUser();

        return MDN.builder()
            .report(generateReport(originalMessage, mailboxSession))
            .humanReadableText(textBody)
            .build()
        .asMime4JMessageBuilder()
            .setTo(getSenderAddress(originalMessage))
            .setFrom(username.asString())
            .setSubject(subject)
            .setDate(new Date())
            .setMessageId(MimeUtil.createUniqueMessageId(username.getDomainPart().map(Domain::name).orElse(null)))
            .build();
    }

    @VisibleForTesting  JmapMDN(MessageId messageId, String subject, String textBody, String reportingUA, MDNDisposition disposition);

}