protocols:hf-pop
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| protocols:hf-pop [2018/08/14 16:14] – [F.4.4 The TRANSACTION State] root | protocols:hf-pop [2018/08/20 12:43] (current) – [The UPDATE State] root | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| so read carefully. | so read carefully. | ||
| - | ===== F.4.1 Introduction ===== | + | ===== Introduction ===== |
| It will in general be impractical to maintain a message transport system (MTS) over HF radio | It will in general be impractical to maintain a message transport system (MTS) over HF radio | ||
| Line 28: | Line 28: | ||
| establishes an HMTP connection to its relay host and sends all mail to it. | establishes an HMTP connection to its relay host and sends all mail to it. | ||
| - | ===== F.4.2 Basic Operation ===== | + | ===== Basic Operation ===== |
| Initially, the server host starts the HF-POP3 service by listening for incoming connections | Initially, the server host starts the HF-POP3 service by listening for incoming connections | ||
| Line 83: | Line 83: | ||
| messages or sending any response to the client. | messages or sending any response to the client. | ||
| - | ===== F.4.3 The AUTHORIZATION State ===== | + | ===== The AUTHORIZATION State ===== |
| Once the connection has been opened by a HF-POP3 client, the HF-POP3 server shall issue a | Once the connection has been opened by a HF-POP3 client, the HF-POP3 server shall issue a | ||
| Line 95: | Line 95: | ||
| shall be used for this purpose. | shall be used for this purpose. | ||
| + | ==== The APOP command ==== | ||
| + | |||
| + | __Usage:__ | ||
| APOP name digest | APOP name digest | ||
| + | |||
| + | __Arguments: | ||
| + | A string identifying a mailbox and a MD5 digest string (both required) | ||
| + | |||
| + | __Restrictions: | ||
| + | May only be given in the AUTHORIZATION state after the POP3 greeting or after | ||
| + | an unsuccessful USER or PASS command | ||
| + | |||
| + | __Discussion: | ||
| | | ||
| - | Arguments: | + | In the context of this standard, the APOP command provides both origin |
| - | + | authentication and replay protection. An HF-POP3 servers shall include a timestamp | |
| - | a string identifying a mailbox and a MD5 digest string (both required) | + | in its banner greeting. The syntax of the timestamp corresponds to the `msg-id' |
| - | + | [RFC822], and MUST be different each time the POP3 server issues a banner | |
| - | Restrictions: | + | greeting. For example, on a UNIX implementation in which a separate UNIX |
| - | may only be given in the AUTHORIZATION state after the POP3 greeting or after | + | process is used for each instance of a POP3 server, the syntax of the timestamp might |
| - | an unsuccessful USER or PASS command | + | be: |
| - | + | ||
| - | Discussion: | + | |
| - | + | ||
| - | | + | |
| - | authentication and replay protection. An HF-POP3 servers shall include a timestamp | + | |
| - | in its banner greeting. The syntax of the timestamp corresponds to the `msg-id' | + | |
| - | [RFC822], and MUST be different each time the POP3 server issues a banner | + | |
| - | greeting. For example, on a UNIX implementation in which a separate UNIX | + | |
| - | process is used for each instance of a POP3 server, the syntax of the timestamp might | + | |
| - | be: | + | |
| - | + | ||
| < | < | ||
| - | | + | |
| - | where `process-ID' | + | where `process-ID' |
| - | value of the system clock, and hostname is the fully-qualified domain-name | + | value of the system clock, and hostname is the fully-qualified domain-name |
| - | corresponding to the host where the POP3 server is running. | + | corresponding to the host where the POP3 server is running. |
| - | + | ||
| - | The POP3 client makes note of this timestamp, and then issues the APOP command. | + | The POP3 client makes note of this timestamp, and then issues the APOP command. |
| - | The `name' parameter has identical semantics to the `name' parameter of the USER | + | The `name' parameter has identical semantics to the `name' parameter of the USER |
| - | command. The `digest' | + | command. The `digest' |
| - | [RFC1321] to a string consisting of the timestamp (including angle-brackets) | + | [RFC1321] to a string consisting of the timestamp (including angle-brackets) |
| - | followed by a shared secret. This shared secret is a string known only to the POP3 | + | followed by a shared secret. This shared secret is a string known only to the POP3 |
| - | client and server. Great care should be taken to prevent unauthorized disclosure of | + | client and server. Great care should be taken to prevent unauthorized disclosure of |
| - | the secret, as knowledge of the secret will allow any entity to successfully | + | the secret, as knowledge of the secret will allow any entity to successfully |
| - | masquerade as the named user. The `digest' | + | masquerade as the named user. The `digest' |
| - | which is sent in hexadecimal format, using lower-case ASCII characters. | + | which is sent in hexadecimal format, using lower-case ASCII characters. |
| - | + | ||
| - | When the POP3 server receives the APOP command, it verifies the digest provided. | + | When the POP3 server receives the APOP command, it verifies the digest provided. |
| - | If the digest is correct, the POP3 session enters the TRANSACTION state and the | + | If the digest is correct, the POP3 session enters the TRANSACTION state and the |
| - | POP3 server issues a positive response including the LIST response for the maildrop, | + | POP3 server issues a positive response including the LIST response for the maildrop, |
| - | as shown below. Otherwise, a negative response is issued and the POP3 session | + | as shown below. Otherwise, a negative response is issued and the POP3 session |
| - | remains in the AUTHORIZATION state. | + | remains in the AUTHORIZATION state. |
| Note that as the length of the shared secret increases, so does the difficulty of deriving it. As | Note that as the length of the shared secret increases, so does the difficulty of deriving it. As | ||
| Line 141: | Line 143: | ||
| shown below). | shown below). | ||
| - | Possible | + | __Possible |
| S: +OK maildrop locked and ready; maildrop has 1 message (320 octets) | S: +OK maildrop locked and ready; maildrop has 1 message (320 octets) | ||
| S: 1 120 | S: 1 120 | ||
| Line 148: | Line 150: | ||
| S: -ERR permission denied | S: -ERR permission denied | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| S: +OK POP3 server ready < | S: +OK POP3 server ready < | ||
| C: APOP mrose c4c9334bac560ecc979e58001b3e22fb | C: APOP mrose c4c9334bac560ecc979e58001b3e22fb | ||
| Line 154: | Line 156: | ||
| S: 1 369 | S: 1 369 | ||
| | | ||
| - | | + | In this example, the shared secret is the string |
| - | algorithm is applied to the string | + | algorithm is applied to the string |
| | | ||
| < | < | ||
| | | ||
| - | | + | which produces a digest value of '' |
| - | + | ||
| - | | + | |
| Once the POP3 server has determined through the use of the APOP command that the client | Once the POP3 server has determined through the use of the APOP command that the client | ||
| Line 184: | Line 184: | ||
| message in a maildrop is assigned a message-number of " | message in a maildrop is assigned a message-number of " | ||
| responses, all message-numbers and message sizes are expressed in base-10 (i.e., decimal). | responses, all message-numbers and message sizes are expressed in base-10 (i.e., decimal). | ||
| - | | + | |
| + | ==== The QUIT command ==== | ||
| Here is the summary for the QUIT command when used in the AUTHORIZATION state: | Here is the summary for the QUIT command when used in the AUTHORIZATION state: | ||
| QUIT | QUIT | ||
| | | ||
| - | Arguments: none | + | __Arguments:__ none |
| | | ||
| - | Restrictions: none | + | __Restrictions:__ none |
| | | ||
| - | Possible | + | __Possible |
| +OK | +OK | ||
| - | | + | |
| - | | + | __Examples:__ |
| C: QUIT | C: QUIT | ||
| S: +OK dewey POP3 server signing off | S: +OK dewey POP3 server signing off | ||
| - | ===== F.4.4 The TRANSACTION State ===== | + | ===== The TRANSACTION State ===== |
| Once the client has successfully identified itself to the POP3 server and the POP3 server has | Once the client has successfully identified itself to the POP3 server and the POP3 server has | ||
| Line 212: | Line 214: | ||
| Here are the POP3 commands valid in the TRANSACTION state: | Here are the POP3 commands valid in the TRANSACTION state: | ||
| + | ==== The LIST Command ==== | ||
| + | |||
| + | __Usage:__ | ||
| LIST [msg] | LIST [msg] | ||
| | | ||
| - | Arguments: | + | __Arguments:__ |
| - | a message-number (optional), which, if present, may NOT | + | a message-number (optional), which, if present, may NOT |
| - | refer to a message marked as deleted | + | refer to a message marked as deleted |
| - | + | ||
| - | | + | __Restrictions:__ |
| - | may only be given in the TRANSACTION state | + | may only be given in the TRANSACTION state |
| - | Discussion: | + | __Discussion:__ |
| - | If an argument was given and the POP3 server issues a positive response with a line | + | If an argument was given and the POP3 server issues a positive response with a line |
| - | containing information for that message. This line is called a "scan listing" | + | containing information for that message. This line is called a "scan listing" |
| - | message. | + | message. |
| If no argument was given and the POP3 server issues a positive response, then the response | If no argument was given and the POP3 server issues a positive response, then the response | ||
| Line 241: | Line 246: | ||
| Note that messages marked as deleted are not listed. | Note that messages marked as deleted are not listed. | ||
| - | Possible | + | __Possible |
| +OK scan listing follows | +OK scan listing follows | ||
| -ERR no such message | -ERR no such message | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: LIST | C: LIST | ||
| S: +OK 2 messages (320 octets) | S: +OK 2 messages (320 octets) | ||
| Line 258: | Line 263: | ||
| S: -ERR no such message, only 2 messages in maildrop | S: -ERR no such message, only 2 messages in maildrop | ||
| + | ==== The RETR Command ==== | ||
| + | |||
| + | __Usage:__ | ||
| RETR nn | RETR nn | ||
| - | | + | |
| - | | + | __Arguments:__ |
| - | a message-number (optional) which may NOT refer to a message marked as deleted | + | a message-number (optional) which may NOT refer to a message marked as deleted |
| - | + | ||
| - | | + | __Restrictions:__ |
| - | may only be given in the TRANSACTION state | + | may only be given in the TRANSACTION state |
| - | + | ||
| - | | + | __Discussion:__ |
| - | If the POP3 server issues a positive response, then the response given is multi-line. If | + | If the POP3 server issues a positive response, then the response given is multi-line. If |
| - | an argument was given, after the initial +OK, the POP3 server sends the message | + | an argument was given, after the initial +OK, the POP3 server sends the message |
| - | corresponding to the given message-number, | + | corresponding to the given message-number, |
| - | termination character (as with all multi-line responses). If no argument was given, | + | termination character (as with all multi-line responses). If no argument was given, |
| - | the server sends all messages in the drop which are not marked as deleted. Use UIDL | + | the server sends all messages in the drop which are not marked as deleted. Use UIDL |
| - | to identify boundary between messages? If so, need to include the UIDL response as | + | to identify boundary between messages? If so, need to include the UIDL response as |
| - | part of the response to APOP. | + | part of the response to APOP. |
| - | + | ||
| - | | + | __Possible |
| +OK message nn follows | +OK message nn follows | ||
| +OK m messages follow | +OK m messages follow | ||
| -ERR no such message | -ERR no such message | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: RETR 1 | C: RETR 1 | ||
| S: +OK 120 octets | S: +OK 120 octets | ||
| Line 286: | Line 294: | ||
| S: . | S: . | ||
| + | ==== The DELE Command ==== | ||
| + | |||
| + | __Usage:__ | ||
| DELE msg | DELE msg | ||
| - | | + | |
| - | | + | __Arguments:__ |
| - | a message-number (required) which may NOT refer to a message marked as deleted | + | a message-number (required) which may NOT refer to a message marked as deleted |
| - | Restrictions: | + | Restrictions: |
| - | may only be given in the TRANSACTION state | + | may only be given in the TRANSACTION state |
| - | + | ||
| - | | + | __Discussion:__ |
| - | The POP3 server marks the message as deleted. Any future reference to the | + | The POP3 server marks the message as deleted. Any future reference to the |
| - | message-number associated with the message in a POP3 command generates an | + | message-number associated with the message in a POP3 command generates an |
| - | error. The POP3 server does not actually delete the message until the POP3 session | + | error. The POP3 server does not actually delete the message until the POP3 session |
| - | enters the UPDATE state. | + | enters the UPDATE state. |
| - | + | ||
| - | | + | __Possible |
| +OK message deleted | +OK message deleted | ||
| -ERR no such message | -ERR no such message | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: DELE 1 | C: DELE 1 | ||
| S: +OK message 1 deleted | S: +OK message 1 deleted | ||
| Line 310: | Line 321: | ||
| S: -ERR message 2 already deleted | S: -ERR message 2 already deleted | ||
| + | ==== The RSET Command ==== | ||
| + | |||
| + | __Usage:__ | ||
| RSET | RSET | ||
| - | Arguments: none | + | |
| + | __Arguments:__ none | ||
| | | ||
| - | Restrictions: | + | __Restrictions:__ |
| - | may only be given in the TRANSACTION state | + | may only be given in the TRANSACTION state |
| | | ||
| - | Discussion: | + | __Discussion:__ |
| - | If any messages have been marked as deleted by the POP3 server, they are unmarked. | + | If any messages have been marked as deleted by the POP3 server, they are unmarked. |
| - | The POP3 server then replies with a positive response. | + | The POP3 server then replies with a positive response. |
| | | ||
| - | Possible | + | __Possible |
| +OK | +OK | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: RSET | C: RSET | ||
| S: +OK maildrop has 2 messages (320 octets) | S: +OK maildrop has 2 messages (320 octets) | ||
| + | ==== The STAT Command ==== | ||
| + | |||
| + | __Usage:__ | ||
| STAT | STAT | ||
| | | ||
| - | Arguments: none | + | __Arguments:__ none |
| | | ||
| - | Restrictions: | + | __Restrictions:__ |
| may only be given in the TRANSACTION state | may only be given in the TRANSACTION state | ||
| | | ||
| - | Discussion: | + | __Discussion:__ |
| - | The POP3 server issues a positive response with a line containing information for the | + | The POP3 server issues a positive response with a line containing information for the |
| - | maildrop. This line is called a "drop listing" | + | maildrop. This line is called a "drop listing" |
| In order to simplify parsing, all POP3 servers are required to use a certain format for drop | In order to simplify parsing, all POP3 servers are required to use a certain format for drop | ||
| Line 345: | Line 363: | ||
| Note that messages marked as deleted are not counted in either total. | Note that messages marked as deleted are not counted in either total. | ||
| - | Possible | + | __Possible |
| +OK nn mm | +OK nn mm | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: STAT | C: STAT | ||
| S: +OK 2 320 | S: +OK 2 320 | ||
| - | | + | ==== The UIDL Command |
| + | |||
| + | __Usage: | ||
| + | UIDL [msg] | ||
| | | ||
| - | Arguments: | + | __Arguments:__ |
| - | a message-number (optional), which, if present, may NOT refer to a message marked | + | a message-number (optional), which, if present, may NOT refer to a message marked |
| - | as deleted | + | as deleted |
| | | ||
| - | Restrictions: | + | __Restrictions:__ |
| - | may only be given in the TRANSACTION state. | + | may only be given in the TRANSACTION state. |
| | | ||
| - | Discussion: | + | __Discussion:__ |
| - | If an argument was given and the POP3 server issues a positive response with a line | + | If an argument was given and the POP3 server issues a positive response with a line |
| - | containing information for that message. This line is called a " | + | containing information for that message. This line is called a " |
| - | that message. | + | that message. |
| | | ||
| - | | + | If no argument was given, then the response given is multi-line. After the initial |
| - | +OK, for each message in the maildrop, the HF-POP3 server responds with a line | + | +OK, for each message in the maildrop, the HF-POP3 server responds with a line |
| - | containing information for that message. This line is called a " | + | containing information for that message. This line is called a " |
| - | that message. | + | that message. |
| | | ||
| - | | + | In order to simplify parsing, all POP3 servers are required to use a certain format for |
| - | unique-id listings. A unique-id listing consists of the message-number of the | + | unique-id listings. 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 | + | message, followed by a single space and the unique-id of the message. No |
| - | information follows the unique-id in the unique-id listing. | + | information follows the unique-id in the unique-id listing. |
| | | ||
| - | | + | 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 | + | to 70 characters in the range 0x21 to 0x7E, which uniquely identifies a message |
| - | within a maildrop and which persists across sessions. This persistence is required | + | within a maildrop and which persists across sessions. This persistence is required |
| - | even if a session ends without entering the UPDATE state. The server should never | + | even if a session ends without entering the UPDATE state. The server should never |
| - | reuse an unique-id in a given maildrop, for as long as the entity using the unique-id | + | reuse an unique-id in a given maildrop, for as long as the entity using the unique-id |
| - | exists. | + | exists. |
| - | + | ||
| - | Note that messages marked as deleted are not listed. | + | |
| | | ||
| - | While it is generally preferable for server implementations to store arbitrarily | + | Note that messages marked |
| - | assigned unique-ids in the maildrop, this specification is intended to permit uniqueids | + | |
| - | to be calculated | + | |
| - | situation where two identical copies of a message in a maildrop have the same | + | |
| - | unique-id. | + | |
| | | ||
| - | Possible | + | While it is generally preferable for server implementations to store arbitrarily |
| + | assigned unique-ids in the maildrop, this specification is intended to permit uniqueids | ||
| + | to be calculated as a hash of the message. Clients should be able to handle a | ||
| + | situation where two identical copies of a message in a maildrop have the same | ||
| + | unique-id. | ||
| + | |||
| + | __Possible | ||
| +OK unique-id listing follows | +OK unique-id listing follows | ||
| -ERR no such message | -ERR no such message | ||
| | | ||
| - | Examples: | + | __Examples:__ |
| C: UIDL | C: UIDL | ||
| S: +OK | S: +OK | ||
| Line 408: | Line 429: | ||
| S: -ERR no such message, only 2 messages in maildrop | S: -ERR no such message, only 2 messages in maildrop | ||
| - | ===== F.4.5 The UPDATE State ===== | + | ===== The UPDATE State ===== |
| + | |||
| + | When the client issues the QUIT command from the TRANSACTION state, the POP3 | ||
| + | session enters the UPDATE state. (Note that if the client issues the QUIT command from the | ||
| + | AUTHORIZATION state, the POP3 session terminates but does NOT enter the UPDATE | ||
| + | state.) | ||
| + | |||
| + | If a session terminates for some reason other than a client-issued QUIT command, the POP3 | ||
| + | session does NOT enter the UPDATE state and MUST not remove any messages from the | ||
| + | maildrop. | ||
| + | |||
| + | ==== The QUIT Command ==== | ||
| + | |||
| + | __Usage: | ||
| + | QUIT | ||
| + | |||
| + | __Arguments: | ||
| + | |||
| + | __Restrictions: | ||
| + | |||
| + | __Discussion: | ||
| + | The POP3 server removes all messages marked as deleted from the maildrop and | ||
| + | replies as to the status of this operation. If there is an error, such as a resource | ||
| + | shortage, encountered while removing messages, the maildrop may result in having | ||
| + | some or none of the messages marked as deleted be removed. In no case may the | ||
| + | server remove any messages not marked as deleted. | ||
| + | |||
| + | Whether the removal was successful or not, the server then releases any exclusiveaccess | ||
| + | lock on the maildrop and closes the connection | ||
| + | |||
| + | __Possible Responses: | ||
| + | +OK | ||
| + | -ERR some deleted messages not removed | ||
| + | |||
| + | __Examples: | ||
| + | C: QUIT | ||
| + | S: +OK dewey POP3 server signing off (maildrop empty) | ||
| + | ... | ||
| + | C: QUIT | ||
| + | S: +OK dewey POP3 server signing off (2 messages left) | ||
| + | ... | ||
| + | |||
| + | ==== The TOP Command ==== | ||
| + | |||
| + | __Usage: | ||
| + | TOP msg n | ||
| + | |||
| + | __Arguments: | ||
| + | a message-number (required) which may NOT refer to to a message marked as | ||
| + | deleted, and a non-negative number of lines (required) | ||
| + | |||
| + | __Restrictions: | ||
| + | may only be given in the TRANSACTION state | ||
| + | |||
| + | __Discussion: | ||
| + | If the POP3 server issues a positive response, then the response given is multi-line. | ||
| + | After the initial +OK, the POP3 server sends the headers of the message, the blank | ||
| + | line separating the headers from the body, and then the number of lines of the | ||
| + | indicated message' | ||
| + | with all multi-line responses). | ||
| + | |||
| + | Note that if the number of lines requested by the POP3 client is greater than than the | ||
| + | number of lines in the body, then the POP3 server sends the entire message. | ||
| + | |||
| + | __Possible Responses: | ||
| + | +OK top of message follows | ||
| + | -ERR no such message | ||
| + | |||
| + | __Examples: | ||
| + | C: TOP 1 10 | ||
| + | S: +OK | ||
| + | S: <the POP3 server sends the headers of the message, a blank line, and the first 10 | ||
| + | lines of the body of the message> | ||
| + | S: . | ||
| + | ... | ||
| + | C: TOP 100 3 | ||
| + | S: -ERR no such message | ||
| + | |||
| + | ===== Scaling and Operational Considerations | ||
| + | The HF-POP3 protocol implements a special case of a site policy in order to prevent users | ||
| + | from accumulating large mail queues on the server system. These large queues can result in a | ||
| + | full disk and system crashes; this problem is frequently observed in POP3 servers. Messages | ||
| + | may only be downloaded once from the server, and shall be deleted after this has been | ||
| + | accomplished. This could be implemented in HF-POP3 server software by the following | ||
| + | mechanism: " | ||
| + | messages downloaded during the session with the RETR command" | ||
| + | delete messages in the event of abnormal connection termination (ie, if no QUIT was | ||
| + | received from the client) because the client may not have successfully received or stored the | ||
| + | messages. Servers implementing a download-and-delete policy may also wish to disable or | ||
| + | limit the optional TOP command, since it could be used as an alternate mechanism to | ||
| + | download entire messages. | ||
protocols/hf-pop.1534256092.txt.gz · Last modified: 2018/08/14 16:14 by root