fix: proper smtp relay, therefore required new config parameter
This commit is contained in:
parent
6a1cafa8e3
commit
4bf28c99e3
@ -21,6 +21,7 @@ type Config struct {
|
|||||||
MariaDbPort string `json:"mariadb_port"`
|
MariaDbPort string `json:"mariadb_port"`
|
||||||
MailUser string `json:"mail_user"`
|
MailUser string `json:"mail_user"`
|
||||||
MailPass string `json:"mail_pass"`
|
MailPass string `json:"mail_pass"`
|
||||||
|
MailSmtpUser string `json:"mail_smtp_user"`
|
||||||
MailSmtpServer string `json:"mail_smtp_server"`
|
MailSmtpServer string `json:"mail_smtp_server"`
|
||||||
MailSmtpPort string `json:"mail_smtp_port"`
|
MailSmtpPort string `json:"mail_smtp_port"`
|
||||||
UserCreationSecret string `json:"user_creation_secret"`
|
UserCreationSecret string `json:"user_creation_secret"`
|
||||||
|
@ -16,7 +16,7 @@ Content-Type: text/plain; charset="UTF-8"
|
|||||||
`
|
`
|
||||||
header = fmt.Sprintf(header, from, to, subject)
|
header = fmt.Sprintf(header, from, to, subject)
|
||||||
mailTxt = header + mailTxt
|
mailTxt = header + mailTxt
|
||||||
auth := smtp.PlainAuth("", from, config.MailPass, config.MailSmtpServer)
|
auth := smtp.PlainAuth("", config.MailSmtpUser, config.MailPass, config.MailSmtpServer)
|
||||||
err := smtp.SendMail(config.MailSmtpServer+":"+config.MailSmtpPort, auth, from, []string{to}, []byte(mailTxt))
|
err := smtp.SendMail(config.MailSmtpServer+":"+config.MailSmtpPort, auth, from, []string{to}, []byte(mailTxt))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user