Mail Task + Notifications not working in APS

cancel
Showing results for 
Search instead for 
Did you mean: 
shmalik
Active Member II

Mail Task + Notifications not working in APS

Hello,

I am using Alfresco Process Services 1.11.1 Trial Version and have problems configuring the mail task. I already looked up similar questions in this forum, but unfortunately, I cannot solve my problem. I can neither receive mails via the mail task nor receive notifications to a user from the system.

My mail settings in the file activiti-app.properties are:

email.enabled=true

email.host=smtp.gmail.com

email.port=587

email.tls=true

email.useCredentials=true

email.username=mail@mail.com

email.password=mailpw

#

## The base url that will be used to create urls in emails.

email.base.url=http://localhost:8080/activiti-app

#

email.from.default=no-reply@activiti.alfresco.com

email.from.default.name=Activiti

email.feedback.default=activiti@alfresco.com

In the logs I get following erros after starting a simple mail task process (shortened due to character limit):

12:38:32 [http-nio-8080-exec-1] ERROR org.activiti.engine.impl.interceptor.CommandContext  - Error while closing command context
org.activiti.engine.ActivitiException: Could not send e-mail in execution 25001
[...]
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
        at org.apache.commons.mail.Email.send(Email.java:1496)
        at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:102)
        ... 207 common frames omitted
Caused by: javax.mail.MessagingException: Could not convert socket to TLS
        at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2064)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:724)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)
        at javax.mail.Service.connect(Service.java:195)
        at javax.mail.Transport.send0(Transport.java:254)
        at javax.mail.Transport.send(Transport.java:124)
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
        ... 209 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:598)
        at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:525)
        at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2059)
        ... 216 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
        at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
        ... 227 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
        at java.security.cert.CertPathBuilder.build(Unknown Source)
        ... 233 common frames omitted
12:38:32 [http-nio-8080-exec-1] ERROR com.activiti.rest.exception.RestExceptionHandlerAdvice  - Internal error:
org.activiti.engine.ActivitiException: Could not send e-mail in execution 25001
[...]
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
        at org.apache.commons.mail.Email.send(Email.java:1496)
        at org.activiti.engine.impl.bpmn.behavior.MailActivityBehavior.execute(MailActivityBehavior.java:102)
        ... 207 common frames omitted
Caused by: javax.mail.MessagingException: Could not convert socket to TLS
        at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2064)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:724)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)
        at javax.mail.Service.connect(Service.java:195)
        at javax.mail.Transport.send0(Transport.java:254)
        at javax.mail.Transport.send(Transport.java:124)
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
        ... 209 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.ssl.Alerts.getSSLException(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:598)
        at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:525)
        at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2059)
        ... 216 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
        at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
        at sun.security.validator.Validator.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
        ... 227 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
        at java.security.cert.CertPathBuilder.build(Unknown Source)
        ... 233 common frames omitted

Any help is really appreciated.

3 Replies
EddieMay
Community Manager
Community Manager

Re: Mail Task + Notifications not working in APS

Hi @shmalik 

Can you check that you can send/receive email on this server outside of APS?

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
shmalik
Active Member II

Re: Mail Task + Notifications not working in APS

Hi @EddieMay ,

thank you for your quick reply!

I configured two different test accounts (each with a different mail server) in Outlook. For both accounts send/receive worked well (IMAP and SMTP) but I had to use smtp STARTTLS with Port 587 or SSL/TLS with Port 465 in the Outlook setup. For everything else I received errors. Also, it needed the credentials for the smtp.
I do not know if there is a way in APS to explicitly use STARTTLS. I tried it in APS with the combination TLS with port 587 and SSL with port 465, without success.

EddieMay
Community Manager
Community Manager

Re: Mail Task + Notifications not working in APS

Hi @shmalik 

The APS documentation doesn't mention STARTTLS. ACS documentation does mention STARTTLS. However, this thread may prove helpful.

HTH,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!