怎么通过telnet测试smtp发信:
测试SMTP认证:
通过perl命令获得postmaster@extmail.org的用户名和密码的base64编码:
# perl -e 'use MIME::Base64; print encode_base64("postmaster\@extmail.org")'
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
# perl -e 'use MIME::Base64; print encode_base64("extmail")'
ZXh0bWFpbA==
# telnet mail.extmail.org 25
Trying 192.168.1.252...
Connected to mail.extmail.org (192.168.1.252).
Escape character is '^]'.
220 mail.extmail.org ESMTP Postfix -uplooking
ehlo mail.extmail.org //手动输入的:
250-mail.extmail.org
250-PIPELINING
250-SIZE 5242880
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login //手动输入的
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBleHRtYWlsLm9yZw== //手动复制
334 UGFzc3dvcmQ6
ZXh0bWFpbA== //手动复制的
235 2.7.0 Authentication successful
mail from:crash@extmail.org //输入内容,注意此处test的base64编码一定与上面的认证信息对应!!!
250 2.1.0 Ok
rcpt to:crash@extmail.org //输入内容,要给谁发信
250 2.1.5 Ok
data //输入内容
354 End data with <CR><LF>.<CR><LF>
subject: this is the subject //主题,标题信息在这个地方写
xian zai shi zheng wen //正文信息
jieshu.
.
250 2.0.0 Ok: queued as B817A4BBF63
quit
221 2.0.0 Bye
Connection closed by foreign host.