SMTP Authentication error when trying to send emails in private cloud

I'm getting the below error when sending emails (forgot password) in Apigee Edge private cloud 4.15.07. I have confirmed there is no authentication on SMTP server used, below is from

apigee4/conf/ui/apigee.conf.

mail.smtp.host=<IP_TO_SMTP>
#mail.smtp.user=
#mail.smtp.pass=
#mail.smtp.channel=
mail.smtp.port=25
mail.smtp.tls="false"

        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.11.1.jar:na]
Caused by: utils.UiException: Internal Error
play.api.Application$$anon$1: Execution exception[[UiException: Internal Error]]
        at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.11.1.jar:na]
Caused by: utils.UiException: Internal Error
        at utils.UiException.makeExceptionWithSteps(UiException.java:40) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
        at controllers.NonSecure$8.apply(NonSecure.java:456) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
        at controllers.NonSecure$8.apply(NonSecure.java:443) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
        at play.core.j.FPromiseHelper$$anonfun$map$1.apply(FPromiseHelper.scala:98) ~[com.typesafe.play.play_2.11-2.3.4.jar:2.3.4]
        at scala.util.Success$$anonfun$map$1.apply(Try.scala:236) ~[org.scala-lang.scala-library-2.11.1.jar:na]
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : 10.26.74.190:25
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410) ~[org.apache.commons.commons-email-1.3.3.jar:1.3.3]
        at org.apache.commons.mail.Email.send(Email.java:1437) ~[org.apache.commons.commons-email-1.3.3.jar:1.3.3]
        at services.Mails.sendMail(Mails.java:128) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
        at services.Mails.sendMailPasswordReset(Mails.java:87) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
        at controllers.NonSecure$8.apply(NonSecure.java:453) ~[enterpriseui.enterpriseui-4.15.07.00-75d1384-20150823-004603.jar:4.15.07.00-75d1384-20150823-004603]
Caused by: javax.mail.AuthenticationFailedException: 535 5.7.0 authentication failed

        at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823) ~[javax.mail.mail-1.4.5.jar:1.4.5]
        at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756) ~[javax.mail.mail-1.4.5.jar:1.4.5]
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673) ~[javax.mail.mail-1.4.5.jar:1.4.5]
        at javax.mail.Service.connect(Service.java:317) ~[javax.mail.mail-1.4.5.jar:1.4.5]
        at javax.mail.Service.connect(Service.java:176) ~[javax.mail.mail-1.4.5.jar:1.4.5]
utils.UiException: Internal Error
        at utils.UiException.makeExceptionWithSteps(UiException.java:40)
        at controllers.NonSecure$8.apply(NonSecure.java:456)
        at controllers.NonSecure$8.apply(NonSecure.java:443)
        at play.core.j.FPromiseHelper$$anonfun$map$1.apply(FPromiseHelper.scala:98)
        at scala.util.Success$$anonfun$map$1.apply(Try.scala:236)
        at scala.util.Try$.apply(Try.scala:191)
        at scala.util.Success.map(Try.scala:236)
        at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
        at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
        at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:40)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : 10.26.74.190:25
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
        at org.apache.commons.mail.Email.send(Email.java:1437)
        at services.Mails.sendMail(Mails.java:128)
        at services.Mails.sendMailPasswordReset(Mails.java:87)
        at controllers.NonSecure$8.apply(NonSecure.java:453)
        ... 15 more
Caused by: javax.mail.AuthenticationFailedException: 535 5.7.0 authentication failed

        at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823)
        at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673)
        at javax.mail.Service.connect(Service.java:317)
        at javax.mail.Service.connect(Service.java:176)
        at javax.mail.Service.connect(Service.java:125)
        at javax.mail.Transport.send0(Transport.java:194)
        at javax.mail.Transport.send(Transport.java:124)
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
        ... 19 more
k
0 5 11.6K
5 REPLIES 5

@coverbeck may have some insight on this one. I cannot imagine why it would fail. Though I myself have never tested a no-authentication SMTP server with Edge.

Not applicable

Is there by any chance a mail.smtp.credential setting in one of your .conf files? If there is, can you comment it out, or set it to null? Can you also make sure that the mail.smtp.user and mail.smtp.pass settings are not in the conf file more than once, and if they are, to comment them all out?

I believe at one point the install script would append new settings to the .conf file instead of editing the existing ones, hence my guesses there.

I just checked the code, and we do not set the authentication in the API to SMTP if mail.smtp.credential and mail.smtp.user are not set.

Looked through config files and found mail.smtp.credential at bottom of one set to random set of chars. Once I commented this out and restarted everything emails are working. Thank you!

It wasn't a random set of characters -- they were encrypted credentials in base64. 🙂 Glad it's working!

@coverbeck - i am facing the same issue, i tried to comment or set the smtp.credentials to null but once i restart edge-ui the conf file i getting updated and the value is restored. Do i have to set this up somewhere so that the value is commented after restart ?