测试是否支持smtp,pop3,imap,webmail。并且支持对应的SSL加密smtps,pop3s,imaps,https。
测试pop3
telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Hello there.
user ppabc\@zhank.com
+OK Password required.
pass test
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
.
quit
+OK Bye-bye.
Connection closed by foreign host.
测试smtp认证
通过以下命令获得ppabc\@zhank.com的用户名及密码的BASE64编码:
perl -e 'use MIME::Base64; print encode_base64("ppabc\@zhank.com")'
cHBhYmNAemhhbmsuY29t
perl -e 'use MIME::Base64; print encode_base64("111111")'
MTExMTEx
然后本机测试,其过程如下
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.zhank.com ESMTP Postfix - by zhank.com
ehlo demo.domain.tld
250-mail.zhank.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
cHBhYmNAemhhbmsuY29t
334 UGFzc3dvcmQ6
MTExMTEx
235 2.7.0 Authentication successful
quit
221 2.0.0 Bye
最后出现235 Authentication Successful 表明认证成功了。
测试smtps
mail# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.localhostadmin.
Escape character is '^]'.
220 mail.zhank.com ESMTP Postfix
ehlo localhost
250-mail.zhank.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
STARTTLS
220 2.0.0 Ready to start TLS
^]
telnet> q
Connection closed.
测试pop3s/imaps
telnet连接本机的993,995端口出现如下提示:
telnet localhost 993
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.localhostadmin.
Escape character is '^]'.
^]
telnet> q
Connection closed.
telnet localhost 995
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.localhostadmin.
Escape character is '^]'.
^]
telnet> q
Connection closed.
也可以在OutLook中如下设置进行测试
本文转自 ppabc 51CTO博客,原文链接:http://blog.51cto.com/ppabc/745515