Closed dknecht closed 9 years ago
I've tried to validate it using gmail and my own postfix installation, and can't get that to work at all - they both behave in the same was as MailHog.
telnet doesn't give any useful output, but the postfix log output shows this:
Feb 25 20:29:46 ubuntu postfix/smtpd[7435]: connect from hostnnn-nnn-nnn-nnn.nnnnn-nnn.somehost.com[nnn.nnn.nnn.nnn]
Feb 25 20:29:46 ubuntu postfix/smtpd[7435]: lost connection after CONNECT from hostnnn-nnn-nnn-nnn.nnnnn-nnn.somehost.com[nnn.nnn.nnn.nnn]
Feb 25 20:29:46 ubuntu postfix/smtpd[7435]: disconnect from hostnnn-nnn-nnn-nnn.nnnnn-nnn.somehost.com[nnn.nnn.nnn.nnn]
aside from that, this is invalid use of SMTP protocol - SMTP is conversational, and passing data to telnet (or netcat) via STDIN isn't. even with SMTP pipelining the client is required to wait until the server has confirmed pipelining support after a successful EHLO before it sends multiple commands.
to script an SMTP conversation you could use something like expect - there's an example at the bottom of this page
I tested this with postfix and other mtas with no issues.