[commandbox 1.0] Cannot setup a mail server in Railo for commandbox 1.0

Hi Guys,

Is anyone using a mail server with Railo and commandbox.

I always get this error.

SHA1 digest error for javax/mail/Authenticator.class

Here is the full stack trace.

SHA1 digest error for javax/mail/Authenticator.class
	at sun.security.util.ManifestEntryVerifier.verify(Unknown Source):-1
	at java.util.jar.JarVerifier.processEntry(Unknown Source):-1
	at java.util.jar.JarVerifier.update(Unknown Source):-1
	at java.util.jar.JarVerifier$VerifierStream.read(Unknown Source):-1
	at sun.misc.Resource.getBytes(Unknown Source):-1
	at java.net.URLClassLoader.defineClass(Unknown Source):-1
	at java.net.URLClassLoader.access$100(Unknown Source):-1
	at java.net.URLClassLoader$1.run(Unknown Source):-1
	at java.net.URLClassLoader$1.run(Unknown Source):-1
	at java.security.AccessController.doPrivileged(Native Method):-2
	at java.net.URLClassLoader.findClass(Unknown Source):-1
	at java.lang.ClassLoader.loadClass(Unknown Source):-1
	at java.lang.ClassLoader.loadClass(Unknown Source):-1
	at railo.loader.classloader.RailoClassLoader.loadClass(RailoClassLoader.java:155):155
	at railo.loader.classloader.RailoClassLoader.loadClass(RailoClassLoader.java:120):120
	at railo.runtime.tag.Mail.

Hmm, Googling that error, it seems to be related to loading signed Jar files. I wonder if the custom classing loading going on is messing with it. To clarify George, this is the Railo admin for an embedded server instance? Can you give us more details such as the kind of security in use, and what authentication options you have enabled?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad, this is an embedded Railo Admin for commandbox. I am running the latest version of commanbox. No special security. I have also tried on email acounts where I know the connect works on other server. I have read those post also. Particularly this one. What does this messaging exception mean: javax.mail.NoSuchProviderException:   No provider for Address type: rfc822 I am running a Weblogic on a Sun...

I am running the free hmail client. I ran a test to confirm that I am connecting properly. I am going to look for two mail.jar files. Where do I look for this class path that they are referring to in Railo?

Test: Collect server details
hMailServer version: hMailServer 5.5.2-B2129
Database type: MSSQL Compact

Test: Test IPv6
IPv6 support is available in operating system.

Test: Test outbound port
SMTP relayer not in use. Attempting mail.hmailserver.com:25
Trying to connect to host mail.hmailserver.com
Trying to connect to TCP/IP address 46.163.109.39 on port 25.
Received: 220 mail.hmailserver.com ESMTP.
Connected successfully.

Test: Test backup directory
Backup directory C:\mailbackup is writable.

Test: Test message file locations
Relative message paths are stored in the database for all messages.

Test: Test IP range configuration
No problems were found in the IP range configuration.

Brad, I looked at this post and this seemed interesting. https://community.oracle.com/thread/1590410?start=0

I decided to do search for javax.mail.* and it returned this see attachment. I also did a search for mail.jar and only found that in the ColdFusion11 directory. Going to stop all of the ACF services set them to manaul and try a server restart.

Thanks,

George Murphy

Hi stopped all ACF services and set them to disabled and rebooted the server and that did not work either.

Back to the drawing board.

I wouldn’t expect that to make any difference. The ColdFusion services are running in a completely separate process and have no bearing on CommandBox. The only way another CF install could interfere with the embedded server is if it tried to bind to the same port.

Let’s go back to my earlier question-- can you give us steps to reproduce this? Once we can do that, we can hit up the Railo folk and ask them. It may turn out to be a missing jar in the embedded server or a class that undertow (the servlet container) doesn’t have.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

Please be specific about what you need and where I should get it and I will be happy to. I am going to try outside of this VM on something that has a lot less permissions set than Windows 2012. I am going to go done to a VM running Windows 2003.

Thanks,

George Murphy

George, I tried setting up an SMTP server on the CommandBox embedded server and got the same error. I think Undertow doesn’t come with the javax.mail classes like other servlet containers do.

I dropped the attached jar in my /.CommandBox/lib folder, stopped, and restarted the embdedded server. The security error went away, but I still couldn’t get the Railo admin to verify my mail server. Then again, I can’t get my regular Railo install to verify the same server either, so that might just be me using the wrong port or something.

Try this jar file and see what kind of mileage it gets you.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

javax.mail.jar (425 KB)

Hi Brad, that missing jar was the problem for sure. I was able to get this working. Before you sent the jar. I tried on windows 2003,2008 and 2012. All gave the same error.

I was able to get it running on windows 2003 with java version “1.8.0_25”.

Here are my settings that got this working.

Server (smtp) = smtp.gmail.com, Username = yourgmailusername@gmail.com, Password=mygmailemailaccountpassword, port=587, tls=true(checked), ssl=false(not checked).

Now the question is can we have Railo add that jar to this build? It is extremely useful when you want to check emails in business applications. Brad, thanks for your help.

George Murphy

Thanks for the update, George. I have created COMMANDBOX-117 to include that jar as part of the CommandBox libs.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad, thanks for setting that up. The commands for connecting to Google work. However, the mail was never sent.

I am getting this error message. Something else is missing. It is working fine on the Railo production server but not the commandbox server.

“Severity”,“ThreadID”,“Date”,“Time”,“Application”,“Message”
“ERROR”,“Thread-65”,“11/11/2014”,“23:19:14”,"","mail;530 5.7.0 Must issue a STARTTLS command first. r9sm8820762qay.6 - gsmtp
;530 5.7.0 Must issue a STARTTLS command first. r9sm8820762qay.6 - gsmtp

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1668):1668
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1207):1207
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:735):735
at railo.runtime.net.smtp.SMTPSender.run(SMTPSender.java:41):41
"
“ERROR”,“Thread-66”,“11/11/2014”,“23:19:15”,"","mail;530 5.7.0 Must issue a STARTTLS command first. r9sm8820762qay.6 - gsmtp
;530 5.7.0 Must issue a STARTTLS command first. r9sm8820762qay.6 - gsmtp

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1668):1668
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1207):1207
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:735):735
at railo.runtime.net.smtp.SMTPSender.run(SMTPSender.java:41):41
"

That jar which I downloaded of the internet might not be a compatible version with Railo. It looks like a grabbed an older version (1.4.2). Here is the main download page from Oracle.

http://www.oracle.com/technetwork/java/index-138643.html

Try snagging a fresh version of 1.4.7 from the page and see if it makes any difference.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad, I downloaded that package. The jar that you sent me originally was named javax.mail.jar
There is no javax.mail.jar. There is only mail.jar.

I will pull the javax.mail.jar out of the lib folder and put the mail.jar.

Are there other files I should put in lib besides mail.jar.

I am still getting this.

“ERROR”,“Thread-48”,“11/12/2014”,“06:51:17”,"","mail;530 5.7.0 Must issue a STARTTLS command first. v4sm20850126qay.3 - gsmtp
;530 5.7.0 Must issue a STARTTLS command first. v4sm20850126qay.3 - gsmtp

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2108):2108
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1609):1609
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1117):1117
at railo.runtime.net.smtp.SMTPSender.run(SMTPSender.java:41):41

Thanks or testing that. I think we’ll need to start a thread on the Railo list and ask them what version of JavaMail Railo needs to have, and confirm if it was left out of the Railo CLI jars on purpose. Do you mind starting that thread, George? Also, we might want to move this conversation to our CommandBox Google group so we stop spamming the ColdBox list with CommandBox’s awesomeness :slight_smile:

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

I can certainly start the thread at Railo. Is moving the thread from ColdBox to CommandBox simply a matter of starting to post there?

Thanks,

George Murphy

Yes, there no real way to ‘move’ a thread, so just basically start a new one there.

I actually just mentioned the mail thing in an E-mail to Micha, but feel free to post on the Railo list as well.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

Here is the link to the thread that I have started on Railo.
https://groups.google.com/forum/#!topic/railo/LSDod_2If7s

Thanks,

George Murphy

Awesomeness needs to spread!!!