Telnet连接SMTP服务器发送邮件:
telnet mail.haiyun.me 25
Trying 192.168.1.2...
Connected to smtp.haiyun.me (192.168.1.2).
Escape character is '^]'.
220 mail.www.haiyun.me ESMTP Postfix
mail from:mail@haiyun.me #发件人
250 2.1.0 Ok
rcpt to:test@haiyun.me #收件人
250 2.1.5 Ok
data #输入数据
354 End data with <CR><LF>.<CR><LF>
test mail #邮件内容
. #输入结束
250 2.0.0 Ok: queued as 6239437EA2C
quit #退出
221 2.0.0 Bye
Telnet连接POP服务器接收邮件:
telnet mail.haiyun.me 110
+OK Dovecot ready.
user test #用户
+OK
pass passwd #密码
+OK Logged in.
list #列出当前邮件
+OK 2 messages:
1 972
2 466
.
retr 2 #查看编号2邮件
+OK 466 octets
Return-Path: <mail@haiyun.me>
X-Original-To: test@haiyun.me
Delivered-To: test@haiyun.me
Received: from (test.haiyun.me [192.168.1.3])
by mail.haiyun.me (Postfix) with SMTP id 6239437EA2C
for <test@haiyun.me>; Wed, 4 Jul 2012 12:56:45 +0800 (CST)
Message-Id: <20120704045706.6239437EA2C@mail.haiyun.me>
Date: Wed, 4 Jul 2012 12:56:45 +0800 (CST)
From: mail@haiyun.me
To: undisclosed-recipients:;
test mail
.
quit
+OK Logging out.
Telnet连接IMAP服务器接收邮件:
telnet mail.haiyun.me 143
* OK Dovecot ready.
A01 LOGIN test passwd #登入用户、密码
A01 OK Logged in.
A02 LIST "" * #列出信箱列表
* LIST (\HasNoChildren) "." "INBOX"
A02 OK List completed.
A03 Select "INBOX" #选择信箱
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1341377220] UIDs valid
* OK [UIDNEXT 3] Predicted next UID
A03 OK [READ-WRITE] Select completed.
A04 Search ALL #查询所有邮件
* SEARCH 1 2
A04 OK Search completed.
A05 Fetch 2 full #获取邮件2内容
* 2 FETCH (FLAGS (\Seen) INTERNALDATE "04-Jul-2012 12:57:25 +0800" RFC822.SIZE 466 ENVELOPE ("Wed, 4 Jul 2012 12:56:45 +0800 (CST)" NIL ((NIL NIL "404344922" "qq.com")) ((NIL NIL "404344922" "qq.com")) ((NIL NIL "404344922" "qq.com")) ((NIL NIL "undisclosed-recipients" NIL)(NIL NIL "" "MISSING_DOMAIN")(NIL NIL NIL NIL)) NIL NIL NIL "<20120704045706.6239437EA2C@mail.www.haiyun.me>") BODY ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 11 1))
A05 OK Fetch completed.
A06 logout #登出
* BYE Logging out
A06 OK Logout completed.