a
ä”|jÙ; ã @ sj d Z ddlZddlZddlZddlZzddlZdZW n eyJ dZY n0 ddgZG dd„ de ƒZ
dZd Zd
Z
dZe
e ZdZG d
d„ dƒZer¬G dd„ deƒZe d¡ edk�rfddlZeejd ƒZee ¡ ƒ e ejd ¡ e ejd ¡ e ¡ e ¡ \ZZeded ƒD ]BZ e !e ¡\Z"Z#Z$ede ƒ e#D ]Z%ede% ƒ �q>edƒ �qe &¡ dS )z@A POP3 client class.
Based on the J. Myers POP3 draft, Jan. 96
é NTFÚPOP3Úerror_protoc @ s e Zd ZdS )r N)Ú__name__Ú
__module__Ú__qualname__© r r ú/usr/lib64/python3.9/poplib.pyr ó én iã ó
ó
i c @ s e Zd ZdZdZeejfdd„Zdd„ Z dd„ Z
d d
„ Zdd„ Zd
d„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd=d d!„Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Ze d0¡Z d1d2„ Z!d3d4„ Z"d>d5d6„Z#d7d8„ Z$d9d:„ Z%d?d;d<„Z&dS )@r aP This class supports both the minimal and optional command sets.
Arguments can be strings or integers (where appropriate)
(e.g.: retr(1) and retr('1') both work equally well.
Minimal Command Set:
USER name user(name)
PASS string pass_(string)
STAT stat()
LIST [msg] list(msg = None)
RETR msg retr(msg)
DELE msg dele(msg)
NOOP noop()
RSET rset()
QUIT quit()
Optional Commands (some servers support these):
RPOP name rpop(name)
APOP name digest apop(name, digest)
TOP msg n top(msg, n)
UIDL [msg] uidl(msg = None)
CAPA capa()
STLS stls()
UTF8 utf8()
Raises one exception: 'error_proto'.
Instantiate with:
POP3(hostname, port=110)
NB: the POP protocol locks the mailbox from user
authorization until QUIT, so be sure to get in, suck
the messages, and quit, each time you access the
mailbox.
POP is a line-based protocol, which means large mail
messages consume lots of python cycles reading them
line-by-line.
If it's available on your mail server, use IMAP4
instead, it doesn't suffer from the two problems
above.
zUTF-8c C sP || _ || _d| _t d| ||¡ | |¡| _| j d¡| _d| _ |
¡ | _d S )NFzpoplib.connectÚrbr )ÚhostÚportÚ_tls_establishedÚsysÚauditÚ_create_socketÚsockÚmakefileÚfileÚ
_debuggingÚ_getrespÚwelcome)Úselfr r Útimeoutr r r Ú__init__b s z
POP3.__init__c C s( |d ur|st dƒ‚t | j| jf|¡S )Nz0Non-blocking socket (timeout=0) is not supported)Ú
ValueErrorÚsocketÚcreate_connectionr r )r r r r r r m s zPOP3._create_socketc C s: | j dkrtdt|ƒƒ t d| |¡ | j |t ¡ d S )Né z*put*zpoplib.putline)r ÚprintÚreprr r r ÚsendallÚCRLF©r Úliner r r Ú_putliner s z
POP3._putlinec C sB | j rtdt|ƒƒ t|| jƒ}t d|¡r4tdƒ‚| |¡ d S )Nz*cmd*s [ -]z*Control characters not allowed in commands) r r! r" ÚbytesÚencodingÚreÚsearchr r' r% r r r Ú_putcmdz s
zPOP3._putcmdc C s | j td ¡}t|ƒtkr$tdƒ‚| jdkr