Files
Robin Jarry 0ec957dfba send: fix double close and swallowed write error
The deferred w.w.Close() caused the underlying writer to always be
closed twice: once via defer and again with the explicit return at
the end. For the SMTP sender this results in calling Quit() on an
already-closed connection.

Remove the defer and instead call w.w.Close() explicitly in each
error path so that the connection is closed exactly once.

Also fix a write error that was silently discarded (return nil instead
of return err).

Fixes: cb1c4c9c62 ("send: ensure crlf line endings")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: septante <septante@memeware.net>
Acked-by: septante <septante@memeware.net>
2026-02-13 08:53:30 +01:00
..
2026-02-13 08:53:30 +01:00