Workflow notifications error

45 views
Skip to first unread message

dotCMS newB

unread,
Jun 30, 2016, 2:22:09 AM6/30/16
to dotCMS User Group
I'm testing a sample notification for workflow actions with the following config in the context.xml, with the correct user/pwd:

name="mail/MailSession" auth="Container" type="javax.mail.Session" mail.smtp.host="smtp.gmail.com" mail.smtp.port="587" mail.smtp.auth="true" mail.smtp.starttls.enable="true" mail.smtp.user="us...@gmail.com" password="password"

But I'm getting the following error:

[29/06/16 21:51:24:087 PDT] ERROR util.Mailer: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
  nested exception is:
java.net.SocketException: Permission denied: connect
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
  nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1213) ~[mail.jar:1.3.2]

I'm able to telnet to this but not able to connect through dotcms.

Jason Tesser

unread,
Jun 30, 2016, 8:28:08 AM6/30/16
to dotCMS User Group
Try using this config 

<Resource name="mail/MailSession" auth="Container" type="javax.mail.Session"
    mail.transport.protocol="smtp"
    mail.smtp.auth="true"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.port="587"
    mail.smtp.user="<username>"
    password="<password>"
    mail.smtp.from="<sender email>"
    mail.smtp.quitwait="false"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
    mail.debug="true"/>

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/fbaaa9f0-2796-4505-ac94-b4f4033b1de4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dotCMS newB

unread,
Jun 30, 2016, 12:49:25 PM6/30/16
to dotCMS User Group
Still the errors are there.

[30/06/16 09:48:04:522 PDT] ERROR util.Mailer: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
  nested exception is:
java.net.SocketException: Permission denied: connect
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
  nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1213) ~[mail.jar:1.3.2]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:311) ~[mail.jar:1.3.2]
at javax.mail.Service.connect(Service.java:255) ~[mail.jar:1.3.2]
at javax.mail.Service.connect(Service.java:134) ~[mail.jar:1.3.2]
at javax.mail.Service.connect(Service.java:86) ~[mail.jar:1.3.2]
at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144) ~[mail.jar:1.3.2]

Jason Tesser

unread,
Jun 30, 2016, 12:55:08 PM6/30/16
to dotCMS User Group

Maybe something locally work tomcat not having permissions to get out the port or something like that


John Michael Thomas

unread,
Jun 30, 2016, 12:58:50 PM6/30/16
to dotCMS User Group
It turns out we just updated the docs on this (yesterday) with a newly tested Gmail configuration.


And here's the new suggested configuration:

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

Google made some changes recently that made the previous example configuration stop working. We just tested with this new configuration this week, so please try this and see if it works better.

dotCMS newB

unread,
Jun 30, 2016, 1:38:47 PM6/30/16
to dotCMS User Group
John, 
That's what I tried with in the first place. The new config from the docs.

Jason,
Not sure about the local tomcat having permissions or not, but I'll try this on another server.

Here is some additional info from the logs if anyone can help.

DEBUG: JavaMail version 1.3.2
DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.8.0_92\jre\lib\javamail.providers (The system cannot find the file specified)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.8.0_92\jre\lib\javamail.address.map (The system cannot find the file specified)
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 587, isSSL false
Reply all
Reply to author
Forward
0 new messages