Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP Auto Registration Broken after v1.15.11 #19256

Closed
Eekle opened this issue Mar 29, 2022 · 5 comments · Fixed by #19261
Closed

SMTP Auto Registration Broken after v1.15.11 #19256

Eekle opened this issue Mar 29, 2022 · 5 comments · Fixed by #19261
Labels
Milestone

Comments

@Eekle
Copy link
Contributor

Eekle commented Mar 29, 2022

Description

If I add an SMTP auth source to an install of Gitea v1.15.11, I can register new accounts by logging in against that source.

If I do the same in Gitea v1.16.5, new accounts will not register, and I get a Username or password is incorrect. error. This is true whether I use a fresh install, or if I migrate the above instance to v1.16.

Even though I can't register a new account, if I add the user manually I can then login with SMTP auth. This implies the SMTP connection is set up correctly.

I am doing all this as part of an evaluation exercise, so these are all fresh, clean Gitea installs.

I get the following in the logs:

2022/03/29 09:10:19 Completed GET /user/login?redirect_to=%2f 200 OK in 10.7847ms
2022/03/29 09:10:19 Started GET /assets/img/logo.svg for 127.0.0.1:54610
2022/03/29 09:10:19 Completed GET /assets/img/logo.svg 200 OK in 949.5µs
2022/03/29 09:10:32 Started POST /user/login for 127.0.0.1:54612
2022/03/29 09:10:32 ...ers/web/auth/auth.go:200:SignInPost() [I] Failed authentication attempt for [email protected] from 127.0.0.1:54612: Email address does not exist [email: [email protected]]
2022/03/29 09:10:32 Completed POST /user/login 200 OK in 5.5843ms

My research suggests that this relates to issue #16612, where the SMTP was overhauled between the two versions.


Reproduction:

v1.15.11 working

  • Create a new instance of Gitea v1.15.11 running locally
  • Change the DB type to SQLite and approve the initial setup
  • Create an admin account and log in
  • Add an authentication source, SMTP, "LOGIN", Enable TLS Encryption
  • Log out, then try to log in with a valid account on the SMTP server
    • This will succeed

v.1.16.5 not working

  • Create a new instance of Gitea v1.16.5 running locally
  • Change the DB type to SQLite and approve the initial setup
  • Create an admin account and log in
  • Add an authentication source, SMTP, "LOGIN"
  • Log out, then try to log in with a valid account on the SMTP server
    • This will fail
  • Log back in as an admin, and add that SMTP account as a new user
  • Log out,and attempt to log in the SMTP account again
    • This will succeed

Gitea Version

v1.16.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Self hosted on both WSL Ubuntu 20 and Windows 11. Not running in a package.

Database

SQLite

@Eekle Eekle added the type/bug label Mar 29, 2022
@lunny lunny added this to the 1.16.6 milestone Mar 29, 2022
@zeripath
Copy link
Contributor

#16612 is not related, I suspect the real problem comes from: #18789

This would cause autoregistration by email to no longer work with the reported error.

zeripath added a commit to zeripath/gitea that referenced this issue Mar 29, 2022
Unfortunately go-gitea#18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix go-gitea#19256

Signed-off-by: Andrew Thornton <[email protected]>
6543 pushed a commit that referenced this issue Mar 31, 2022
Unfortunately #18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix #19256

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Apr 2, 2022
Backport go-gitea#19261

Unfortunately go-gitea#18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix go-gitea#19256

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick pushed a commit that referenced this issue Apr 3, 2022
Backport #19261

Unfortunately #18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix #19256

Signed-off-by: Andrew Thornton <[email protected]>
@Urvin
Copy link

Urvin commented Apr 21, 2022

1.16.6 Not fixed

@Eekle
Copy link
Contributor Author

Eekle commented Apr 21, 2022

1.16.6 Not fixed

I have just tested on 1.16.6 and it is working. I can register a new user via the SMTP source.

@zeripath
Copy link
Contributor

1.16.6 Not fixed

Then you need to give us more information.

@Urvin
Copy link

Urvin commented Apr 22, 2022

1.16.6 Not fixed

Then you need to give us more information.

I found that's my SMTP provider fault

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
Unfortunately go-gitea#18789 disabled autoregistration using email addresses as they would
be shortcut to email address does not exist.

This PR attempts to restore autoregistration by allowing an unknown email address
to percolate through to the autoregistration path of UserSignin.

Fix go-gitea#19256

Signed-off-by: Andrew Thornton <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants