https://bz.apache.org/bugzilla/show_bug.cgi?id=59661
Bug ID: 59661
Summary: MailSessionFactory ignores system properties
Product: Tomcat 9
Version: 9.0.0.M6
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
When the MailSessionFactory
(https://github.com/apache/tomcat/blob/bbcad7fcc71e46952174b41eaef6ebcf45af9185/java/org/apache/naming/factory/MailSessionFactory.java)
constructs the properties for the mail session, Properties does not receive
System#getProperties().
We'd like to override mail.smtp.host (not localhost) and mail.smtp.localhost
(OS issue) in setenv.sh passing to CATALINA_OPTS but unable to do so because it
is not picked up.
This applies to all Tomcat versions.
SMTPTransport uses PropUtil for a few properties by default from
System#getProperties() but not for all (shortcoming?). Additionally, Transport
does
> Session s = (msg.session != null) ? msg.session :
> Session.getDefaultInstance(System.getProperties(), null);
which is different to the config done in Tomcat. There must be a better way to
support this.
Alternatively, one must add those options to every context.xml, add to
server.xml and work with resource links, or don't use the factory at all and
let the code snippet from above make its work.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]