Sending email through telnet can be a useful tool when testing mail functionality, testing for open relays, or sending mail from admin scripts. This is something I don’t use often enough, so I’ve created this blog as a reminder.
I tried these steps as per the above blog.
But I am getting 501 5.5.4 Syntax: DATA.
This is the full syntax that I tried.
[root@duplicate-website ~]# telnet localhost 25 Trying ::1... Connected to localhost. Escape character is '^]'. 220 duplicate-website.com ESMTP Postfix mail from: [email protected] 250 2.1.0 Ok rcpt to: [email protected] 250 2.1.5 Ok data my message sucks 501 5.5.4 Syntax: DATA DATA my message sucks 501 5.5.4 Syntax: DATA subject: my message sucks 221 2.7.0 Error: I can break rules, too. Goodbye. Connection closed by foreign host.