怎麼通過telnet測試smtp發信:
測試SMTP認證:
通過perl指令獲得[email protected]的使用者名和密碼的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:[email protected] //輸入内容,注意此處test的base64編碼一定與上面的認證資訊對應!!!
250 2.1.0 Ok
rcpt to:[email protected] //輸入内容,要給誰發信
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.