You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An SMTP server that never sends its greeting makes an email send hang #2039
pkg/mailer sends through gopkg.in/mail.v2 v2.3.1. Its Dialer.Dial reads the server greeting (smtp.go:91) before it sets the connection deadline (smtp.go:96-98). If the SMTP server accepts the connection but never sends its greeting, the send blocks with no deadline.
Every email goes through this path: the login OTP (core/authenticate/strategy/mail_otp.go:95) and magic link (core/authenticate/strategy/mail_link.go:75), invitations (core/invitation/service.go:222), PAT alerts (core/userpat/alert_service.go:244), and the organization delete email (core/deleter/delete_notice.go:249). #2034 adds the user delete email on the same path. Most of these send inside a request, so the request blocks with the send.
It needs a mail server that accepts the connection and then stays silent, so it is rare.
Possible fixes:
Set the deadline right after the connection opens. The library exposes its dial as mail.NetDialTimeout (smtp.go:77), so pkg/mailer can wrap it once at startup.
Move to an SMTP library whose send takes a context.
Activity