go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.72k stars 5.46k forks source link

Unable to send Outlook email #32305

Open venuses opened 2 days ago

venuses commented 2 days ago

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

wxiaoguang commented 2 days ago

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"

venuses commented 2 days ago

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
wxiaoguang commented 2 days ago

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 2 days ago

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.

venuses commented 2 days ago

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

image
wxiaoguang commented 2 days ago

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

image

venuses commented 2 days ago

So now I can only change to another outbox😅

wxiaoguang commented 2 days ago

So now I can only change to another outbox😅

Or write some code to add "OAuth" support

venuses commented 2 days ago

OK,I'll see how to solve it.