From eba1b652014e1a68611826f530a89972c3cdbef8 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Sat, 7 Jan 2023 21:35:27 -0500 Subject: [PATCH] Fix copypasta comparison error And a godot error --- cmd/vela-email/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/vela-email/plugin.go b/cmd/vela-email/plugin.go index 3513118..ca5b3db 100644 --- a/cmd/vela-email/plugin.go +++ b/cmd/vela-email/plugin.go @@ -32,7 +32,7 @@ var ( // ErrorMissingSMTPParam is returned when the plugin is missing a smtp host or port parameter. ErrorMissingSMTPParam = errors.New("missing smtp parameter (host/port)") - // ErrorAuthSpecifiedButCredentialsMissing is returned when the plugin is missing credentials when auth type was specified + // ErrorAuthSpecifiedButCredentialsMissing is returned when the plugin is missing credentials when auth type was specified. ErrorAuthSpecifiedButCredentialsMissing = errors.New("missing credentials when auth type was specified") ) @@ -144,7 +144,7 @@ func (p *Plugin) Validate() error { return ErrorMissingSMTPParam } - if len(p.Auth) > 0 && !(len(p.SMTPHost.Username) > 0 && len(p.SMTPHost.Username) > 0) { + if len(p.Auth) > 0 && !(len(p.SMTPHost.Username) > 0 && len(p.SMTPHost.Password) > 0) { return ErrorAuthSpecifiedButCredentialsMissing }