From 42aa38ddebb63fafdcb6f6c85871f1c0d49d5ec8 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Tue, 29 Jul 2025 01:20:55 +1200 Subject: [PATCH 1/2] Fix: Fix sendmail when using an `--smtp-addr :` (#542) --- sendmail/cmd/smtp.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sendmail/cmd/smtp.go b/sendmail/cmd/smtp.go index 47aae9a..2dd32e8 100644 --- a/sendmail/cmd/smtp.go +++ b/sendmail/cmd/smtp.go @@ -8,7 +8,6 @@ import ( "net" "net/mail" "net/smtp" - "net/url" "os" "strings" @@ -75,12 +74,6 @@ func Send(addr string, from string, to []string, msg []byte) error { } func sendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) error { - addrParsed, err := url.Parse(addr) // ensure addr is a valid URL - if err != nil { - return fmt.Errorf("invalid address: %s", addr) - } - - host := addrParsed.Host if err := validateLine(from); err != nil { return err } @@ -102,7 +95,7 @@ func sendMail(addr string, a smtp.Auth, from string, to []string, msg []byte) er } if ok, _ := c.Extension("STARTTLS"); ok { - config := &tls.Config{ServerName: host, InsecureSkipVerify: true} // #nosec + config := &tls.Config{ServerName: addr, InsecureSkipVerify: true} // #nosec if err = c.StartTLS(config); err != nil { return err } From bb2793354a99bfbb5dbe14eca0f56de3fe5ad622 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Tue, 29 Jul 2025 01:21:53 +1200 Subject: [PATCH 2/2] Release v1.27.3 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 998da6c..5164181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Notable changes to Mailpit will be documented in this file. +## [v1.27.3] + +### Fix +- Fix sendmail when using an `--smtp-addr :` ([#542](https://github.com/axllent/mailpit/issues/542)) + + ## [v1.27.2] ### Feature