Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enhancement: Add support for fixing MessageID #5

Closed
bbottema opened this issue Jun 7, 2023 · 0 comments
Closed

Enhancement: Add support for fixing MessageID #5

bbottema opened this issue Jun 7, 2023 · 0 comments
Milestone

Comments

@bbottema
Copy link
Member

bbottema commented Jun 7, 2023

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);
        }
    }
bbottema added a commit that referenced this issue Jun 7, 2023
@bbottema bbottema changed the title Add support for fixing MessageID Enhancement: Add support for fixing MessageID Jun 7, 2023
@bbottema bbottema added this to the 2.1.1 milestone Jun 7, 2023
@bbottema bbottema closed this as completed Jun 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant