b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/poplib.pyc
Size13.1 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc @s¯dZddkZddkZddgZdefd��YZdZdZdZd Z ee Z
d
Z dfd ��YZ yddk
Z
Wnej
on%Xd e fd
��YZeid �edjoÚddkZe eid�Zei�GHeieid�eieid�ei�ei�\ZZx[eded�D]FZeie�\ZZ Z!deGHxe D]Z"de"GHq�WdGHqSWei#�ndS(s@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
iÿÿÿÿNtPOP3t error_protocBseZRS((t__name__t
__module__(((s/usr/lib64/python2.6/poplib.pyRsiniãs
s
icBsûeZdZeeid�Zd�Zd�Zd�Z d�Z
d�Z d�Z d�Z
d �Zd
�Zd �Zd �Zd
�Zdd�Zd�Zd�Zd�Zd�Zd�Zd�Zeid�Zd�Zd�Zdd�Z RS(sÏThis 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)

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.
cCs^||_||_ti||f|�|_|iid�|_d|_|i�|_ dS(Ntrbi(
thosttporttsockettcreate_connectiontsocktmakefiletfilet
_debuggingt_getresptwelcome(tselfRRttimeout((s/usr/lib64/python2.6/poplib.pyt__init__Us    cCsA|idjodGt|�GHn|iid|tf�dS(Nis*put*s%s%s(R treprR tsendalltCRLF(Rtline((s/usr/lib64/python2.6/poplib.pyt_putline_scCs.|iodGt|�GHn|i|�dS(Ns*cmd*(R RR(RR((s/usr/lib64/python2.6/poplib.pyt_putcmdfs
cCsÐ|iitd�}t|�tjotd��n|idjodGt|�GHn|ptd��nt|�}|dtjo|d |fS|dtjo|dd!|fS|d |fS(Nis
line too longs*get*s-ERR EOFiþÿÿÿiiÿÿÿÿ( R treadlinet_MAXLINEtlenRR RRtCR(RRtoctets((s/usr/lib64/python2.6/poplib.pyt_getlineos cCs`|i�\}}|idjodGt|�GHn|d }|djot|��n|S(Nis*resp*t+(RR RR(Rtresptotc((s/usr/lib64/python2.6/poplib.pyR
�s

cCs�|i�}g}d}|i�\}}xd|djoV|d djo|d}|d}n||}|i|�|i�\}}q-W|||fS(Nit.is..i(R
Rtappend(RRtlistRRR ((s/usr/lib64/python2.6/poplib.pyt _getlongresp�s 



cCs|i|�|i�S(N(RR
(RR((s/usr/lib64/python2.6/poplib.pyt _shortcmd�s
cCs|i|�|i�S(N(RR%(RR((s/usr/lib64/python2.6/poplib.pyt_longcmd¦s
cCs|iS(N(R(R((s/usr/lib64/python2.6/poplib.pyt
getwelcome­scCs
||_dS(N(R (Rtlevel((s/usr/lib64/python2.6/poplib.pytset_debuglevel±scCs|id|�S(sVSend user name, return response

(should indicate password required).
sUSER %s(R&(Rtuser((s/usr/lib64/python2.6/poplib.pyR+·scCs|id|�S(s Send password, return response

(response includes message count, mailbox size).

NB: mailbox is locked by server from here to 'quit()'
sPASS %s(R&(Rtpswd((s/usr/lib64/python2.6/poplib.pytpass_¿scCsb|id�}|i�}|iodGt|�GHnt|d�}t|d�}||fS(s]Get mailbox status.

Result is tuple of 2 ints (message count, mailbox size)
tSTATs*stat*ii(R&tsplitR Rtint(Rtretvaltretst numMessagest sizeMessages((s/usr/lib64/python2.6/poplib.pytstatÉs 
cCs,|dj o|id|�S|id�S(sRequest listing, return result.

Result without a message number argument is in form
['response', ['mesg_num octets', ...], octets].

Result when a message number argument is given is a
single response: the "scan listing" for that message.
sLIST %stLISTN(tNoneR&R'(Rtwhich((s/usr/lib64/python2.6/poplib.pyR$Ös
cCs|id|�S(soRetrieve whole message number 'which'.

Result is in form ['response', ['line', ...], octets].
sRETR %s(R'(RR8((s/usr/lib64/python2.6/poplib.pytreträscCs|id|�S(sFDelete message number 'which'.

Result is 'response'.
sDELE %s(R&(RR8((s/usr/lib64/python2.6/poplib.pytdeleìscCs
|id�S(sXDoes nothing.

One supposes the response indicates the server is alive.
tNOOP(R&(R((s/usr/lib64/python2.6/poplib.pytnoopôscCs
|id�S(s(Unmark all messages marked for deletion.tRSET(R&(R((s/usr/lib64/python2.6/poplib.pytrsetüscCs[y|id�}Wntj
o}|}nX|ii�|ii�|`|`|S(sDSignoff: commit changes on server, unlock mailbox, close connection.tQUIT(R&RR tcloseR (RRtval((s/usr/lib64/python2.6/poplib.pytquits 

 cCs|id|�S(sNot sure what this does.sRPOP %s(R&(RR+((s/usr/lib64/python2.6/poplib.pytrpopss\+OK.*(<[^>]+>)cCs�|ii|i�}|ptd��nddk}|i|id�|�i�}dit d�|��}|i
d||f�S(s Authorisation

- only possible if server has supplied a timestamp in initial greeting.

Args:
user - mailbox user;
secret - secret shared between client and server.

NB: mailbox is locked by server from here to 'quit()'
s!-ERR APOP not supported by serveriÿÿÿÿNitcSsdt|�S(s%02x(tord(tx((s/usr/lib64/python2.6/poplib.pyt<lambda>(ss
APOP %s %s( t timestamptmatchRRthashlibtmd5tgrouptdigesttjointmapR&(RR+tsecrettmRJRM((s/usr/lib64/python2.6/poplib.pytapops  "cCs|id||f�S(s­Retrieve message header of message number 'which'
and first 'howmuch' lines of message body.

Result is in form ['response', ['line', ...], octets].
s TOP %s %s(R'(RR8thowmuch((s/usr/lib64/python2.6/poplib.pyttop,scCs,|dj o|id|�S|id�S(sì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]
sUIDL %stUIDLN(R7R&R'(RR8((s/usr/lib64/python2.6/poplib.pytuidl5s
N(!RRt__doc__t POP3_PORTRt_GLOBAL_DEFAULT_TIMEOUTRRRRR
R%R&R'R(R*R+R-R5R7R$R9R:R<R>RBRCtretcompileRHRRRTRV(((s/usr/lib64/python2.6/poplib.pyR*s4(        

        tPOP3_SSLcBsDeZdZeddd�Zd�Zd�Zd�Zd�Z RS(sÂPOP3 client class over SSL connection

Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None)

hostname - the hostname of the pop3 over ssl server
port - port number
keyfile - PEM formatted file that countains your private key
certfile - PEM formatted certificate chain file

See the methods of the parent class POP3 for more documentation.
c CsX||_||_||_||_d|_d}d|_x­ti|i|idti �D]�}|\}}} }
} y,ti||| �|_|ii
| �Wn?ti j
o0}|io|ii �nd|_q^nXPq^W|ipti |�n|ii
d�|_ti|i|i|i�|_d|_|i�|_dS(NRDs!getaddrinfo returns an empty listiR(RRtkeyfiletcertfiletbufferR7R Rt getaddrinfot SOCK_STREAMtconnectterrorR@R
R tsslt wrap_sockettsslobjR R
R( RRRR]R^tmsgtrestaftsocktypetprotot canonnametsa((s/usr/lib64/python2.6/poplib.pyRSs2      "
 
! cCsE|ii�}t|�djotd��n|i|7_dS(Nis-ERR EOF(RftreadRRR_(Rtlocalbuf((s/usr/lib64/python2.6/poplib.pyt _fillBuffermscCs"d}tid�}|i|i�}xN|pFt|i�tjotd��n|i�|i|i�}q*W|id�}|i d|id�|_|i
djodGt |�GHnt|�}|dt jo|d |fS|dt
jo|dd!|fS|d |fS( NRDs.*?\ns
line too longiis*get*iþÿÿÿiÿÿÿÿ(RZR[RIR_RRRRpRLtsubR RRR(RRt renewlineRIR((s/usr/lib64/python2.6/poplib.pyRss&
 cCs�|idjodGt|�GHn|t7}t|�}xJ|djo<|ii|�}||joPn||}||}q<WdS(Nis*put*i(R RRRRftwrite(RRtbytestsent((s/usr/lib64/python2.6/poplib.pyR�s
 


cCsNy|id�}Wntj
o}|}nX|ii�|`|`|S(sDSignoff: commit changes on server, unlock mailbox, close connection.R?(R&RR R@Rf(RRRA((s/usr/lib64/python2.6/poplib.pyRB�s 
 N(
RRRWt
POP3_SSL_PORTR7RRpRRRB(((s/usr/lib64/python2.6/poplib.pyR\Fs     t__main__iiis Message %d:s s-----------------------($RWRZRt__all__t ExceptionRRXRvRtLFRRRRdt ImportErrorR\R#RtsystargvtaR(R+R-R$R5tnumMsgst totalSizetrangetiR9theaderRgRRRB(((s/usr/lib64/python2.6/poplib.pyt<module>sD  
ÿW