[root@server~/]# telnet localhost 25 Trying 127.0.0.1...
Connected to localhost. Escape character is '^]'. 220
server.domain.com.br ESMTP Postfix (2.1.0) MAIL FROM:
teste@dominio.com.br 250 Ok RCPT TO: teste@dominio.com.br 250
Ok DATA 354 End data with <CR><LF>.<CR><LF> teste .
250 Ok: queued as 7B41F4665A QUIT 221 Bye Connection
closed by foreign host.
注:以上来自netkiller的postfix文档,偷懒,直接用现成的。
Trying 127.0.0.1... Connected to localhost. Escape character
is '^]'. 220 server.domain.com.br ESMTP Postfix (2.1.0)
这些东西是系统输出信息,说明已经连接上了,而且这个smtp服务器是postfix做的。
“MAIL FROM: teste@dominio.com.br”这个命令指明了发件地址是teste@dominio.com.br,“250
Ok”说明这条命令被服务器接受并正确执行,这类似http协议的200、404、500等状态代码。接下来的“RCPT TO:
teste@dominio.com.br”指明了收件地址是teste@dominio.com.br。
引用:
DATA 354 End data with <CR><LF>.<CR><LF> teste
. 这一段是输入邮件正文,输入“DATA”以后系统提示使用“<回车>.<回车>”来结束输入,正文内容是“teste”。