Skip to main content

Module pop3

Module pop3 

Source
Expand description

POP3 (Post Office Protocol version 3) layer implementation.

Implements RFC 1939 POP3 packet parsing as a zero-copy view into a packet buffer.

§Protocol Overview

POP3 operates over TCP port 110 (or 995 for POP3S). Unlike SMTP, POP3 is used to download mail from a server.

§Packet Format

Client Command:

COMMAND [arguments]\r\n

Server Reply:

+OK [text]\r\n         (success)
-ERR [text]\r\n        (error)

Multi-line responses (for LIST, RETR, etc.) end with a line containing only ..

§POP3 Commands (RFC 1939)

CommandStateDescription
USERAuthorizationUser name
PASSAuthorizationPassword
QUITBothQuit
STATTransactionGet mailbox status
LISTTransactionList messages
RETRTransactionRetrieve message
DELETransactionDelete message
NOOPTransactionNo-op
RSETTransactionReset (undelete)
TOPTransactionGet message headers + N body lines
UIDLTransactionUnique ID listing
APOPAuthorizationAuthenticated login (MD5)
AUTHAuthorizationAuthenticate (RFC 1734)
CAPABothList capabilities (RFC 2449)
STLSAuthorizationStart TLS (RFC 2595)

Re-exports§

pub use builder::Pop3Builder;

Modules§

builder
POP3 packet builder.

Structs§

Pop3Layer
A zero-copy view into a POP3 layer within a packet buffer.

Constants§

CMD_APOP
CMD_AUTH
CMD_CAPA
CMD_DELE
CMD_LIST
CMD_NOOP
CMD_PASS
CMD_QUIT
CMD_RETR
CMD_RSET
CMD_STAT
CMD_STLS
CMD_TOP
CMD_UIDL
CMD_USER
POP3S_PORT
POP3S (over TLS) port.
POP3_MIN_HEADER_LEN
Minimum POP3 payload: “+OK\r\n” = 5 bytes or “USER” = 4 bytes.
POP3_PORT
POP3 standard port.

Statics§

POP3_COMMANDS
POP3_FIELD_NAMES
Field names for Python/generic access.

Functions§

is_pop3_payload
Returns true if buf looks like a POP3 payload.
pop3_show_fields
Returns a human-readable display of POP3 layer fields.