class MessageSender {

    @VisibleForTesting
    static Mail buildMail(MetaDataWithContent message, Envelope envelope) throws MessagingException {
        String name = message.getMessageId().serialize();
        return MailImpl.builder()
            .name(name)
            .sender(envelope.getFrom().asOptional().orElseThrow(() -> new RuntimeException("Sender is mandatory")))
            .addRecipients(envelope.getRecipients())
            .mimeMessage(toMimeMessage(name, message.getContent()))
            .build();
    }

    @Inject public  MessageSender(MailSpool mailSpool);

}