Issues with Configuring Email Server

Hi,

I am trying to configure mail server in Appian V7.10 so an email can be sent using office365 account.
While sending emails Appian reads the configurations mentioned in custom.properties (configuarations suggested in forum.appian.com/.../Mail_Server_Setup.html). But we are facing problem while sending mails.

Steps followed:

we configured office365 as mail server, configured this as SMTP host.
we did the setting as mentioned in forum. forum.appian.com/.../Mail_Server_Setup.html
conf.mailhandler.mail.smtp.host=SMTP_HOST:PORT
conf.mailhandler.mail.smtp.auth=true
conf.mailhandler.mail.user=myuser@abc.com
conf.mailhandler.mail.transport.protocol=smtp
password is mentioned in password.properties file.
conf.password.SMTP=mypassword

Notification sender is also configured.
conf.mailhandler.ntf_sndr_addr=myuser@abc.com
conf.mailhandler.ntf_sndr_name=myuser

We tested the connectivity from the appian...

OriginalPostID-167251

OriginalPostID-167251

  Discussion posts and replies are publicly visible

  • ... server. we found no issue with connectivity.
    ->ping SMTP_HOST
    ->telnet SMTP_HOST:PORT

    while sending mails we are getting an error.

    09:40:12,292 INFO [stdout] (Appian Work Item - 2 - NotificationsEmail : MailRequest) 2015-09-10 09:40:12,292 [Appian Work Item - 1 - NotificationsEmail : MailRequest] ERROR com.appiancorp.ap2.util.Mail - Could not send mail via SMTP_HOST:PORT to.
    09:40:12,299 ERROR [org.jboss.as.ejb3.invocation] (Appian Work Item - 2 - NotificationsEmail) JBAS014134: EJB Invocation failed on component UnattendedRequestHandlerBean for method public abstract com.appiancorp.process.engine.ContinuationResponse com.appiancorp.ra.workpoller.UnattendedRequestListener.onMessage(com.appiancorp.process.engine.UnattendedRequest): javax.ejb.EJBException: com.appiancorp.process.engine.EmailSendException: Could not send email from FromAddress@domain.com to ToAddress@domain.com subject Error in Task: Script Task

    Any suggestion to resolve this.

    Thanks.
  • Hi, can you please attach the application server log? Thanks.
  • In your log I see that there is an SSL handshake exception. You may find this forum post useful: forum.appian.com/.../e-116808
  • We still getting the error:

    11:15:14,762 INFO [stdout] (http-/0.0.0.0:8080-2) 2015-09-21 11:15:14,759 [http-/0.0.0.0:8080-2] ERROR com.appiancorp.ap2.util.Mail - Could not send mail via SMTP_HOST:PORT_NUMBER to myuser@abc.com

    11:15:14,788 INFO [stdout] (http-/0.0.0.0:8080-2) 2015-09-21 11:15:14,785 [http-/0.0.0.0:8080-2] ERROR com.appiancorp.process.runtime.activities.SendEmailActivity - javax.mail.MessagingException: Could not connect to SMTP host: SMTP_HOST, port: PORT_NUMBER;
    11:15:14,789 INFO [stdout] (http-/0.0.0.0:8080-2) nested exception is:
    11:15:14,789 INFO [stdout] (http-/0.0.0.0:8080-2) javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

    11:15:14,789 INFO [stdout] (http-/0.0.0.0:8080-2) javax.mail.MessagingException: Could not connect to SMTP host: SMTP_HOST, port: PORT_NUMBER;


    ==========================

    06:59:07,128 ERROR [org.jboss.as.ejb3.invocation] (Appian Work Item - 3 - NotificationsEmail) JBAS014134: EJB Invocation failed on component UnattendedRequestHandlerBean for method public abstract com.appiancorp.process.engine.ContinuationResponse com.appiancorp.ra.workpoller.UnattendedRequestListener.onMessage(com.appiancorp.process.engine.UnattendedRequest): javax.ejb.EJBException: com.appiancorp.process.engine.EmailBodyException: Email body failed to render

    Caused by: com.appiancorp.process.engine.EmailBodyException: Email body failed to render

    Caused by: java.net.ConnectException: Connection refused: connect
  • It looks like that is actually a different error. Please confirm that you are using the correct credentials to access the email account, that you are using a port that is available, and that you are still able to connect via telnet. Also please double-check that you have correctly configured the custom.properties file. From the information you have provided, it appears that you may not have configured the "Rendering Email Body" section of the properties. After verifying these things, if the problem persists, please attach your custom.properties file and your application-server.log file (found in your <APPIAN_HOME>/logs folder) so that I can review them further.
  • The application server makes a GET request via conf.suite.MAIL_SCHEME://conf.suite.MAIL_SERVER_AND_PORT to retrieve the JSP that will be used as a template to render the body of the email. This step is called "Rendering the email body". If these settings are not defined the URL defaults to
    conf.suite.SCHEME://conf.suite.SERVER_AND_PORT.

    In this particular case, as Eliot mentioned, there's an SSL handshake error in the logs which suggests you're using a self-signed certificate meaning it won't be trusted by the application server JDK when making the GET request.

    You can search here on Forum for this error for more information but basically the SSL handshare and the java.net.ConnectException: Connection refused: connect are not problems between APP_SERVER and MAIL_SERVER. Since this is failing even before sending the email, in the body rendering part, we can tell the issue is between APP_SERVER and WEB_SERVER in the GET request I describe above.

    To fix this simply configure these two settings in custom.properties to point to HTTP and APP_SERVER. For example:

    conf.suite.MAIL_SCHEME=http
    conf.suite.MAIL_SERVER_AND_PORT=myappserver.mycompany.com:8080

    and restart it. This way the GET request made by the app server will be made to itself and not the web server, which is indeed not required.
  • @Eduardo

    Please find the attached custom.properties file related to mail server configuration settings and let us know if any modification required , so that will go ahead and restart Appian

    custom (1).properties

  • I guess this is the sanitized version of your file for security purposes since the values look like dummy values.

    In any case, as stated above, you need to set

    conf.suite.MAIL_SCHEME=http
    conf.suite.MAIL_SERVER_AND_PORT=localhost.xyz.com:8080

    so they point to the app server
  • We still get the same error :
    ======================================================
    05:23:25,943 INFO [com.metaparadigm.jsonrpc.BeanSerializer] (http-/0.0.0.0:8080-4) analyzing com.appiancorp.suiteapi.process.ProcessVariable
    05:23:32,455 INFO [stdout] (http-/0.0.0.0:8080-4) 2015-09-22 05:23:32,452 [http-/0.0.0.0:8080-4] ERROR com.appiancorp.ap2.util.Mail - Could not send mail via smtp.office365.com:587 to venusaikumarc@incessanttechnologies.com
    05:23:32,499 INFO [stdout] (http-/0.0.0.0:8080-4) 2015-09-22 05:23:32,491 [http-/0.0.0.0:8080-4] ERROR com.appiancorp.process.runtime.activities.SendEmailActivity - javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587;
    05:23:32,502 INFO [stdout] (http-/0.0.0.0:8080-4) nested exception is:
    05:23:32,503 INFO [stdout] (http-/0.0.0.0:8080-4) javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05:23:32,505 INFO [stdout] (http-/0.0.0.0:8080-4) javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587;
    05:23:32,512 INFO [stdout] (http-/0.0.0.0:8080-4) nested exception is:
    05:23:32,514 INFO [stdout] (http-/0.0.0.0:8080-4) javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05:23:32,516 INFO [stdout] (http-/0.0.0.0:8080-4) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
    ======================================================

    Attaching custom.properties and server.log for more details.

    custom.properties

    server (2).log