From b5cbe99b0a82a2d6a86d401bb53ec44ae33bb108 Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 25 Oct 2024 19:23:39 +0200 Subject: [PATCH] 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 950de7c954ef3799051d73bc9b728558cf166377. This change fixes that problem. Resolves https://kolaente.dev/vikunja/vikunja/issues/2767 --- pkg/cmd/testmail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/testmail.go b/pkg/cmd/testmail.go index af5b1e49b..6f660a106 100644 --- a/pkg/cmd/testmail.go +++ b/pkg/cmd/testmail.go @@ -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 }