Your IP : 3.143.24.110


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/poplib.cpython-310.opt-2.pyc

o

6��f^;�@sf	ddlZddlZddlZddlZzddlZdZWney$dZYnwddgZGdd�de�Z	dZ
dZd	Zd
Z
ee
ZdZGdd�d�ZerUGd
d�de�Ze�d�edkr�ddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]Ze� e�\Z!Z"Z#ede�e"D]Z$ede$�q�ed�q�e�%�dSdS)�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�-/opt/alt/python310/lib64/python3.10/poplib.pyrs�ni��
�
ic@s
eZdZ	dZeejfdd�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)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCs(|dur
|s
td��t�|j|jf|�S)Nz0Non-blocking socket (timeout=0) is not supported)�
ValueError�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlinersz
POP3._putlinecCs.|jr
tdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdzszPOP3._putcmdcCs�|j�td�}t|�tkrtd��|jdkrtdt|��|s$td��t|�}|dd�tkr8|dd�|fS|dd�t	krH|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�sz
POP3._getlinecCs:|��\}}|jdkrtdt|��|�d�st|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsr|��}g}d}|��\}}|dkr4|�d�r!|d}|dd�}||}|�|�|��\}}|dks|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

�
zPOP3._getlongrespcC�|�|�|��S�N)r'rr"rrr�	_shortcmd��
zPOP3._shortcmdcCr8r9)r'r7r"rrr�_longcmd�r;z
POP3._longcmdcCs|jSr9)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr9)r)r�levelrrr�set_debuglevel�s
zPOP3.set_debuglevelcC�	|�d|�S)NzUSER %s�r:�r�userrrrrD��z	POP3.usercCrA)NzPASS %srB)rZpswdrrr�pass_�sz
POP3.pass_cCsH	|�d�}|��}|jrtdt|��t|d�}t|d�}||fS)NZSTATz*stat*r�)r:�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcC�"	|dur|�d|�S|�d�S)NzLIST %sZLIST�r:r<�r�whichrrrr6�s
z	POP3.listcCrA)NzRETR %s�r<rMrrr�retr�rEz	POP3.retrcCrA)NzDELE %srBrMrrr�delerEz	POP3.delecC�	|�d�S)NZNOOPrBr=rrr�noops
z	POP3.noopcCrR)NZRSETrBr=rrr�rsets
z	POP3.rsetcCs	|�d�}|��|S)NZQUIT)r:�close)rr2rrr�quits
z	POP3.quitcCsD	zY|j}d|_|dur|��W|j}d|_|durYz8z|�tj�Wn!tyE}z|jtjkr;t	|dd�dkr;�WYd}~nd}~wwW|��dSW|��dS|��wdS|j}d|_|dur�z6z|�tj�Wn!ty�}z|jtjkr�t	|dd�dkr��WYd}~nd}~wwW|��wW|��w|��ww)NZwinerrorri&')
rrUrZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattr)rrr�excrrrrUsN����	������
	��z
POP3.closecCrA)NzRPOP %srBrCrrr�rpop7sz	POP3.rpops\+OK.[^<]*(<.*>)cCs^	t||j�}|j�|j�}|std��ddl}|�d�|}|�|��	�}|�
d||f�S)Nz!-ERR APOP not supported by serverrrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr:)rrDZpasswordZsecret�mr^Zdigestrrr�apop>s
z	POP3.apopcCs	|�d||f�S)Nz	TOP %s %srO)rrNZhowmuchrrr�topSszPOP3.topcCrK)NzUIDL %sZUIDLrLrMrrr�uidl\s
z	POP3.uidlcCrR)NZUTF8rBr=rrr�utf8hs
z	POP3.utf8cCs\	dd�}i}z|�d�}|d}|D]}||�\}}|||<qW|Sty-td��w)NcSs"|�d���}|d|dd�fS)N�asciirr)�decoderH)r#Zlstrrr�	_parsecap{szPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r<r)rrg�capsr2ZrawcapsZcaplineZcapnmZcapargsrrr�capans

���z	POP3.capacCsz	tstd��|jrtd��|��}d|vrtd��|dur"t��}|�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_SSLrrri�ssl�_create_stdlib_contextr:�wrap_socketrr
rr)r�contextrhr2rrr�stls�s"
�z	POP3.stlsr9)&rrrr&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r:r<r>r@rDrFrJr6rPrQrSrTrVrUr[�re�compiler\rarbrcrdrirqrrrrr3sD+
�






	c@s6eZdZ	eddejdfdd�Zdd�Zddd�ZdS)	�POP3_SSLNcCs�|dur|durtd��|dur|durtd��|dus |dur+ddl}|�dtd�||_||_|dur<tj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrG)�certfile�keyfile)r�warnings�warn�DeprecationWarningrxrwrmrnrprr)rr
rrxrwrrpryrrrr�s"��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrk)rrrpror
)rrrrrrr�s
�zPOP3_SSL._create_socketcCs
	td��)Nrj)r)rrxrwrprrrrq�sz
POP3_SSL.stls)NNN)	rrr�
POP3_SSL_PORTrrsrrrqrrrrrv�s
�rv�__main__rrG�zMessage %d:z   z-----------------------)&rXrtrrrmrl�ImportError�__all__�	Exceptionrrrr|r-ZLFr!r+rrvr5r�argv�arr>rDrFr6rJZnumMsgsZ	totalSize�range�irP�header�msgr.r#rVrrrr�<module>sR�p
0
�

?>