email module - client was not authenticated

0
Hi guys, we are using the email template module for version 336 of the model and when we locally test using google smtp settings (and turning the hard coded flag of the SSL to true in the SendEmail.java class), we are able to send emails from the app, with attachments, and all gets to the right email inbox correctly. However, now that we've got the client's own email details (they are using office 365), we seem to get stuck on authentication! Office 365 uses TLS, so we've reverted the SSL flag back to false (otherwise we get an unrecognized SSL message, plaintext connection, so we now bypass that error, but get the following: "530 5.7.1 Client was not authenticated" I have logged in to the email box via web outlook log in and credentials are definitely fine, as I can see emails I sent from my own email to test the client email box was up and running, but whenever we try to send it from the app, it gives the same authentication error. We've added system properties to enable TLS in the java, but that didn't change the outcome of the action, we still get the authentication error. Is there any further java we need to add to force smtp to set that it requires authentication or is this something the owners of the office 365 account need to allow at their end - to set smtp to authenticate? LR. ps: (don't take me wrong, but please don't answer by suggesting we can upgrade to version 5+ of the modeler, as we cannot do this at the moment, and that would just not help - Many thanks) ########### error stack trace: ########## Error sending email at kQ.a(SourceFile:144) Caused by: null at java.security.AccessController.doPrivileged(Native Method) at kQ.a(SourceFile:132) at com.mendix.modules.email.EmailModule.mail(SourceFile:121) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:115) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.execute(SourceFile:212) at lo.a(SourceFile:70) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lp.a(SourceFile:71) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lN.a(SourceFile:66) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lp.a(SourceFile:71) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.execute(SourceFile:212) at gd.execute(SourceFile:184) at iI.a(SourceFile:311) at iI.a(SourceFile:240) at iI.processRequest(SourceFile:179) at iL.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:857) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:351) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) at java.lang.Thread.run(Thread.java:662) Caused by: 530 5.7.1 Client was not authenticated at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388) at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583) at javax.mail.Transport.send0(Transport.java:169) at javax.mail.Transport.send(Transport.java:98) at kQ$1.run(SourceFile:137) at java.security.AccessController.doPrivileged(Native Method) at kQ.a(SourceFile:132) at com.mendix.modules.email.EmailModule.mail(SourceFile:121) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:115) at emailtemplate.actions.SendEmail.executeAction(SendEmail.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.execute(SourceFile:212) at lo.a(SourceFile:70) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lp.a(SourceFile:71) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lN.a(SourceFile:66) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.executeSync(SourceFile:189) at lp.a(SourceFile:71) at mA.a(SourceFile:73) at mz.executeAction(SourceFile:101) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:48) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:435) at hk.b(SourceFile:156) at com.mendix.core.Core.execute(SourceFile:212) at gd.execute(SourceFile:184) at iI.a(SourceFile:311) at iI.a(SourceFile:240) at iI.processRequest(SourceFile:179) at iL.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:857) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:351) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) at java.lang.Thread.run(Thread.java:662)
asked
2 answers
0

I did google the error code and page I came across different pages telling it is a SMTP error message. Maybe some configuration is needed on the Exchange side of this solution?

http://krypted.com/windows-server/resolve-530-5-7-1-client-was-not-authenticated-error-in-exchange-2010-2012/

http://ukblog.im-mobility.com/microsoft-exchange-2010-returns-smtp-error-530

answered
0

The Office 365 smtp is very strict about sending e-mail though them. This is an old blog, but helpfull: http://www.messageops.com/office-365-tools-resources/smtp-relay-with-office-365/

The official microsoft info: http://technet.microsoft.com/en-us/library/dn554323%28v=exchg.150%29.aspx

What I got from all this is the statements of the first blog link are still true:

  • The sending application must connect to the Office 365 servers on port 587
  • The sending application must support TLS
  • The sending application must authenticate with Office 365
  • The account you authenticate to the relay server with must be the same account as the from address on the messages you send through the relay

Especially the last part. You will need different connection settings for each from address you are sending your mail from.

answered