Your IP : 3.15.12.133


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/poplib.cpython-39.opt-2.pyc

a

R�f^;�@sfddlZddlZddlZddlZzddlZdZWneyFdZYn0ddgZGdd�de�Z	dZ
dZd	Zd
Z
ee
ZdZGdd�d�Zer�Gd
d�de�Ze�d�edk�rbddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZe� e�\Z!Z"Z#ede�e"D]Z$ede$��q:ed��qe�%�dS)�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�+/opt/alt/python39/lib64/python3.9/poplib.pyr��ni��
�
ic@seZdZdZeejfdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd<dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Ze�d/�Zd0d1�Z d2d3�Z!d=d4d5�Z"d6d7�Z#d8d9�Z$d>d:d;�Z%dS)?rzUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfrr�timeoutrrr�__init__bsz
POP3.__init__cCs(|dur|std��t�|j|jf|�S)Nz0Non-blocking socket (timeout=0) is not supported)�
ValueError�socketZcreate_connectionrr)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlinersz
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rr r!�bytes�encodingr%r#rrr�_putcmdzszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrr r!r"�CR)rr$�octetsrrr�_getline�sz
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r0rr r!�
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr0r2�append)rr3�listr/r$r4rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��S�N)r(rr#rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr9)r(r8r#rrr�_longcmd�s
z
POP3._longcmdcCs|jSr9)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr9)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)NzUSER %s�r:�r�userrrrrB�sz	POP3.usercCs|�d|�S)NzPASS %sr@)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)NZSTATz*stat*r�)r:�splitrr r!�int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dur|�d|�S|�d�S)NzLIST %sZLIST�r:r;�r�whichrrrr7�s	z	POP3.listcCs|�d|�S)NzRETR %s�r;rIrrr�retr�sz	POP3.retrcCs|�d|�S)NzDELE %sr@rIrrr�delesz	POP3.delecCs
|�d�S)NZNOOPr@r<rrr�noopsz	POP3.noopcCs
|�d�S)NZRSETr@r<rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)NZQUIT)r:�close)rr3rrr�quits
z	POP3.quitcCs,z�|j}d|_|dur|��W|j}d|_|dur�z`z|�tj�WnBty�}z*|jtjkrtt	|dd�dkrt�WYd}~n
d}~00W|��n
|��0n�|j}d|_|du�r&zbz|�tj�WnDt�y}z*|jtjkr�t	|dd�dkr��WYd}~n
d}~00W|��n
|��00dS)NZwinerrorri&')
rrPrZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattr)rrr�excrrrrPs6
��
�z
POP3.closecCs|�d|�S)NzRPOP %sr@rArrr�rpop7sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)Nz!-ERR APOP not supported by serverrrz
APOP %s %s)r&r'�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr:)rrBZpasswordZsecret�mrYZdigestrrr�apop>sz	POP3.apopcCs|�d||f�S)Nz	TOP %s %srK)rrJZhowmuchrrr�topSszPOP3.topcCs |dur|�d|�S|�d�S)NzUIDL %sZUIDLrHrIrrr�uidl\sz	POP3.uidlcCs
|�d�S)NZUTF8r@r<rrr�utf8hsz	POP3.utf8cCs`dd�}i}z4|�d�}|d}|D]}||�\}}|||<q$WntyZtd��Yn0|S)NcSs"|�d���}|d|dd�fS)N�asciirr)�decoderE)r$Zlstrrr�	_parsecap{szPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r;r)rrb�capsr3ZrawcapsZcaplineZcapnmZcapargsrrr�capans

z	POP3.capacCsxtstd��|jrtd��|��}d|vr2td��|durBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)Nz-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by server�Zserver_hostnamer
T)�HAVE_SSLrrrd�ssl�_create_stdlib_contextr:�wrap_socketrrrr)r�contextrcr3rrr�stls�s 
�z	POP3.stls)N)N)N)&rrrr'�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr%r(r0rr8r:r;r=r?rBrCrGr7rLrMrNrOrQrPrV�re�compilerWr\r]r^r_rdrlrrrrr3s@-�





	
c@s4eZdZeddejdfdd�Zdd�Zddd�ZdS)	�POP3_SSLNcCs�|dur|durtd��|dur0|dur0td��|dus@|durVddl}|�dtd�||_||_|durxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrD)�certfile�keyfile)r�warnings�warn�DeprecationWarningrsrrrhrirkrr)rrrrsrrrrkrtrrrr�s"��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrf)rrrkrjr)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)Nre)r)rrsrrrkrrrrl�sz
POP3_SSL.stls)NNN)	rrr�
POP3_SSL_PORTrrnrrrlrrrrrq�s
�
rq�__main__rrD�zMessage %d:z   z-----------------------)&rSrorrrhrg�ImportError�__all__�	Exceptionrrmrwr.ZLFr"r,rrqr6r�argv�ar r=rBrCr7rGZnumMsgsZ	totalSize�range�irL�header�msgr/r$rQrrrr�<module>sJ
p0



?>