# SMTP issue with smtp.office365.com

**URL:** <https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562>\
**Category:** Installation Issues\
**Created:** [July 7, 2022, 9:12pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562 "2022-07-07T21:12:42Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 13, 2022, 2:09pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/22 "2022-07-13T14:09:08Z")

</div>

@ricardo Well, my o365 smtp is no longer working as well. Will post back what I find.

EDIT: [Basic Authentication and Exchange Online – September 2021 Update - Microsoft Tech Community](https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-and-exchange-online-september-2021-update/ba-p/2772210)

Related to retiring of “unused” basic auth. Supposedly, even after a hard date of October 2022 basic auth should still work for SMTP. See the link for instructions on how to enable. They mention they are disabling at the tenant level for those who are not already using it.

My K9Mail app is blocking legacy IMAP using app password, so I guess this is expected.

Again this link: [Enable or disable SMTP AUTH in Exchange Online | Microsoft Docs](https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission) includes enabling SMTP on the account level via Powershell. Instructions regarding how to verify smtp is enabled are included.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 13, 2022, 4:38pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/23 "2022-07-13T16:38:58Z")

</div>

Hi Garrett,

the subscription was throught provider of microsoft.  
following this article  
EDIT: [Basic Authentication and Exchange Online – September 2021 Update - Microsoft Tech Community](https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-and-exchange-online-september-2021-update/ba-p/2772210)

this is the result of my test

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/0/0539c24e5c95f31ff45d5f227e7a5fe99fa063c2.png)

i already enable for a specific user

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/5/5ec36bc28c5b7bbf33244400fdf1098dd34d1123.png)

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 13, 2022, 5:21pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/24 "2022-07-13T17:21:12Z")

</div>

I think there is a difference between basic auth and authenticated smtp.

My diagnostics say:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/2/2bdee52c3d9fcf3c8575eaad2da7f260f002d5be.png)

Your test results are indicating that Basic Auth is disabled for your organization (this is the default). I have had Basic Auth in use, and so my results are different. In the Protocol to Enable dropdown, SMTP is not listed, because it will not be disabled by default for those organizations who have been using it. However, IMAP is listed.

K9-Mail in their recent 6.2 version broke functionality with Office365 - so that was unfortunately not a good test and does not indicate a problem with your credentials. If you can test with a previous version of K9 or any other app that would help. I believe your organization settings do not permit using an app password. This is the new default setting.

EDIT: I think “Basic Auth” and SMTP Auth are interchangable. Try with another app - we have not yet confirmed your credentials are good.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 14, 2022, 2:05am UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/25 "2022-07-14T02:05:21Z")

</div>

HI garrett,

How i can confirm if my organization allow app password?. i will lookup for another app to test if i dont fine any old version of k9-mail

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 14, 2022, 2:57am UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/26 "2022-07-14T02:57:15Z")

</div>

@ricardo I just tested this on my own app password, and it successfully authenticated.

First, create base64 versions of your `user@domain.com` and `password`. For me, I just used base64 with php: `base64_encode(<whatever>)`. However you want to do it, create two strings.

Then from linux command line:  
` openssl s_client -starttls smtp -crlf -connect smtp.office365.com:587`

This will get you connected securely instead of having to send STARTTLS command. The result should look like:

```auto
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
verify return:1
depth=0 C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
verify return:1
---
Certificate chain
 0 s:C = US, ST = Washington, L = Redmond, O = Microsoft Corporation, CN = outlook.com
   i:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
 1 s:C = US, O = DigiCert Inc, CN = DigiCert Cloud Services CA-1
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIIpjCCB46gAwIBAgIQBRY+dkz/tKL6OsKG/GC93zANBgkqhkiG9w0BAQsFADBL
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSUwIwYDVQQDExxE
aWdpQ2VydCBDbG91ZCBTZXJ2aWNlcyBDQS0xMB4XDTIyMDcwNTAwMDAwMFoXDTIz

    Start Time: 1657766875
    Timeout : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
---
250 SMTPUTF8

```

Then, do:  
`ehlo ricardo` (for our purposes it can be whatever you want to put there after ehlo)

It should respond with:

```auto
250-CH2PR07CA0051.outlook.office365.com Hello [your ip address]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

```

Does it show AUTH LOGIN?

Then do:  
`AUTH LOGIN`

It should respond with a base64 version of “username”:

```auto
334 VXNlcm5hbWU6

```

Then, paste in your base64 version of your username, and submit it

It should respond with base64 version of “password”:

```auto
334 UGFzc3dvcmQ6

```

Then, paste in your base64 version of your app password, and submit it. If successful, you will see:

```auto
235 2.7.0 Authentication successful

```

You can QUIT to end the connection.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 18, 2022, 3:14pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/27 "2022-07-18T15:14:57Z")

</div>

Hi Garrett,

I apologize for my late anwer. I used this page [https://www.base64encode.org](https://www.base64encode.org) to create my user and pass.

output  
535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [[BL1PR13CA0195.namprd13.prod.outlook.com](http://BL1PR13CA0195.namprd13.prod.outlook.com)].

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 18, 2022, 8:06pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/28 "2022-07-18T20:06:30Z")

</div>

@ricardo No problem, thanks for the update. This was useful as it helps us know it’s not a passbolt issue but a credentials issue.

I’m not sure what to recommend regarding your Microsoft settings but asking them via support might be a good next step.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 19, 2022, 3:16am UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/29 "2022-07-19T03:16:49Z")

</div>

Hi Garrett,

I disable security default and my test were successfully with app password and normal password.  
openssl s\_client -starttls smtp -crlf -connect [smtp.office365.com:587](http://smtp.office365.com:587)  
235 2.7.0 Authentication successful.

but when i tested by passbolt

Could not send the test email.  
Error: SMTP server did not accept the password.

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 19, 2022, 3:36am UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/30 "2022-07-19T03:36:05Z")

</div>

@ricardo Nice! Would you mind posting your email config again? Remove the username and password before posting.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 19, 2022, 1:18pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/31 "2022-07-19T13:18:26Z")

</div>

Hi Garrett,

sure

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/3/3569ed595aa01218356ca0d11f9312fd7d3bd021.png)

thanks for your help!

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 19, 2022, 4:08pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/32 "2022-07-19T16:08:52Z")

</div>

@ricardo Can you please try with the `client` value set to your public ip address (or domain) and see if that makes any difference. By default I think `localhost` is sent but sometimes mail servers don’t like that.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 19, 2022, 4:56pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/33 "2022-07-19T16:56:08Z")

</div>

HI Garrett,

i put the public ip addresss but still failling with the same error.

[504] 5.7.4 Unrecognized authentication type [[MN2PR08CA0002.namprd08.prod.outlook.com](http://MN2PR08CA0002.namprd08.prod.outlook.com)]

> AUTH LOGIN  
> [334] VXNlcm5hbWU6
> 
> * * *

[334] UGFzc3dvcmQ6  
Could not send the test email.  
Error: SMTP server did not accept the password.

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 20, 2022, 11:31am UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/34 "2022-07-20T11:31:17Z")

</div>

@ricardo When I run my `send_test_email` I have the same 504 error because CakePHP tries AUTH PLAIN first, and then AUTH LOGIN. However, your test is failing after the password.

In your `passbolt.php` config file make sure both your username and app password are stored in plain text and not the base64 versions from our testing before.

Otherwise, your configuration looks exactly like mine and I have success with my app password.

NOTE: I did notice maybe you were using the long version of your microsoft tenant name (`onmicrosoft[.]com`). Try the short version of your domain only.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 27, 2022, 2:47pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/35 "2022-07-27T14:47:29Z")

</div>

Hi Garrett,

Yes i am sure that i am using plain text in my password.  
I created a ticket on microsoft. i will come back if my issue is resolved or if the problem is in passbolt

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 27, 2022, 3:02pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/36 "2022-07-27T15:02:00Z")

</div>

I also was able to get K9-mail working the other day after their new update with `outlook.office365.com SSL/TLS 993` and `smtp.office365.com STARTTLS 587` using my app password, in case you want to give that a shot again.

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [July 27, 2022, 3:14pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/37 "2022-07-27T15:14:22Z")

</div>

Ok let me try K9 meanwihle i am waiting for microsoft

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [August 24, 2022, 8:52pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/38 "2022-08-24T20:52:30Z")

</div>

I had a call with microsoft and they told me that smtp belong to legacy protocol and you need to do Auth2.0.

i follow this guideline [Amazon Simple Email Service](https://docs.aws.amazon.com/es_es/ses/latest/dg/postfix.html)  
passbolt - postfix - aws ses

Now i am trying to use AWS SES. but the error said  
status=deferred (SASL authentication failed; server emai [l-smtp.us-west-1.amazonaws.com](http://l-smtp.us-west-1.amazonaws.com)[52.53.89.16] said: 535 Authentication Credentials Invalid)

i just copy and pate the one that it was generated when i create my smtp credentials

[535] Authentication Credentials Invalid

> AUTH LOGIN  
> [334] VXNlcm5hbWU6
> 
> * * *

[334] UGFzc3dvcmQ6  
Could not send the test email.  
Error: SMTP server did not accept the password.

its seems that i cannot use a base64 user and password on the passbolt file. SMTP credencial are on base64, I am wondering what i can do ?

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [August 24, 2022, 10:12pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/39 "2022-08-24T22:12:30Z")

</div>

@ricardo Did your credentials work with k9?

---

<div class="post-metadata">

**Author:** ![ricardo](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@ricardo](https://community.passbolt.com/u/ricardo)\
**Post date:** [August 24, 2022, 10:20pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/40 "2022-08-24T22:20:17Z")

</div>

No didnt work, thats why i am looking with aws ses

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [August 24, 2022, 11:27pm UTC](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562/41 "2022-08-24T23:27:43Z")

</div>

If the credentials using the office365 app password don’t work with k9 there is a problem with the credentials. The errors are saying this as well. I would recommend playing with the password to remove any characters that may be causing problems.

[Previous page](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562.md?page=1)

[Next page](https://community.passbolt.com/t/smtp-issue-with-smtp-office365-com/5562.md?page=3)
