Skip to content

Commit

Permalink
GreenMail ServerSetup should not set mail.<PROTOCOL>.localaddress to …
Browse files Browse the repository at this point in the history
…localhost by default (fixes #447)
  • Loading branch information
marcelmay committed Mar 4, 2022
1 parent 95bfc15 commit f1f965a
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ public void setServerStartupTimeout(long timeoutInMs) {
* <p/>
* For details see
* <ul>
* <li>http://docs.oracle.com/javaee/6/api/javax/mail/package-summary.html for some general settings</li>
* <li>https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html for valid SMTP properties.</li>
* <li>https://javamail.java.net/nonav/docs/api/com/sun/mail/imap/package-summary.html for valid IMAP properties</li>
* <li>https://javamail.java.net/nonav/docs/api/com/sun/mail/pop3/package-summary.html for valid POP3 properties.</li>
* <li>https://jakarta.ee/specifications/mail/2.0/apidocs/jakarta.mail/module-summary.html for some general settings</li>
* <li>https://jakarta.ee/specifications/mail/1.6/apidocs/index.html?com/sun/mail/smtp/package-summary.html for valid SMTP properties.</li>
* <li>https://jakarta.ee/specifications/mail/1.6/apidocs/index.html?com/sun/mail/imap/package-summary.html for valid IMAP properties</li>
* <li>https://jakarta.ee/specifications/mail/1.6/apidocs/index.html?com/sun/mail/pop3/package-summary.html for valid POP3 properties.</li>
* </ul
*
* @param properties additional and optional properties which overwrite automatically added properties. Can be null.
Expand All @@ -235,8 +235,7 @@ public Properties configureJavaMailSessionProperties(Properties properties, bool
// System.setProperty("mail.socket.debug", "true");
}

// Set local host address (makes tests much faster. If this is not set java mail always looks for the address)
props.setProperty(MAIL_DOT + getProtocol() + ".localaddress", ServerSetup.getLocalHostAddress());
// Port and host
props.setProperty(MAIL_DOT + getProtocol() + ".port", String.valueOf(getPort()));
final String address = getBindAddress();
props.setProperty(MAIL_DOT + getProtocol() + ".host", String.valueOf(address));
Expand Down

0 comments on commit f1f965a

Please sign in to comment.