3
0

Fixed From header on env SMTP vars

This commit is contained in:
Peter Grlica
2023-06-01 15:02:17 +02:00
committed by Jože Fortun
parent 0072a4bf40
commit d2b389bebc
2 changed files with 2 additions and 13 deletions
+1
View File
@@ -973,6 +973,7 @@ func setupSmtpDialer(log *zap.Logger, servers ...types.SmtpServers) {
zap.String("host", s.Host),
zap.Int("port", s.Port),
zap.String("user", s.User),
zap.String("from", s.From),
logger.Mask("pass", s.Pass),
zap.Bool("tsl-insecure", s.TlsInsecure),
zap.String("tls-server-name", s.TlsServerName),
+1 -13
View File
@@ -76,17 +76,7 @@ func (svc authNotification) InviteEmail(ctx context.Context, emailAddress string
}
func (svc authNotification) newMail() *gomail.Message {
var (
m = mail.New()
addr = svc.settings.Auth.Mail.FromAddress
name = svc.settings.Auth.Mail.FromName
)
if addr != "" {
m.SetAddressHeader("From", addr, name)
}
return m
return mail.New()
}
func (svc authNotification) send(ctx context.Context, name, sendTo string, payload map[string]interface{}) error {
@@ -117,8 +107,6 @@ func (svc authNotification) send(ctx context.Context, name, sendTo string, paylo
// Prepare payload
payload["Logo"] = htpl.URL(svc.settings.General.Mail.Logo)
payload["BaseURL"] = svc.opt.BaseURL
payload["SignatureName"] = svc.settings.Auth.Mail.FromName
payload["SignatureEmail"] = svc.settings.Auth.Mail.FromAddress
payload["EmailAddress"] = sendTo
// Render document