Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 N”ªjï:ã @sldZddlZddlZddlZyddlZdZWnek rDdZYnXddgZGdd„deƒZ dZ d Z d Z d Z e e Zd ZGd d„dƒZer¦Gdd„deƒZejdƒedk�rhddlZeejdƒZeejƒƒejejdƒejejdƒejƒejƒ\ZZxXededƒD]FZ ej!e ƒ\Z"Z#Z$ede ƒxe#D]Z%ede%ƒ�qd5d6„Z#d7d8„Z$d9d:„Z%d?d;d<„Z&dS)@raPThis 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-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._putlinecCsB|jrtdt|ƒƒt||jƒ}tjd|ƒr4tdƒ‚|j|ƒdS)Nz*cmd*s[-]z*Control characters not allowed in commands) rrrÚbytesÚencodingÚreÚsearchÚ ValueErrorr )rrrrrÚ_putcmdus   z POP3._putcmdcCs |jjtdƒ}t|ƒtkr$tdƒ‚|jdkr)cCs\t||jƒ}|jj|jƒ}|s&tdƒ‚ddl}|jdƒ|}|j|ƒj ƒ}|j d||fƒS)a Authorisation - only possible if server has supplied a timestamp in initial greeting. Args: user - mailbox user; password - mailbox password. NB: mailbox is locked by server from here to 'quit()' z!-ERR APOP not supported by serverrNrz APOP %s %s) r!r"Ú timestampÚmatchrrÚhashlibÚgroupZmd5Z hexdigestr8)rr=ZpasswordZsecretÚmrPZdigestrrrÚapop;s z POP3.apopcCs|jd||fƒS)z­Retrieve message header of message number 'which' and first 'howmuch' lines of message body. Result is in form ['response', ['line', ...], octets]. z TOP %s %s)r9)rrBZhowmuchrrrÚtopPszPOP3.topcCs |dk r|jd|ƒS|jdƒS)zìReturn message digest (unique id) list. If 'which', result contains unique id for that message in the form 'response mesgnum uid', otherwise result is the list ['response', ['mesgnum uid', ...], octets] NzUIDL %sZUIDL)r8r9)rrBrrrÚuidlYsz POP3.uidlcCs |jdƒS)zITry to enter UTF-8 mode (see RFC 6856). Returns server response. ZUTF8)r8)rrrrÚutf8esz POP3.utf8c Cstdd„}i}y8|jdƒ}|d}x |D]}||ƒ\}}|||<q&WWn*tk rn}ztdƒ‚WYdd}~XnX|S)aReturn server capabilities (RFC 2449) as a dictionary >>> c=poplib.POP3('localhost') >>> c.capa() {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'], 'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [], 'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [], 'UIDL': [], 'RESP-CODES': []} >>> Really, according to RFC 2449, the cyrus folks should avoid having the implementation split into multiple arguments... cSs"|jdƒjƒ}|d|dd…fS)NÚasciirr)Údecoder?)rZlstrrrÚ _parsecapxszPOP3.capa.._parsecapZCAPArz!-ERR CAPA not supported by serverN)r9r) rrYÚcapsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrrÚcapaks    z POP3.capacCsxts tdƒ‚|jrtdƒ‚|jƒ}d|kr2tdƒ‚|dkrBtjƒ}|jdƒ}|j|j|j d�|_|jj dƒ|_ d|_|S) z{Start a TLS session on the active connection as specified in RFC 2595. context - a ssl.SSLContext z-ERR TLS support missingz$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverN)Úserver_hostnamer T) ÚHAVE_SSLrrr[ÚsslÚ_create_stdlib_contextr8Ú wrap_socketrr rr)rÚcontextrZr2rrrÚstlsˆs  z POP3.stls)N)N)N)'rrrÚ__doc__r"Ú POP3_PORTrÚ_GLOBAL_DEFAULT_TIMEOUTrrr r&r/rr7r8r9r:r<r=r>rAr6rCrDrErFrHrGrMr#ÚcompilerNrSrTrUrVr[rbrrrrr2s@+       c@s8eZdZdZeddejdfdd„Zdd„Zd dd„Z dS) ÚPOP3_SSLaPOP3 client class over SSL connection Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None, context=None) hostname - the hostname of the pop3 over ssl server port - port number keyfile - PEM formatted file that contains your private key certfile - PEM formatted certificate chain file context - a ssl.SSLContext See the methods of the parent class POP3 for more documentation. NcCs’|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) r%ÚwarningsÚwarnÚDeprecationWarningrirhr^r_rarr)rr rrirhrrarjrrrr¯szPOP3_SSL.__init__cCs"tj||ƒ}|jj||jd�}|S)N)r\)rrrar`r )rrrrrrrÃs  zPOP3_SSL._create_socketcCs tdƒ‚dS)z¬The method unconditionally raises an exception since the STLS command doesn't make any sense on an already established SSL/TLS session. z$-ERR TLS session already establishedN)r)rrirhrarrrrbÉsz POP3_SSL.stls)NNN) rrrrcÚ POP3_SSL_PORTrrerrrbrrrrrg s  rgÚ__main__rr'éz Message %d:z z-----------------------)'rcrJr#rr^r]Ú ImportErrorÚ__all__Ú Exceptionrrdrmr-ZLFrr+rrgr5rÚsysÚargvÚarr:r=r>r6rAZnumMsgsZ totalSizeÚrangeÚirCÚheaderÚmsgr.rrHrrrrÚsJ  n0