MCPcopy Index your code
hub / github.com/coder/coder / smarthost

Method smarthost

coderd/notifications/dispatch/smtp.go:531–543  ·  view source on GitHub ↗

smarthost retrieves the host/port defined and validates them. Does not allow overriding. nolint:revive // documented.

()

Source from the content-addressed store, hash-verified

529// Does not allow overriding.
530// nolint:revive // documented.
531func (s *SMTPHandler) smarthost() (string, string, error) {
532 smarthost := strings.TrimSpace(string(s.cfg.Smarthost))
533 if smarthost == "" {
534 return "", "", ErrValidationNoSmarthost
535 }
536
537 host, port, err := net.SplitHostPort(string(s.cfg.Smarthost))
538 if err != nil {
539 return "", "", xerrors.Errorf("split host port: %w", err)
540 }
541
542 return host, port, nil
543}
544
545// hello retrieves the hostname identifying the SMTP server.
546// Does not allow overriding.

Callers 2

dispatchMethod · 0.95
tlsConfigMethod · 0.95

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected