Your IP : 3.17.175.167


Current Path : /usr/lib64/python3.6/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/__pycache__/poplib.cpython-36.opt-2.pyc

3


 \t:�
@shddlZddlZddlZyddlZdZWnek
r@dZYnXddgZGdd�de�ZdZ	dZ
d	Zd
ZeeZ
dZGdd�d�Zer�Gd
d�de�Zejd�edk�rdddlZeejd�Zeej��ejejd�ejejd�ej�ej�\ZZxXeded�D]FZej e�\Z!Z"Z#ede�xe"D]Z$ede$��q8Wed��qWej%�dS)�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/poplib.pyrs�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.�Zejd/�Zd0d1�Z d2d3�Z!d=d4d5�Z"d6d7�Z#d8d9�Z$d>d:d;�Z%dS)?rzUTF-8cCs@||_||_d|_|j|�|_|jjd�|_d|_|j�|_	dS)NF�rbr)
�host�port�_tls_established�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__asz
POP3.__init__cCstj|j|jf|�S)N)�socketZcreate_connectionr
r)rrrrrrkszPOP3._create_socketcCs,|jdkrtdt|��|jj|t�dS)N�z*put*)r�print�reprrZsendall�CRLF)r�linerrr�_putlinens
z
POP3._putlinecCs.|jrtdt|��t||j�}|j|�dS)Nz*cmd*)rrr�bytes�encodingr )rrrrr�_putcmduszPOP3._putcmdcCs�|jjtd�}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%���r&)
r�readline�_MAXLINE�lenrrrrr�CR)rr�octetsrrr�_getlines
z
POP3._getlinecCs:|j�\}}|jdkr$tdt|��|jd�s6t|��|S)Nrz*resp*�+)r,rrr�
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsp|j�}g}d}|j�\}}xH|dkrd|jd�rD|d}|dd�}||}|j|�|j�\}}qW|||fS)Nr�.s..r)rr,r.�append)rr/�listr+rr0rrr�_getlongresp�s


zPOP3._getlongrespcCs|j|�|j�S)N)r#r)rrrrr�	_shortcmd�s
zPOP3._shortcmdcCs|j|�|j�S)N)r#r4)rrrrr�_longcmd�s
z
POP3._longcmdcCs|jS)N)r)rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dS)N)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|jd|�S)NzUSER %s)r5)r�userrrrr:�sz	POP3.usercCs|jd|�S)NzPASS %s)r5)rZpswdrrr�pass_�sz
POP3.pass_cCsF|jd�}|j�}|jr&tdt|��t|d�}t|d�}||fS)NZSTATz*stat*rr$)r5�splitrrr�int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|jd|�S|jd�S)NzLIST %sZLIST)r5r6)r�whichrrrr3�s	z	POP3.listcCs|jd|�S)NzRETR %s)r6)rr?rrr�retr�sz	POP3.retrcCs|jd|�S)NzDELE %s)r5)rr?rrr�dele�sz	POP3.delecCs
|jd�S)NZNOOP)r5)rrrr�noopsz	POP3.noopcCs
|jd�S)NZRSET)r5)rrrr�rsetsz	POP3.rsetcCs|jd�}|j�|S)NZQUIT)r5�close)rr/rrr�quits
z	POP3.quitcCs�z |j}d|_|dk	r|j�Wd|j}d|_|dk	r�zVy|jtj�Wn@tk
r�}z$|jtjkrxt	|dd�dkrx�WYdd}~XnXWd|j�XXdS)NZwinerrorri&')
rrDrZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattr)rrr�excrrrrDsz
POP3.closecCs|jd|�S)NzRPOP %s)r5)rr:rrr�rpop2sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|jj|j�}|s&td��ddl}|jd�|}|j|�j	�}|j
d||f�S)Nz!-ERR APOP not supported by serverrrz
APOP %s %s)r!r"�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr5)rr:ZpasswordZsecret�mrMZdigestrrr�apop9sz	POP3.apopcCs|jd||f�S)Nz	TOP %s %s)r6)rr?Zhowmuchrrr�topNszPOP3.topcCs |dk	r|jd|�S|jd�S)NzUIDL %sZUIDL)r5r6)rr?rrr�uidlWsz	POP3.uidlcCs
|jd�S)NZUTF8)r5)rrrr�utf8csz	POP3.utf8c	Cstdd�}i}y8|jd�}|d}x |D]}||�\}}|||<q&WWn*tk
rn}ztd��WYdd}~XnX|S)NcSs"|jd�j�}|d|dd�fS)N�asciirr)�decoder<)rZlstrrr�	_parsecapvszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r6r)	rrV�capsr/ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capais


z	POP3.capacCsxtstd��|jrtd��|j�}d|kr2td��|dkrBtj�}|jd�}|j|j|j	d�|_|jj
d�|_d|_|S)Nz-ERR TLS support missingz$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by server)�server_hostnamerT)�HAVE_SSLrrrX�ssl�_create_stdlib_contextr5�wrap_socketrr
rr)r�contextrWr/rrr�stls�s
z	POP3.stls)N)N)N)&rrrr"�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr r#r,rr4r5r6r7r9r:r;r>r3r@rArBrCrErDrJ�re�compilerKrPrQrRrSrXr_rrrrr2s>-	




	
c@s4eZdZeddejdfdd�Zdd�Zddd�ZdS)	�POP3_SSLNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|jdtd�||_||_|dkrxtj||d�}||_t	j
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr$)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrfrer[r\r^rr)rr
rrfrerr^rhrrrr�szPOP3_SSL.__init__cCs"tj||�}|jj||jd�}|S)N)rY)rrr^r]r
)rrrrrrr�s
zPOP3_SSL._create_socketcCstd��dS)Nz$-ERR TLS session already established)r)rrfrer^rrrr_�sz
POP3_SSL.stls)NNN)	rrr�
POP3_SSL_PORTrrarrr_rrrrrd�srd�__main__rr$�zMessage %d:z   z-----------------------)&rGrbrr[rZ�ImportError�__all__�	Exceptionrr`rkr*ZLFrr(rrdr2r�sys�argv�arr7r:r;r3r>ZnumMsgsZ	totalSize�range�ir@�header�msgr+rrErrrr�<module>sH
l0




?>