最后更新于

使用telnet命令行访问邮件收件服务器

分类: 邮箱

上一篇,提到 使用telnet命令行访问邮件smtp发件服务器发送邮件 ,那如何使用telnet访问邮件收件服务器呢?在该文末,提到登录方式相同,但其实不然。

经过测试,访问腾讯企业邮件,确实可以通过auth login来登录:

telnet pop.exmail.qq.com 110
auth login
xxx
xxx

但我们发现访问我们自建的james服务器则不行,而需要使用下面命令形式来登录:

USER user1
+OK
PASS pass1
+OK Welcome user1

说明:

上述示例user1不带邮箱后缀,可能与服务器邮箱设置有关,pass1是密码明文。

POP3命令详细说明:

CommandDescriptionExample
USER [username]1st login commandUSER Stan
+OK Please enter a password
PASS [password]2nd login commandPASS SeCrEt
+OK valid logon
QUITLogs out and saves any changesQUIT
+OK Bye-bye.
STATReturns total number of messages and total sizeSTAT
+OK 2 320
LISTLists all messagesLIST
+OK 2 messages (320 octets)
1 120
2 200
LIST 2
+OK 2 200
RETR [message]Retrieves the whole messageRETR 1
+OK 120 octets follow.
***
DELE [message]Deletes the specified messageDELE 2
+OK message deleted
NOOPThe POP3 server does nothing, it merely replies with a positive response.NOOP
+OK
RSETUndelete the message if any marked for deletionRSET
+OK maildrop has 2 messages (320 octets)
TOP [message] [number]Returns the headers and number of lines from the messageTOP 1 10
+OK
***