mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 09:16:16 -06:00
Do not use plainAuth when no user or password. Fixes #3320
This commit is contained in:
parent
8effc77788
commit
b0bcc1d2d7
1 changed files with 8 additions and 1 deletions
|
|
@ -77,11 +77,18 @@ func NewSender() (Sender, error) {
|
|||
port := config.GetSMTPPort()
|
||||
from := config.GetSMTPFrom()
|
||||
msgIDHost := config.GetHost()
|
||||
var smtpAuth smtp.Auth
|
||||
|
||||
if (username == "" || password == "") {
|
||||
smtpAuth = nil
|
||||
} else {
|
||||
smtpAuth = smtp.PlainAuth("", username, password, host)
|
||||
}
|
||||
|
||||
return &sender{
|
||||
hostAddress: fmt.Sprintf("%s:%d", host, port),
|
||||
from: from,
|
||||
auth: smtp.PlainAuth("", username, password, host),
|
||||
auth: smtpAuth,
|
||||
msgIDHost: msgIDHost,
|
||||
template: t,
|
||||
}, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue