B .gR@shddlZddlZddlZyddlZdZWnek r@dZYnXddgZGdddeZdZ dZ d Z d Z e e Z d ZGd ddZerGd ddeZededkrdddlZeejdZeeeejdeejdee\ZZxXededD]FZe e\Z!Z"Z#edexe"D]Z$ede$q8WedqWe%dS)NTFPOP3 error_protoc@s eZdZdS)rN)__name__ __module__ __qualname__rr)/opt/alt/python37/lib/python3.7/poplib.pyrsni  ic@seZdZdZeejfddZddZddZ dd Z d d Z d d Z ddZ ddZddZddZddZddZddZddZdd:d;Z%dS)?rzUTF-8cCs@||_||_d|_|||_|jd|_d|_||_ dS)NFrbr) hostport_tls_established_create_socketsockmakefilefile _debugging_getrespwelcome)selfr rtimeoutrrr__init__as z POP3.__init__cCst|j|jf|S)N)socketZcreate_connectionr r)rrrrrrkszPOP3._create_socketcCs,|jdkrtdt||j|tdS)Nz*put*)rprintreprrZsendallCRLF)rlinerrr_putlinens z POP3._putlinecCs.|jrtdt|t||j}||dS)Nz*cmd*)rrrbytesencodingr )rrrrr_putcmdus z POP3._putcmdcCs|jtd}t|tkr$td|jdkr)cCs\t||j}|j|j}|s&tdddl}|d|}|| }| d||fS)Nz!-ERR APOP not supported by serverrrz APOP %s %s) r!r" timestampmatchrrhashlibgroupZmd5Z hexdigestr4)rr9ZpasswordZsecretmrMZdigestrrrapop9s z POP3.apopcCs|d||fS)Nz TOP %s %s)r5)rr?ZhowmuchrrrtopNszPOP3.topcCs |dk r|d|S|dS)NzUIDL %sZUIDL)r4r5)rr?rrruidlWsz POP3.uidlcCs |dS)NZUTF8)r4)rrrrutf8csz POP3.utf8c Cstdd}i}y8|d}|d}x |D]}||\}}|||<q&WWn*tk rn}z tdWdd}~XYnX|S)NcSs"|d}|d|ddfS)Nasciirr)decoder<)rZlstrrr _parsecapvszPOP3.capa.._parsecapZCAPArz!-ERR CAPA not supported by server)r5r) rrVcapsr.ZrawcapsZcaplineZcapnmZcapargsZ_errrrrcapais    z POP3.capacCsxts td|jrtd|}d|kr2td|dkrBt}|d}|j|j|j d|_|j d|_ d|_|S)Nz-ERR TLS support missingz$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by server)server_hostnamer T) HAVE_SSLrrrXssl_create_stdlib_contextr4 wrap_socketrr rr)rcontextrWr.rrrstlss  z POP3.stls)N)N)N)&rrrr" POP3_PORTr_GLOBAL_DEFAULT_TIMEOUTrrr r#r+rr3r4r5r6r8r9r:r>r2r@rArBrCrErDrJrecompilerKrPrQrRrSrXr_rrrrr2s>-       c@s4eZdZeddejdfddZddZdddZdS) POP3_SSLNcCs|dk r|dk rtd|dk r0|dk r0td|dk s@|dk rVddl}|dtd||_||_|dkrxtj||d}||_t ||||dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr;)certfilekeyfile) ValueErrorwarningswarnDeprecationWarningrfrer[r\r^rr)rr rrfrerr^rhrrrrszPOP3_SSL.__init__cCs"t||}|jj||jd}|S)N)rY)rrr^r]r )rrrrrrrs  zPOP3_SSL._create_socketcCs tddS)Nz$-ERR TLS session already established)r)rrfrer^rrrr_sz POP3_SSL.stls)NNN) rrr POP3_SSL_PORTrrarrr_rrrrrdsrd__main__rr;z Message %d:z z-----------------------)&rGrbrr[rZ ImportError__all__ Exceptionrr`rkr)ZLFrr'rrdr1rsysargvarr6r9r:r2r>ZnumMsgsZ totalSizerangeir@headermsgr*rrErrrrsH l0