Unable to send Outlook email #13621

Open
opened 2025-11-02 10:48:28 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @Jasonx365 on GitHub (Oct 21, 2024).

Description

In the previous version, the configured Outlook emails were sent normally, but after updating to the latest version, they cannot be sent.
image

Gitea Version

docker image 1.22.3-rootless

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

docker image 1.22.3-rootless

Database

PostgreSQL

Originally created by @Jasonx365 on GitHub (Oct 21, 2024). ### Description In the previous version, the configured Outlook emails were sent normally, but after updating to the latest version, they cannot be sent. <img width="1305" alt="image" src="https://github.com/user-attachments/assets/83abaec8-e449-4882-9e13-91216d3d1283"> ### Gitea Version docker image 1.22.3-rootless ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots <img width="833" alt="image" src="https://github.com/user-attachments/assets/152498db-71eb-4f13-9d7d-50983de2abee"> ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker image 1.22.3-rootless ### Database PostgreSQL
GiteaMirror added the type/proposalissue/not-a-bug labels 2025-11-02 10:48:28 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Oct 21, 2024):

In the previous version, the configured Outlook emails were sent normally, but after updating to the latest version, they cannot be sent.

Not related. Because outlook is changing their behavior.


The message is quite clear: outlook says: "basic auth is disabled", but you are still using it, so you can't succeed to send email by your "basic auth"

@wxiaoguang commented on GitHub (Oct 21, 2024): > In the previous version, the configured Outlook emails were sent normally, but after updating to the latest version, they cannot be sent. Not related. Because outlook is changing their behavior. ---- The message is quite clear: outlook says: "basic auth is disabled", but you are still using it, so you can't succeed to send email by your "basic auth"
Author
Owner

@Jasonx365 commented on GitHub (Oct 21, 2024):

how should I deal with this?
my app.ini configuration is as follows:

[mailer]
ENABLED = true
FROM = `Name <name@outlook.com>`
PROTOCOL = smtp+starttls
SMTP_ADDR  = smtp-mail.outlook.com
SMTP_PORT = 587
USER = "name@outlook.com"
PASSWD = `xxxx`
ENABLE_HELO = true
@Jasonx365 commented on GitHub (Oct 21, 2024): how should I deal with this? my app.ini configuration is as follows: ``` [mailer] ENABLED = true FROM = `Name <name@outlook.com>` PROTOCOL = smtp+starttls SMTP_ADDR = smtp-mail.outlook.com SMTP_PORT = 587 USER = "name@outlook.com" PASSWD = `xxxx` ENABLE_HELO = true ```
Author
Owner

@wxiaoguang commented on GitHub (Oct 21, 2024):

how should I deal with this? my app.ini configuration is as follows:

[mailer]
ENABLED = true
FROM = `Name <name@outlook.com>`
PROTOCOL = smtp+starttls
SMTP_ADDR  = smtp-mail.outlook.com
SMTP_PORT = 587
USER = "name@outlook.com"
PASSWD = `xxxx`
ENABLE_HELO = true

I do not think there is OAuth support at the moment. If I understand correctly, the OAuth SMTP is designed for end users, but not for server software like Gitea. And outlook is moving to "only provide services for end users".

@wxiaoguang commented on GitHub (Oct 21, 2024): > how should I deal with this? my app.ini configuration is as follows: > > ``` > [mailer] > ENABLED = true > FROM = `Name <name@outlook.com>` > PROTOCOL = smtp+starttls > SMTP_ADDR = smtp-mail.outlook.com > SMTP_PORT = 587 > USER = "name@outlook.com" > PASSWD = `xxxx` > ENABLE_HELO = true > ``` I do not think there is OAuth support at the moment. ~~If I understand correctly, the OAuth SMTP is designed for end users, but not for server software like Gitea. And outlook is moving to "only provide services for end users".~~
Author
Owner

@wxiaoguang commented on GitHub (Oct 21, 2024):

There are details on Microsoft's site: https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth


You can use the OAuth authentication service provided by Microsoft Entra (Microsoft Entra) to enable your application connect with IMAP, POP, or SMTP protocols to access Exchange Online in Office 365. To use OAuth with your application, you need to:

Maybe it needs some people to try and implement it.

@wxiaoguang commented on GitHub (Oct 21, 2024): There are details on Microsoft's site: https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth ---- You can use the OAuth authentication service provided by Microsoft Entra (Microsoft Entra) to enable your application connect with IMAP, POP, or SMTP protocols to access Exchange Online in Office 365. To use OAuth with your application, you need to: * [Register your application](https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#register-your-application) with Microsoft Entra. * [Get an access token](https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#get-an-access-token) from a token server. * [Authenticate connection requests](https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#authenticate-connection-requests) with an access token. Maybe it needs some people to try and implement it.
Author
Owner

@Jasonx365 commented on GitHub (Oct 21, 2024):

In this link, a new method is provided. Is it currently supported?
image

@Jasonx365 commented on GitHub (Oct 21, 2024): In this link, [a new method](https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040) is provided. Is it currently supported? <img width="652" alt="image" src="https://github.com/user-attachments/assets/2532b6ff-dddd-4655-8378-0de0fe8b3a66">
Author
Owner

@wxiaoguang commented on GitHub (Oct 21, 2024):

No, there is no such support. There are only a few auth methods supported.

image

@wxiaoguang commented on GitHub (Oct 21, 2024): No, there is no such support. There are only a few auth methods supported. ![image](https://github.com/user-attachments/assets/91c3da3e-f66d-4b50-8e09-888f98bb3bd0)
Author
Owner

@Jasonx365 commented on GitHub (Oct 21, 2024):

So now I can only change to another outbox😅

@Jasonx365 commented on GitHub (Oct 21, 2024): So now I can only change to another outbox😅
Author
Owner

@wxiaoguang commented on GitHub (Oct 21, 2024):

So now I can only change to another outbox😅

Or write some code to add "OAuth" support

@wxiaoguang commented on GitHub (Oct 21, 2024): > So now I can only change to another outbox😅 Or write some code to add "OAuth" support
Author
Owner

@Jasonx365 commented on GitHub (Oct 21, 2024):

OK,I'll see how to solve it.

@Jasonx365 commented on GitHub (Oct 21, 2024): OK,I'll see how to solve it.
Author
Owner

@changchaishi commented on GitHub (Jan 10, 2025):

@venuses Maybe you can try to use an SMTP-relay server to accomplish this.
https://github.com/bokysan/docker-postfix?tab=readme-ov-file#xoauth2_client_id-xoauth2_secret-xoauth2_initial_access_token-xoauth2_initial_refresh_token-and-xoauth2_token_endpoint

@changchaishi commented on GitHub (Jan 10, 2025): @venuses Maybe you can try to use an SMTP-relay server to accomplish this. https://github.com/bokysan/docker-postfix?tab=readme-ov-file#xoauth2_client_id-xoauth2_secret-xoauth2_initial_access_token-xoauth2_initial_refresh_token-and-xoauth2_token_endpoint
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13621