send: fix missing error return

This commit is contained in:
Reto Brunner 2021-02-28 02:04:58 +01:00
parent 8b4f2d148c
commit 8cd2485170

View file

@ -320,6 +320,10 @@ func newSmtpSender(ctx sendCtx) (io.WriteCloser, error) {
return nil, fmt.Errorf("not an smtp protocol %s", ctx.scheme)
}
if err != nil {
return nil, errors.Wrap(err, "Connection failed")
}
saslclient, err := newSaslClient(ctx.auth, ctx.uri)
if err != nil {
conn.Close()