[转]利用telnet进行SMTP的验证

本文转自:http://www.cnblogs.com/rootq/articles/1320266.html

[crazywill@localhost crazywill]$ telnet 192.168.0.1 143      #telnet登录IMAP协议的143端口
Trying 192.168.0.1...
 Connected to xxxxxx
 Escape character is '^]'.
 * OK xxxxxxx System IMap Server Ready
A01 LOGIN abc 123       #用户登录
A01 OK LOGIN completed
A02 LIST "" *           #列出所有信箱列表
* LIST () "/" "INBOX"
 * LIST () "/" "Drafts"
 * LIST () "/" "Sent Items"
 * LIST () "/" "Trash"
 * LIST () "/" "Junk E-mail"
 * LIST () "/" "Virus Items"
 * LIST () "/" "&XfJT0ZABkK5O9g-"
 * LIST () "/" "&g0l6Pw-"
 * LIST () "/" "&XfJT0ZABkK5O9g-/DailyReport"
 * LIST () "/" "Jira"
 * LIST () "/" "Admin"
 * LIST () "/" "&V4NXPpCuTvY-"
A02 OK LIST Completed
A03 Select INBOX         #选择收件箱
* 37 EXISTS
 * 0 RECENT
 * OK [UIDVALIDITY 1] UIDs valid
 * FLAGS (Answered Seen Deleted Draft)
 * OK [PERMANENTFLAGS (Answered Seen Deleted Draft)] Limited
 A03 OK [READ-WRITE] SELECT completed
A04 Search ALL           #查询收件箱所有邮件
* OK X-SEARCH in progress
 * OK X-SEARCH in progress
 * OK X-SEARCH in progress
 * SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
 A04 OK SEARCH completed            # 列出符合条件的邮件序号(ALL表示列出当前信箱INBOX中的所有邮件)
A05 Search new           #查询收件箱所有新邮件
* OK X-SEARCH in progress
 * OK X-SEARCH in progress
 * OK X-SEARCH in progress
 * SEARCH
 A05 OK SEARCH completed            #找不到任何新邮件
A06 Fetch 5 full         #获取第5封邮件的邮件头
* 5 FETCH (INTERNALDATE "27-Jun-2006 14:00:27 +0800" FLAGS (Seen) ENVELOPE ("Tue, 27 Jun 2006 13:56:51 +0800" "test " (("xxxxxx" NIL "xxxx" "xxxxxx")) (("xxxxxx" NIL "xxxx" "xxxxxx")) (("xxxxxx" NIL "xxxx" "xxxxxx")) ((NIL NIL "xxx" "xxxxx")) NIL NIL NIL "<000f01c699ae$7c5014a0$6b01a8c0@xxxxxx.xx>") BODY (("text" "plain" ("charset" "gb2312") NIL NIL "base64" 14 2) ("text" "html" ("charset" "gb2312") NIL NIL "base64" 420 7) "alternative") RFC822.SIZE 1396)
 A06 OK Fetch completed
A07 Fetch 5 rfc822       #获取第5封邮件的完整内容
* 5 FETCH (RFC822 {1396}
 [这里是邮件内容,太长,略...]
A07 OK Fetch completed
A08 Fetch 5 flags        #查询第5封邮件的标志位
A08 OK Fetch completed
A09 Store 5 +flags.silent (deleted)          #设置标志位为删除
A09 OK STORE completed
A10 Expunge              #永久删除当前邮箱INBOX中所有设置了deleted标志的信件
A10 OK EXPUNGE completed
A11 noop                  # 空语句
A11 OK NOOP completed


A20 LOGOUT               #退出
* BYE IMAP4rev1 Server logging out
 A20 OK LOGOUT completed
 Connection closed by foreign host.
 [crazywill@localhost crazywill]$
原文地址:https://www.cnblogs.com/freeliver54/p/4651915.html