add to previous commit, adding multiline smtp responses in dsn

also include api change.
This commit is contained in:
Mechiel Lukkien 2024-02-16 20:13:05 +01:00
parent 50c13965a7
commit fd359d5973
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View file

@ -50,6 +50,7 @@ Below are the incompatible changes between v0.0.9 and v0.0.10, per package.
# smtpclient # smtpclient
- Dial: changed from func(context.Context, *golang.org/x/exp/slog.Logger, Dialer, github.com/mjl-/mox/dns.IPDomain, []net.IP, int, map[string][]net.IP, []net.IP) (net.Conn, net.IP, error) to func(context.Context, *log/slog.Logger, Dialer, github.com/mjl-/mox/dns.IPDomain, []net.IP, int, map[string][]net.IP, []net.IP) (net.Conn, net.IP, error) - Dial: changed from func(context.Context, *golang.org/x/exp/slog.Logger, Dialer, github.com/mjl-/mox/dns.IPDomain, []net.IP, int, map[string][]net.IP, []net.IP) (net.Conn, net.IP, error) to func(context.Context, *log/slog.Logger, Dialer, github.com/mjl-/mox/dns.IPDomain, []net.IP, int, map[string][]net.IP, []net.IP) (net.Conn, net.IP, error)
- Error: old is comparable, new is not
- GatherDestinations: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain) (bool, bool, bool, github.com/mjl-/mox/dns.Domain, []github.com/mjl-/mox/dns.IPDomain, bool, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain) (bool, bool, bool, github.com/mjl-/mox/dns.Domain, []github.com/mjl-/mox/dns.IPDomain, bool, error) - GatherDestinations: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain) (bool, bool, bool, github.com/mjl-/mox/dns.Domain, []github.com/mjl-/mox/dns.IPDomain, bool, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain) (bool, bool, bool, github.com/mjl-/mox/dns.Domain, []github.com/mjl-/mox/dns.IPDomain, bool, error)
- GatherIPs: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain, map[string][]net.IP) (bool, bool, github.com/mjl-/mox/dns.Domain, []net.IP, bool, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain, map[string][]net.IP) (bool, bool, github.com/mjl-/mox/dns.Domain, []net.IP, bool, error) - GatherIPs: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain, map[string][]net.IP) (bool, bool, github.com/mjl-/mox/dns.Domain, []net.IP, bool, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.IPDomain, map[string][]net.IP) (bool, bool, github.com/mjl-/mox/dns.Domain, []net.IP, bool, error)
- GatherTLSA: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.Domain, bool, github.com/mjl-/mox/dns.Domain) (bool, []github.com/mjl-/adns.TLSA, github.com/mjl-/mox/dns.Domain, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.Domain, bool, github.com/mjl-/mox/dns.Domain) (bool, []github.com/mjl-/adns.TLSA, github.com/mjl-/mox/dns.Domain, error) - GatherTLSA: changed from func(context.Context, *golang.org/x/exp/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.Domain, bool, github.com/mjl-/mox/dns.Domain) (bool, []github.com/mjl-/adns.TLSA, github.com/mjl-/mox/dns.Domain, error) to func(context.Context, *log/slog.Logger, github.com/mjl-/mox/dns.Resolver, github.com/mjl-/mox/dns.Domain, bool, github.com/mjl-/mox/dns.Domain) (bool, []github.com/mjl-/adns.TLSA, github.com/mjl-/mox/dns.Domain, error)

View file

@ -897,16 +897,16 @@ func (c *Client) auth(auth func(mechanisms []string, cs *tls.ConnectionState) (s
} }
name, cleartextCreds := a.Info() name, cleartextCreds := a.Info()
abort := func() (int, string, string) { abort := func() (int, string, string, []string) {
// Abort authentication. ../rfc/4954:193 // Abort authentication. ../rfc/4954:193
c.xwriteline("*") c.xwriteline("*")
// Server must respond with 501. // ../rfc/4954:195 // Server must respond with 501. // ../rfc/4954:195
code, secode, firstLine, _ := c.xread() code, secode, firstLine, moreLines := c.xread()
if code != smtp.C501BadParamSyntax { if code != smtp.C501BadParamSyntax {
c.botched = true c.botched = true
} }
return code, secode, firstLine return code, secode, firstLine, moreLines
} }
toserver, last, err := a.Next(nil) toserver, last, err := a.Next(nil)
@ -952,8 +952,8 @@ func (c *Client) auth(auth func(mechanisms []string, cs *tls.ConnectionState) (s
// For failing SCRAM, the client stops due to message about invalid proof. The // For failing SCRAM, the client stops due to message about invalid proof. The
// server still sends an authentication result (it probably should send 501 // server still sends an authentication result (it probably should send 501
// instead). // instead).
xcode, xsecode, firstLine := abort() xcode, xsecode, xfirstLine, xmoreLines := abort()
c.xerrorf(false, xcode, xsecode, firstLine, moreLines, "client aborted authentication: %w", err) c.xerrorf(false, xcode, xsecode, xfirstLine, xmoreLines, "client aborted authentication: %w", err)
} }
c.xwriteline(base64.StdEncoding.EncodeToString(toserver)) c.xwriteline(base64.StdEncoding.EncodeToString(toserver))
} else { } else {