fix: properly log extra message

This commit is contained in:
kolaente 2022-09-01 14:19:00 +02:00
parent 8fddbf43ba
commit c19479757a
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -105,14 +105,14 @@ func StartMailDaemon() {
if !open { if !open {
err = c.DialWithContext(context.Background()) err = c.DialWithContext(context.Background())
if err != nil { if err != nil {
log.Error("Error during connect to smtp server: %s", err) log.Errorf("Error during connect to smtp server: %s", err)
break break
} }
open = true open = true
} }
err = c.Send(m) err = c.Send(m)
if err != nil { if err != nil {
log.Error("Error when sending mail: %s", err) log.Errorf("Error when sending mail: %s", err)
break break
} }
// Close the connection to the SMTP server if no email was sent in // Close the connection to the SMTP server if no email was sent in
@ -122,10 +122,10 @@ func StartMailDaemon() {
open = false open = false
err = c.Close() err = c.Close()
if err != nil { if err != nil {
log.Error("Error closing the mail server connection: %s\n", err) log.Errorf("Error closing the mail server connection: %s\n", err)
break break
} }
log.Infof("Closed connection to mail server") log.Info("Closed connection to mail server")
} }
} }
} }