Fail to send emails from LabKey after upgrade to 11.2

LabKey Support Forum (Inactive)
Fail to send emails from LabKey after upgrade to 11.2 Maya Li  2011-09-16 14:30
Status: Closed
 
We recently upgraded our LabKey from 11.1 to 11.2. After the upgrade, the email service went down. Email configurations in Tomcat hasn't changed since before the upgrade. We ran an email config test from the Admin console and received the following error message:

"Your message could not be sent for the following reason(s):
failed to connect, no password specified?"

Similar message is received when the server tries to send password change notifications to users. We have tried to send emails using IE, Chrome and Firefox on both Windows and Mac machines.
 
 
Maya Li responded:  2011-09-16 14:35
We checked our configuration in the LabKey Tomcat context /data/tomcat/conf/Catalina/localhost/ROOT.xml. All the parameters are correct/unchanged.
 
adam responded:  2011-09-16 15:12
Does your configuration specify the "mail.smtp.ssl.enable" or "mail.smtp.starttls.enable" properties? We did make a minor change in 11.2 to improve support for these modes.

Adam
 
Maya Li responded:  2011-09-16 15:29
The configuration for "mail.smtp.starttls.enable" is true.
 
adam responded:  2011-09-16 15:51
So you're enabling TLS but not specifying a password? I wasn't aware that was a valid combination, but apparently it is. If you can't work around the problem (e.g., by removing the TLS setting or adding a password) then this will require a hotfix to 11.2. Sorry for the inconvenience.
 
Maya Li responded:  2011-09-16 16:19
We did set a password. :) We are not sure exactly what the cause of the problem is. Are we the only people that run into this after the upgrade.

Thanks, Adam!
 
adam responded:  2011-09-16 17:10
No one else has reported problems, but there are a lot of ways to configure SMTP and the JavaMail documentation is not at all clear on best practices to support every configuration.

Would you mind emailing me your "mail/Session" Resource from ROOT.xml? Just xxxx out any passwords first.

Thanks,
Adam
 
trent responded:  2011-09-18 17:01
Hi Maya,

I find it interesting that you didn't have problems with email sending prior to 11.2 since you use tls. (Since I was unable to get it working without the latest change, having tried various resource combinations).

This is our resource that works:

<Resource name="mail/Session" auth="Container"
       type="javax.mail.Session"
       mail.smtp.host="mail.example.com"
       mail.smtp.user="xxxxx"
       mail.smtp.password="xxxxx"
       mail.smtp.port="587"
       mail.smtp.auth="true"
       mail.smtp.starttls.enable="true"/>

 
Maya Li responded:  2011-09-19 11:34
Thanks, Trent. Our Resource definition is as follows:

<Resource name="mail/Session" auth="Container" type="javax.mail.Session" password="xxxx"       mail.debug="false"       mail.smtp.user="xxxx"       mail.smtp.host="smtp.washington.edu"       mail.smtp.auth="true"       mail.smtp.port="465"       mail.smtp.starttls.enable="true"       mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"       description="email resource"   />

Our System Admin tried the setting on a local tomcat with a new java.mail package. The setting only worked when he changed mail.smtp.user to mail.user. Unfortunately, the latter setting didn't work on the LabKey server.

This problem only seemed to have propped up after we upgraded to the new server. The setting worked for the last version.

 
Maya Li responded:  2011-09-19 15:45
Thanks to Brian. The problem has been resolved. :)
 
Brian Connolly responded:  2011-09-20 14:45
For documentation sake, I wanted to post what fixed the problem. Following @trent's recommendation and the documentation, we changed the Resource to be

<Resource name="mail/Session" auth="Container"
       type="javax.mail.Session"
       mail.debug="false"
       mail.smtp.host="smtp.washington.edu"
       mail.smtp.user="xxxxx"
       mail.smtp.password="xxxxx"
       mail.smtp.port="465"
       mail.smtp.auth="true"
       mail.smtp.starttls.enable="true"
       mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
       description="email resource"/>

After a restart of the LabKey Server, email was working.