fix(cmd): report error when the connection to the mail server failed

When running the testmail command, Vikunja would not stop if it wasn't able to connect to the mail server. This was a regression from 950de7c954.
This change fixes that problem.

Resolves https://kolaente.dev/vikunja/vikunja/issues/2767
This commit is contained in:
kolaente
2024-10-25 19:23:39 +02:00
parent d784e98f8c
commit b5cbe99b0a

View File

@@ -57,7 +57,7 @@ var testmailCmd = &cobra.Command{
return
}
if err := mail.SendTestMail(opts); err != nil &&
strings.HasPrefix(err.Error(), "failed to close connction: not connected to SMTP server") {
!strings.HasPrefix(err.Error(), "failed to close connction: not connected to SMTP server") {
log.Errorf("Error sending test mail: %s", err.Error())
return
}