Closed jmehrens closed 4 months ago
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.
@jmehrens I'll respin 2.1.3 so this gets there. Do you have anything else for 2.1.3 before I do that?
@lukasj The only things that might be worth while are a backport of:
Signed-off-by: jmehrens jason_mehrens@hotmail.com