Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot parse messages without a session #710 #711

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

jmehrens
Copy link
Contributor

Signed-off-by: jmehrens jason_mehrens@hotmail.com

Signed-off-by: jmehrens jason_mehrens@hotmail.com
@jmehrens jmehrens added the bug Something isn't working label Feb 16, 2024
@jmehrens jmehrens self-assigned this Feb 16, 2024
@jmehrens jmehrens linked an issue Feb 16, 2024 that may be closed by this pull request
@jmehrens
Copy link
Contributor Author

Per @bshannon (R.I.P) on What is the use of javax.mail.Session?:

To add to that... The support for a null Session is there mostly to provide some reasonable behavior in the case where people screw up and fail to create a Session.

Classic! Point being is that null Session is allowed in MimeMessage the fallback is to use the default session when needed. The approach to this patch is to mimic the behavior in Transport.send0 which is:

Session s = (msg.session != null) ? msg.session :
                Session.getDefaultInstance(System.getProperties(), null);

The alternate patch would be to call StreamProvider.provider() in case the session is null. I think this is more consistent with what is already done.

Signed-off-by: jmehrens jason_mehrens@hotmail.com
Signed-off-by: jmehrens jason_mehrens@hotmail.com
@jmehrens jmehrens linked an issue Feb 16, 2024 that may be closed by this pull request
@lukasj lukasj merged commit aa1dc71 into jakartaee:master Feb 16, 2024
5 checks passed
@lukasj
Copy link
Contributor

lukasj commented Feb 16, 2024

@jmehrens I'll respin 2.1.3 so this gets there. Do you have anything else for 2.1.3 before I do that?

@jmehrens
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot parse messages without a session Cannot parse messages without a session
2 participants