pop3协议参考

原文地址 http://www.pnambic.com/Goodies/POP3Ref.html

 

Protocol Conventions

 

Post Office Protocol, version 3
POP3 RFC 1939, J. Myers & M. Rose
POP3 uses TCP port 110.

Command Responses
All command responses begin with a status line. The status line consists of a status indicator and a keyword possibly followed by additional information. There are currently two status indicators: positive ("+OK") and negative ("-ERR"). Single line command results are generally provided as additional information which follows the status indicator.

Some commands provide a multi-line response which follows a positive status line. After the status line, the server sends additional lines, each terminated by a CRLF pair. When all lines of the response have been sent, a final line is sent, consisting of a termination octet (decimal code 046, ".") and a CRLF pair. If any line of the multi-line response begins with the termination octet, the line is "byte-stuffed" by pre-pending the termination octet to that line of the response. Hence a multi-line response is terminated with the five octets "CRLF.CRLF".

Command Summary
USER name
Defines the user name for access to a maildrop.
 The user name and password string provide authentication and access to a maildrop.

The server may return a positive response even though no such mailbox exists. The server may return a negative response if mailbox exists, but it does not permit plaintext password authentication.
PASS string
Defines the password string for access to a maildrop.
 The user name and password string provide authentication and access to a maildrop.

If a positive response is received, the maildrop is locked and is ready to receive transaction commands.

Since the PASS command has exactly one argument, a POP3 server may treat spaces in the argument as part of the password, instead of as argument separators.
APOP name digest
Provides maildrop access with an encrypted password
 Allows maildrop authentication without sending a password in the clear over the network.

Servers that implement APOP authentication include an RFC822 ‘msg-id’ timestamp in their banner greeting. The `digest' parameter is calculated by applying the MD5 algorithm [RFC1321] to a string consisting of the timestamp (including angle-brackets) followed by a shared secret (e.g. the password). The `digest' parameter itself is a 16-octet value which is sent in hexadecimal format, using lower-case ASCII characters.
QUIT Terminates the session.
 

If messages were marked as deleted, the server attempts to remove them from the maildrop. If an error is encountered while removing messages, some or none of the messages marked as deleted will be removed.

如果消息被标记为删除,服务器会尝试从邮箱删除他们.如果当删除消息时遇到错误,被标记为删除的消息

将会被部分删除或者不删除.


Whether the removal was successful or not, the server then releases any exclusive-access lock on the maildrop and closes the TCP connection.

无论删除是否成功,服务器都会释放独占邮箱的锁以及释放TCP链接.

STAT
Provides ‘drop-listing’ status of the maildrop.

提供邮箱下拉列表的状态

 The minimal drop listing response is an "+OK" followed by a single space, the number of messages in the maildrop, a single space, and the size of the maildrop in octets. More advanced implementations may include other information.

LIST [msg]
Provides ‘scan-listing’ summary of messages in the maildrop.

提供邮箱信息的扫描列表概要

 

If an argument is given, the scan listing for the message follows the positive response header. With no argument, a multi-line response follows with a scan listing for each message in the maildrop.
如果指定一个参数,消息的扫描列表在一个'+'返回头之后.如果没有参数,一个多行的返回在邮箱中每条

消息的一个扫描列表之后
A scan listing consists of the message-number of the message, followed by a single space and the exact size of the message in octets. More advanced implementations may include other information, as parsed from the message.

一个扫描列表由消息的消息数量组成,其次是一个单独的空格和用8进制表示的消息精确的大小.

 

RETR msg
Retrieves a message from the maildrop.

从邮箱中获得消息

 

The message is sent as a multi-line response, being careful to byte-stuff the termination character.

消息被发送当成一个多行的响应,注意字节型结尾的字符.

DELE msg
Mark the msg as deleted from the maildrop.

标记消息为删除从邮箱中

 

Any future reference to the message-number associated with the message in a command generates an error. The server does not actually delete the message until the session enters the UPDATE state via the QUIT command.

任何未来对关联该删除消息的消息号进行引用都会产生一个错误.服务器不会实际删除消息直到该会话输如更新状态通过 QUIT 命令.

NOOP
No operation.
 The server replies with a positive response.
RSET
Reset all messages that are marked as deleted to unmarked.
 The server replies with a positive response.
TOP msg lines
Sends the headers and the requested lines from the indicated msg.
 The headers and lines are sent as a multi-line response. Note that if the number of lines requested is greater than the number of lines in the body, the entire message is sent.
UIDL [msg]
Provides ‘unique id listing’ of messages in the maildrop.
 If an argument is given, the unique-id-listing for the message follows the positive response header. With no argument, a multi-line response follows with a unique-id-listing for each message in the maildrop.

A unique-id-listing consists of the message-number of the message, followed by a single space and the unique-id of the message. No information follows the unique-id.

The unique-id of a message is an arbitrary server-determined string, consisting of one to 70 characters in the range 0x21 to 0x7E, which uniquely identifies a message within a maildrop and which persists across sessions.

Note that messages marked as deleted are not listed.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值