I am working on a new mail user/transport agent for our web based applications. It must be able to connect to a myriad of SMTP servers for different customer situations from straight forward SMTP through ESMTP (AUTH, STARTTLS, OAUTH2). I am trying to make the code perform some checks with what is in the EHLO response and realized I do not have a means to access the MailConnection object that is established within the Transport object. I therefore cannot easily access either supportsExtension(String Name) or extensionParameter(String Name) to interrogate what the server said it supports.
Without trying to use reflection how does one provide reasonable feedback on what the server said it supported versus what the program was configured to use? Do I re-implement sendEhlo within my own code, but that is kind of stupid right?
A simple Transport.getMailConnection() method would at least allow developers the ability to access that level of information.