use SMTP as the authentication source error #7416

Closed
opened 2025-11-02 07:25:17 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @jnan88 on GitHub (Jun 1, 2021).

  • Gitea version (or commit ref): 1.14.2
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    2021/06/01 02:13:07 Started GET /user/login for 172.18.0.1:41076
    2021/06/01 02:13:07 Completed GET /user/login 200 OK in 3.925757ms
    2021/06/01 02:13:08 Started GET /user/events for 172.18.0.1:41082
    2021/06/01 02:13:08 Completed GET /user/events 200 OK in 329.913µs
    2021/06/01 02:13:30 Started POST /user/login for 172.18.0.1:41144
    2021/06/01 02:15:37 Completed POST /user/login 500 Internal Server Error in 2m7.214881422s

2021/06/01 02:16:44 ...s/context/context.go:676:1() [D] CSRF Token: xxxx
2021/06/01 02:17:44 routers/user/auth.go:197:SignInPost() [E] UserSignIn: EOF
2021/06/01 02:17:44 ...s/context/context.go:184:HTML() [D] Template: status/500

Description

I use SMTP as the authentication source, and time out always appears, which makes it impossible to log in

...

Screenshots

Originally created by @jnan88 on GitHub (Jun 1, 2021). - Gitea version (or commit ref): 1.14.2 - Git version: - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: 2021/06/01 02:13:07 Started GET /user/login for 172.18.0.1:41076 2021/06/01 02:13:07 Completed GET /user/login 200 OK in 3.925757ms 2021/06/01 02:13:08 Started GET /user/events for 172.18.0.1:41082 2021/06/01 02:13:08 Completed GET /user/events 200 OK in 329.913µs 2021/06/01 02:13:30 Started POST /user/login for 172.18.0.1:41144 2021/06/01 02:15:37 Completed POST /user/login 500 Internal Server Error in 2m7.214881422s 2021/06/01 02:16:44 ...s/context/context.go:676:1() [D] CSRF Token: xxxx 2021/06/01 02:17:44 routers/user/auth.go:197:SignInPost() [E] UserSignIn: EOF 2021/06/01 02:17:44 ...s/context/context.go:184:HTML() [D] Template: status/500 ## Description I use SMTP as the authentication source, and time out always appears, which makes it impossible to log in ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@zeripath commented on GitHub (Jun 1, 2021):

Can you reproduce this error on main?

@zeripath commented on GitHub (Jun 1, 2021): Can you reproduce this error on main?
Author
Owner

@jnan88 commented on GitHub (Jun 3, 2021):

Can you reproduce this error on main?

run at macOS is same as .

2021/06/03 09:25:10 Started POST /user/login for [::1]:54932
2021/06/03 09:26:10 routers/user/auth.go:197:SignInPost() [E] UserSignIn: EOF
2021/06/03 09:26:10 Completed POST /user/login 500 Internal Server Error in 1m0.054769159s

@jnan88 commented on GitHub (Jun 3, 2021): > Can you reproduce this error on main? run at macOS is same as . 2021/06/03 09:25:10 Started POST /user/login for [::1]:54932 2021/06/03 09:26:10 routers/user/auth.go:197:SignInPost() [E] UserSignIn: EOF 2021/06/03 09:26:10 Completed POST /user/login 500 Internal Server Error in 1m0.054769159s
Author
Owner

@zeripath commented on GitHub (Jun 3, 2021):

OK so I suspect the issue is with your configuration of the SMTP authenticator.

Have you read:

https://docs.gitea.io/en-us/authentication/#smtp-simple-mail-transfer-protocol

The EOF will be coming from somewhere in:

6a7bf974be/models/login_source.go (L605-L634)

If you're sure your configuration is correct you could add some log.Debug(...) around here, in particular before every return.

@zeripath commented on GitHub (Jun 3, 2021): OK so I suspect the issue is with your configuration of the SMTP authenticator. Have you read: https://docs.gitea.io/en-us/authentication/#smtp-simple-mail-transfer-protocol The EOF will be coming from somewhere in: https://github.com/go-gitea/gitea/blob/6a7bf974bef6257517e39d9979b4ebac8c35176a/models/login_source.go#L605-L634 If you're sure your configuration is correct you could add some `log.Debug(...)` around here, in particular before every return.
Author
Owner

@jnan88 commented on GitHub (Jun 3, 2021):

SMTPAuth

when use ssl, line 607 be EOF error here

`
import (
"crypto/tls"
"log"
"net/smtp"
)

func main() {
_, err1 := smtp.Dial("smtp.exmail.qq.com:465") //EOF error
if err1 != nil {
log.Fatal(err1)
}
_, err := tls.Dial("tcp", "smtp.exmail.qq.com:465", &tls.Config{InsecureSkipVerify:true})
if err != nil {
log.Fatal(err)
}
}
`

@jnan88 commented on GitHub (Jun 3, 2021): > SMTPAuth when use ssl, line 607 be EOF error here ` import ( "crypto/tls" "log" "net/smtp" ) func main() { _, err1 := smtp.Dial("smtp.exmail.qq.com:465") //EOF error if err1 != nil { log.Fatal(err1) } _, err := tls.Dial("tcp", "smtp.exmail.qq.com:465", &tls.Config{InsecureSkipVerify:true}) if err != nil { log.Fatal(err) } } `
Author
Owner

@jnan88 commented on GitHub (Jun 4, 2021):

The problem was found, because the cloud service blocked port 25。the EOF problem will appear

@jnan88 commented on GitHub (Jun 4, 2021): The problem was found, because the cloud service blocked port 25。the EOF problem will appear
Author
Owner

@zeripath commented on GitHub (Jun 4, 2021):

OK so we can close this?

@zeripath commented on GitHub (Jun 4, 2021): OK so we can close this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7416