JAMES-3842 Access SSLSession from Hooks and Handlers #1274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
James supports SMTPS and StartTLS, but currently has no way to programmatically access the resulting SSLSession from SMTP Hooks, POP3 Command Handlers etc. I propose to make the SSLSession accessible through the ProtocolSession.
This way, hooks/handlers can examine the SSL/TLS parameters negotiated with the currently connected client. They can check e.g. TLS version and selected cipher suite to evaluate the security level of the connection. With certificate based client authentication enabled, they can get the provided client certificate, e.g. to check against a permission list. Or a JamesMessageHook could attach it to the Mail object, so this information becomes even available to Mailets after spooling.