mirror of
https://github.com/axllent/mailpit.git
synced 2026-06-28 06:56:06 +00:00
When a message is forwarded or released, Mailpit introduces itself as `localhost` to the upstream server. This happens because `net/smtp` forces the value to be `localhost` if `client.Hello` is not called. This is explicitly documented at https://pkg.go.dev/net/smtp#Client.Hello Therefore, both `internal/smtpd/relay.go` (`createRelaySMTPClient`) and `internal/smtpd/forward.go` (`createForwardingSMTPClient`) should either call `client.Hello(os.Hostname())` or create a config (perhaps `config.HeloHostname`) and use `client.Hello()` with that value immediately before returning from either of those functions. (The HELO/EHLO command comes after TLS negotiation but before any other SMTP commands.) This commit does the former. Without this feature, Mailpit cannot be used in combination with Google Workspace's SMTP Relay functionality, as it rejects any connection that identifies itself as `localhost`. Relates to #146