From 83d7dd99e8ec9b0e7b2424b0cda806917b7ec0e0 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Mon, 20 Feb 2023 15:48:34 -0500 Subject: [PATCH] Fix comments --- server/smtp_server.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/smtp_server.go b/server/smtp_server.go index f2c9dc9b..f6844521 100644 --- a/server/smtp_server.go +++ b/server/smtp_server.go @@ -94,7 +94,7 @@ func (s *smtpSession) Rcpt(to string) error { if !strings.HasSuffix(to, "@"+conf.SMTPServerDomain) { return errInvalidDomain } - // remove @ntfy.sh from end of email + // Remove @ntfy.sh from end of email to = strings.TrimSuffix(to, "@"+conf.SMTPServerDomain) if conf.SMTPServerAddrPrefix != "" { if !strings.HasPrefix(to, conf.SMTPServerAddrPrefix) { @@ -103,7 +103,7 @@ func (s *smtpSession) Rcpt(to string) error { // remove ntfy- from beginning of email to = strings.TrimPrefix(to, conf.SMTPServerAddrPrefix) } - // if email contains token, split topic and token + // If email contains token, split topic and token if strings.Contains(to, "+") { parts := strings.Split(to, "+") to = parts[0] @@ -175,7 +175,6 @@ func (s *smtpSession) publishMessage(m *message) error { if err != nil { remoteAddr = s.conn.Conn().RemoteAddr().String() } - // Call HTTP handler with fake HTTP request url := fmt.Sprintf("%s/%s", s.backend.config.BaseURL, m.Topic) req, err := http.NewRequest("POST", url, strings.NewReader(m.Message))