RFC: 1939
Оригинал: Post Office Protocol - Version 3
Предыдущие версии: RFC 1081, RFC 1225, RFC 1460, RFC 1725
Категория: Стандарт Интернета
Дата публикации:
Авторы: ,
Перевод: ?

RFC 1939, Страница 6 из 9

7. Необязательные команды

POP3 команды, описанные выше, должны поддерживаться всеми POP3 серверами.

Дополнительные команды дают клиенту большую свободу в обработке сообщений, сохраняя простоту реализации POP3-сервера.

Примечание: этот документ поощряет поддержку дополнительных команд, вместо внесений дополнительных сведений в «drop listing» и «scan listing». Короче говоря, философия этого документа — поместить весь интеллект в часть POP3-клиента, а не сервера.

TOP [сообщение] [количество строк]

  • Аргументы:
  • Номер сообщения (обязательный) и неотрицательное число, указывающее на количество строк тела сообщения которое сервер передаст клиенту, аргумент обязательный. Нельзя обращаться к сообщениям, помеченным как удаленные.

  • Ограничения:
  • Может быть передана только в состоянии TRANSACTION.

  • Подробности:
  • После положительного ответа, сервер посылает многострочный ответ. После начального +OK, сервер посылает заголовок сообщения, пустую строку и указанное количество строк из тела сообщения.

    Примечание: Если число строк, которые требует клиент, больше числа строк в сообщение, то сервер передает все сообщение полностью.

  • Возможные ответы:
  • +OK top of message follows
    -ERR no such message

  • Примеры:
  • 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

UIDL [сообщение]

  • Аргументы:
  • Номер сообщения (необязательный). Нельзя обратиться к сообщению помеченному как удаленное.

  • Ограничения:
  • Может быть передана только в состоянии TRANSACTION.

  • Подробности:
  • Если аргумент задан, сервер посылает положительный ответ со строкой содержащей информацию о заданном сообщении. Эта строка называется «unique-id listing».

    Если аргумент не задан, то при положительном ответе сервер посылает многострочный ответ. После индикатора состояния (+OK), и строку содержащую информацию о сообщении.

    Для упрощения синтаксического разбора все сервера должны использовать определенный формат «unique-id listing». «unique-id listing» состоит из номера сообщения и уникального идентификатора разделенные одиночным пробелом. За уникальным идентификатором не должно следовать ни какой дополнительной информации.

    Уникальный идентификатор это произвольная, определяемая сервером, строка, содержащая 1-70 символов в диапазоне от 0x21 до 0x7E, которая однозначно идентифицирует сообщение в пределах почтового ящика. Идентификатор сохраняется на все время сессии. Это постоянство требуется, даже если сеанс закончился не переходя в состояние UPDATE. Сервер не должен многократно использовать идентификатор для данного почтового ящика, пока существует объект использующий его. Сообщения помеченные как удаленные не учитываются.

  • Возможные ответы:
  • +OK unique-id listing follows
    -ERR no such message

  • Примеры:
  • C: UIDL
    S: +OK
    S: 1 whqtswO00WBw418f9t5JxYwZ
    S: 2 QhdPYR:00WBw1Ph7x7
    S: .
       ...
    C: UIDL 2
    S: +OK 2 QhdPYR:00WBw1Ph7x7
       ...
    C: UIDL 3
    S: -ERR no such message, only 2 messages in maildrop

USER [имя]

  • Аргументы:
  • Строка идентификации почтового ящика (обязательный).

  • Ограничения:
  • Может быть передана только в состоянии AUTHORIZATION после POP3 приветствия или неуспешной команды USER или PASS.

  • Подробности:
  • To authenticate using the USER and PASS command combination, the client must first issue the USER command. If the POP3 server responds with a positive status indicator («+OK»), then the client may issue either the PASS command to complete the authentication, or the QUIT command to terminate the POP3 session. If the POP3 server responds with a negative status indicator («-ERR») to the USER command, then the client may either issue a new authentication command or may issue the QUIT command.

    The server may return a positive response even though no such mailbox exists. The server may return a negative response if mailbox exists, but does not permit plaintext password authentication.

  • Возможные ответы:
  • +OK name is a valid mailbox
    -ERR never heard of mailbox name

  • Примеры:
  • C: USER mrose
    S: +OK mrose is a real hoopy frood
       ...
    C: USER frated
    S: -ERR sorry, no mailbox for frated here

PASS [строка]

  • Аргументы:
  • пароль к почтовому ящику (обязательный).

  • Ограничения:
  • Может быть передана только в состоянии AUTHORIZATION после успешной команды USER.

  • Подробности:
  • When the client issues the PASS command, the POP3 server uses the argument pair from the USER and PASS commands to determine if the client should be given access to the appropriate maildrop.

    Команда PASS имеет только один аргумент, сервер может трактовать пробел в параметре как часть пароля, вместо разделителя аргументов.

  • Возможные ответы:
  • +OK maildrop locked and ready
    -ERR invalid password
    -ERR unable to lock maildrop

  • Примеры:
  • C: USER mrose
    S: +OK mrose is a real hoopy frood
    C: PASS secret
    S: +OK mrose's maildrop has 2 messages (320 octets)
      ...
    C: USER mrose
    S: +OK mrose is a real hoopy frood
    C: PASS secret
    S: -ERR maildrop already locked

APOP [имя] [digest]

  • Аргументы:
  • Строка идентифицирующая почтовый ящик и MD5 digest (шифрованная по алгоритму MD5 строка пароля), оба параметра обязательные.

  • Ограничения:
  • may only be given in the AUTHORIZATION state after the POP3 greeting or after an unsuccessful USER or PASS command

  • Подробности:
  • Normally, each POP3 session starts with a USER/PASS exchange. This results in a server/user-id specific password being sent in the clear on the network. For intermittent use of POP3, this may not introduce a sizable risk. However, many POP3 client implementations connect to the POP3 server on a regular basis — to check for new mail. Further the interval of session initiation may be on the order of five minutes. Hence, the risk of password capture is greatly enhanced.

    An alternate method of authentication is required which provides for both origin authentication and replay protection, but which does not involve sending a password in the clear over the network. The APOP command provides this functionality.

    A POP3 server which implements the APOP command will include a timestamp in its banner greeting. The syntax of the timestamp corresponds to the «msg-id» in [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:

    <[email protected]
    >

    where «process-ID» is the decimal value of the process's PID, clock is the decimal value of the system clock, and hostname is the fully-qualified domain-name 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 «name» parameter has identical semantics to the «name» parameter of the USER command. 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. This shared secret is a string known only to the POP3 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 masquerade as the named user. The «digest» parameter itself is a 16-octet value which is sent in hexadecimal format, using lower-case ASCII characters.

    When the POP3 server receives the APOP command, it verifies the digest provided. If the digest is correct, the POP3 server issues a positive response, and the POP3 session enters the TRANSACTION state. Otherwise, a negative response is issued and the POP3 session remains in the AUTHORIZATION state.

    Note that as the length of the shared secret increases, so does the difficulty of deriving it. As such, shared secrets should be long strings (considerably longer than the 8-character example shown below).

  • Возможные ответы:
  • +OK maildrop locked and ready
    -ERR permission denied

  • Примеры:
  • S: +OK POP3 server ready <[email protected]
    >
    C: APOP mrose c4c9334bac560ecc979e58001b3e22fb
    S: +OK maildrop has 1 message (369 octets)
    In this example, the shared  secret  is  the  string  «tan-
    staaf». Hence, the MD5 algorithm is applied to the string
       <[email protected]
    >tanstaaf
    which produces a digest value of
       c4c9334bac560ecc979e58001b3e22fb

Страница 6 из 9

2007 - 2022 © Русские переводы RFC, IETF, ISOC.