It looks like there has been a regression in the smtp-server library. Support for useProxy was added in this commit: https://github.com/nodemailer/smtp-server/commit/1a5754e3acc88099849baecc7435a35d0850e455 of smtp-server. However, current code of smtp-server no longer has the code that deals with the useProxy option, so as of now useProxy seems to be ignored,
This means that if, for instance, one is trying to use the zone-mta MTA, which uses smtp-server, with useProxy set as an option, & with haproxy set to use PROXY protocol, the proxied connection will always close with a '421 You talk too soon' error, since haproxy is sending it PROXY information before the server HELO, & smtp-server isn't handling this.
It looks like there has been a regression in the smtp-server library. Support for useProxy was added in this commit: https://github.com/nodemailer/smtp-server/commit/1a5754e3acc88099849baecc7435a35d0850e455 of smtp-server. However, current code of smtp-server no longer has the code that deals with the useProxy option, so as of now useProxy seems to be ignored,
This means that if, for instance, one is trying to use the zone-mta MTA, which uses smtp-server, with useProxy set as an option, & with haproxy set to use PROXY protocol, the proxied connection will always close with a '421 You talk too soon' error, since haproxy is sending it PROXY information before the server HELO, & smtp-server isn't handling this.