Skip to content

Commit 66d1a69

Browse files
nit: trim smarthost
1 parent 4175bc8 commit 66d1a69

File tree

1 file changed

+3
-2
lines changed
  • coderd/notifications/dispatch

1 file changed

+3
-2
lines changed

coderd/notifications/dispatch/smtp.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,12 @@ func (s *SMTPHandler) validateToAddrs(to string) ([]string, error) {
520520
// Does not allow overriding.
521521
// nolint:revive // documented.
522522
func (s *SMTPHandler) smarthost() (string, string, error) {
523-
if s.cfg.Smarthost.String() == "" {
523+
hostport := strings.TrimSpace(s.cfg.Smarthost.String())
524+
if hostport == "" {
524525
return "", "", ValidationNoSmarthostErr
525526
}
526527

527-
host, port, err := net.SplitHostPort(s.cfg.Smarthost.String())
528+
host, port, err := net.SplitHostPort(hostport)
528529
if err != nil {
529530
return "", "", xerrors.Errorf("split host port: %w", err)
530531
}

0 commit comments

Comments
 (0)