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
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ var testmailCmd = &cobra.Command{
return return
} }
if err := mail.SendTestMail(opts); err != nil && 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()) log.Errorf("Error sending test mail: %s", err.Error())
return return
} }