Skip to content

Enhancement: Add support for fixing MessageID #5

Description

@bbottema

This library produced MimeMessage instances where the MessageId cannot be fixed. This is because when sending MimeMessage with Jakarta Mail, the ID is always overwritten by a generated one. to fix this, this class should return a subtype that overrides the ID, if given by the user, as follows:

    @Override
    protected void updateMessageID() throws MessagingException {
        if (messageId == null || messageId.length() == 0) {
            super.updateMessageID();
        } else {
            setHeader("Message-ID", messageId);
        }
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions