Index: /src/com/ecyrd/jspwiki/util/MailUtil.java =================================================================== --- /src/com/ecyrd/jspwiki/util/MailUtil.java (working copy) +++ /src/com/ecyrd/jspwiki/util/MailUtil.java (working copy) @@ -211,7 +211,9 @@ protected static final String DEFAULT_MAIL_PORT = "25"; protected static final String DEFAULT_MAIL_TIMEOUT = "5000"; - + + protected static final String DEFAULT_MAIL_CONN_TIMEOUT = "5000"; + protected static final String DEFAULT_SENDER = "jspwiki@localhost"; protected static final String PROP_MAIL_JNDI_NAME = "jspwiki.mail.jndiname"; @@ -385,6 +387,8 @@ String port = props.getProperty( PROP_MAIL_PORT, DEFAULT_MAIL_PORT ); String account = props.getProperty( PROP_MAIL_ACCOUNT ); String password = props.getProperty( PROP_MAIL_PASSWORD ); + String timeout = props.getProperty( PROP_MAIL_TIMEOUT, DEFAULT_MAIL_TIMEOUT); + String conntimeout = props.getProperty( PROP_MAIL_CONNECTION_TIMEOUT, DEFAULT_MAIL_CONN_TIMEOUT ); boolean starttls = TextUtil.getBooleanProperty( props, PROP_MAIL_STARTTLS, true); boolean useAuthentication = account != null && account.length() > 0; @@ -394,8 +398,8 @@ // Set JavaMail properties mailProps.put( PROP_MAIL_HOST, host ); mailProps.put( PROP_MAIL_PORT, port ); - mailProps.put( PROP_MAIL_TIMEOUT, DEFAULT_MAIL_TIMEOUT ); - mailProps.put( PROP_MAIL_CONNECTION_TIMEOUT, DEFAULT_MAIL_TIMEOUT ); + mailProps.put( PROP_MAIL_TIMEOUT, timeout ); + mailProps.put( PROP_MAIL_CONNECTION_TIMEOUT, conntimeout ); mailProps.put( PROP_MAIL_STARTTLS, starttls ? TRUE : FALSE ); // Add SMTP authentication if required @@ -414,7 +418,9 @@ if ( log.isDebugEnabled() ) { - String mailServer = host + ":" + port + ", auth=" + ( useAuthentication ? TRUE : FALSE ); + String mailServer = host + ":" + port + ", account=" + account + ", password not displayed, timeout=" + + timeout + ", connectiontimeout=" + conntimeout + ", starttls.enable=" + starttls + + ", use authentication=" + ( useAuthentication ? TRUE : FALSE ); log.debug( "JavaMail session obtained from standalone mail factory: " + mailServer ); } return session;