Sending Mail Not Working On 7.12.1 version for Outlook

 

I am trying to send email with this settings;

starttlsSupport true
sslSupport false
trustCertificate false
smtpPort 587
smtpHost smtp.office365.com
 

I checked my settings, I can send email from 7.11.0 version. I already developed my application on 7.12.1 and I can't use it on 7.11.0

But i get this error: 

org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [ZR0P278CA0146.CHEP278.PROD.OUTLOOK.COM]

        at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$execute$0(ConnectorExecutorImpl.java:159)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
    Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [ZR0P278CA0146.CHEP278.PROD.OUTLOOK.COM]

        at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:76)
        at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:258)
        at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:217)
        at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$wrapForStats$1(ConnectorExecutorImpl.java:169)
        at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$execute$0(ConnectorExecutorImpl.java:156)
        ... 4 more
    Caused by: org.bonitasoft.engine.connector.ConnectorException: javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [ZR0P278CA0146.CHEP278.PROD.OUTLOOK.COM]

        at org.bonitasoft.connectors.email.EmailConnector.executeBusinessLogic(EmailConnector.java:510)
        at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
        at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:74)
        ... 8 more
    Caused by: javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful [ZR0P278CA0146.CHEP278.PROD.OUTLOOK.COM]

        at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:965)
        at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:876)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:780)
        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.bonitasoft.connectors.email.EmailConnector.executeBusinessLogic(EmailConnector.java:508)
        ... 10 more

Hi Mehmet Sakir,
 
If, as you say, the very same connector configuration is working in Bonita version 7.11 but no longer working in 2021.1 (7.12.1), this one could be due to a problem between the javax.mail library (which is used and embedded by the email connector) and the office365 SMTP server, as this article suggests.
As a matter of fact,
  • the email connector in 7.11 embeds: javax.mail-1.4.7.jar
  • the email connector in 2021.1 embeds: javax.mail-1.6.2.jar

Perhaps there is some setting on the SMTP server side that might help... See for example:

  • https://answers.microsoft.com/en-us/msoffice/forum/all/535-573-authentication-unsuccessful/cd915151-ae89-4505-8ad3-29680554e710
  • https://community.spiceworks.com/topic/2276644-everything-using-office-365-smtp-authentication-is-broken-wont-authenticate
  • https://answers.microsoft.com/en-us/msoffice/forum/all/smtpoffice365com-535-573-authentication/2e708a73-3340-4d24-b4e5-b97ff999dbae

I hope this helps.

Regards,

   Unai

Hi Unai,

Before asking this question, I tried the articles you sent me already and more. I am thinking as same as you that javax.mail library has bug but it is very old library so i am not sure it could get update or bug fix. Aslo i coudn't find a way to downgrade mail connector. Because of these, I must continue to use 7.11.

Hi Mehmet,

Can you try the to set the TLS version like explained in this answer ?

HTH
Romain