SMTP with Office 365 not working

Hi All,

I have this issue when trying to test my email setup. I am running v 1.0 in Docker. And followed this guide for Ubuntu 14.04 https://github.com/mattermost/platform/blob/master/doc/install/Docker-Single-Container.md#ubuntu.

TLS Errors:

[2015/10/07 11:24:27 UTC] [DEBG] /api/v1/admin/config
[2015/10/07 11:24:31 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/07 11:24:31 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=rsqndjxn3f8r7puttryj6epm9y uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.3.68 Failed to open TLS connection [details: tls: first record does not look like a TLS handshake]
[2015/10/07 11:24:32 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/07 11:24:33 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=ybbi4ppexpggdeupkfhcjbkr1r uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.3.68 Failed to open TLS connection [details: tls: first record does not look like a TLS handshake]
[2015/10/07 11:24:33 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/07 11:24:33 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=ok85dy6eiffjpqe3so6f6qs6jc uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.3.68 Failed to open TLS connection [details: tls: first record does not look like a TLS handshake]
[2015/10/07 11:24:34 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/07 11:24:34 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=nmohb5fdzfnjuq8njtq1cz7f5h uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.3.68 Failed to open TLS connection [details: tls: first record does not look like a TLS handshake]

STARTTLS Errors

2015/10/08 08:27:06 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/08 08:27:20 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=f6o6up6ebirbun5s7eh89a991c uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.2.112 Failed to authenticate on SMTP server [details: 504 5.7.4 Unrecognized authentication type]
[2015/10/08 08:27:24 UTC] [DEBG] /api/v1/admin/logs
[2015/10/08 08:27:55 UTC] [DEBG] /api/v1/admin/test_email
[2015/10/08 08:28:05 UTC] [EROR] /api/v1/admin/test_email:SendMail code=500 rid=os9anks597gybgq35e5imudx5y uid=5jtgo5cftbbc7du17n63nznxac ip=192.168.2.112 Failed to authenticate on SMTP server [details: 504 5.7.4 Unrecognized authentication type]
[2015/10/08 08:28:08 UTC] [DEBG] /api/v1/admin/logs

I also followed the guide here https://github.com/mattermost/platform/blob/master/doc/install/SMTP-Email-Setup.md to enable email.

My config is:

    "EmailSettings": {
        "EnableSignUpWithEmail": true,
        "SendEmailNotifications": true,
        "RequireEmailVerification": true,
        "FeedbackName": "no-reply",
        "FeedbackEmail": "no-reply@<mydomain>",
        "SMTPUsername": "<user>@<mydomain>",
        "SMTPPassword": "<password>",
        "SMTPServer": "smtp.office365.com",
        "SMTPPort": "587",
        "ConnectionSecurity": "TLS",
        "InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
        "PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
        "ApplePushServer": "",
        "ApplePushCertPublic": "",
        "ApplePushCertPrivate": ""

I do not have "ByPassEmail" in /config_docker.json. Did something change in V1.0 to enable email?

Linking issues see https://github.com/mattermost/platform/issues/954

Is anyone with a paid Office 365 subscription open to filing a support ticket to get troubleshooting help with SMTP setup?

My guess is there is something funky on their end.

I have been through Microsoft regarding this issue already. They claim there is no problem there end because SMTP works in my Thunderbird, my network printer and in outlook. From that, they won’t offer any more support.

I’ve tried to setup mattermost the same way Thunderbird is setup. With STARTTLS, and it’s not working unfortunately. Can someone tell me which script, or function mattermost uses to send emails? I will look around for similar issues.