KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/smtplib.pyc
mò
‚=5Dc@svdZdkZdkZdkZdkZdkZdklZdk	l
Z
dddddd	d
ddd
ddgZdZdZ
eideiƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd	efd„ƒYZd
efd„ƒYZdefd„ƒYZdefd„ƒYZdfd„ƒYZdfd„ƒYZd „Zd!„Zdfd"„ƒYZe d#jo¼dk	Z	d$„Z!e!d%ƒZ"e!d&ƒi#d'ƒZ$d(GHd)Z%x2d*o*e	i&i'ƒZ(e(oPne%e(Z%q÷Wd+e)e%ƒGHed,ƒZ*e*i+d*ƒe*i,e"e$e%ƒe*i-ƒndS(-s~SMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print s.help()
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
N(sencode(sstderrt
SMTPExceptiontSMTPServerDisconnectedtSMTPResponseExceptiontSMTPSenderRefusedtSMTPRecipientsRefusedt
SMTPDataErrortSMTPConnectErrort
SMTPHeloErrortSMTPAuthenticationErrort	quoteaddrt	quotedatatSMTPis
s	auth=(.*)cBstZdZRS(s4Base class for all exceptions raised by this module.(t__name__t
__module__t__doc__(((t/usr/lib64/python2.4/smtplib.pyR?scBstZdZRS(sÌNot connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    (RR
R(((RRBscBstZdZd„ZRS(s2Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    cCs%||_||_||f|_dS(N(tcodetselft	smtp_codetmsgt
smtp_errortargs(RRR((Rt__init__Ss		(RR
RR(((RRJscBstZdZd„ZRS(s«Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cCs1||_||_||_|||f|_dS(N(RRRRRtsenderR(RRRR((RR_s			(RR
RR(((RRXscBstZdZd„ZRS(sÎAll recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    cCs||_|f|_dS(N(t
recipientsRR(RR((RRms	(RR
RR(((RRescBstZdZRS(s'The SMTP server didn't accept the data.(RR
R(((RRrscBstZdZRS(s&Error during connection establishment.(RR
R(((RRuscBstZdZRS(s"The server refused our HELO reply.(RR
R(((RRxscBstZdZRS(svAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    (RR
R(((RR{st
SSLFakeSocketcBs/tZdZd„Zd„ZeZd„ZRS(siA fake socket object that really wraps a SSLObject.

    It only supports what is needed in smtplib.
    cCs||_||_dS(N(trealsockRtsslobj(RRR((RR‡s	cCs|ii|ƒt|ƒS(N(RRtwritetstrtlen(RR((Rtsend‹scCs|iiƒdS(N(RRtclose(R((RR ‘s(RR
RRRtsendallR (((RR‚s
		tSSLFakeFilecBs)tZdZd„Zd„Zd„ZRS(slA fake file like object that really wraps a SSLObject.

    It only supports what is needed in smtplib.
    cCs
||_dS(N(RR(RR((RR™scCsAd}d}x.|djo |iidƒ}||7}qW|S(Nts
i(RtNonetchrRRtread(RR%R((Rtreadlineœs
cCsdS(N((R((RR ¤s(RR
RRR'R (((RR"”s		cCsmd}yti|ƒd}Wntj
onX|djod|Sn|djodSn	d|SdS(s‚Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything rfc822.parseaddr can handle.
    is<%s>s<>N(NN(NN(R$tmtrfc822t	parseaddrtaddrtAttributeError(R+R(((RR	§s

cCs"tiddtidt|ƒƒS(sQuote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    Internet CRLF end-of-line.
    s(?m)^\.s..s(?:\r\n|\n|\r(?!\n))N(tretsubtCRLFtdata(R0((RR
ºscBs1tZdZdZeZeZeZdZdded„Z	d„Z
ddd„Zd„Zdd„Z
d	„Zdd
„Zdd„Zdd„Zd
„Zdd„Zd„Zd„Zgd„Zgd„Zd„Zd„ZeZd„Zd„Zeed„Zggd„Zd„Zd„Z RS(s´This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        iR#cCs²h|_|o<|i||ƒ\}}|djot||ƒ‚qLn|dj	o
||_nIt
iƒ}d|jo
||_n#t
i
t
iƒƒ}d||_dS(sÝInitialize a new instance.

        If specified, `host' is the name of the remote host to which to
        connect.  If specified, `port' specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  An SMTPConnectError is raised
        if the specified `host' doesn't respond correctly.  If specified,
        `local_hostname` is used as the FQDN of the local host.  By default,
        the local hostname is found using socket.getfqdn().

        iÜt.s[%s]N(Rtesmtp_featuresthosttconnecttportRRRtlocal_hostnameR$tsockettgetfqdntfqdnt
gethostbynametgethostnameR+(RR3R5R6RR9RR+((RRçs
	




cCs
||_dS(s¬Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        N(t
debuglevelR(RR<((Rtset_debuglevelst	localhostcCs8|oŽ|idƒ|idƒjoo|idƒ}|djoO|| ||d}}yt|ƒ}Wq’tj
otid‚q’Xq–n|p
t	}n|idjotdI||fIJnd}
d|_xûti||dtiƒD]Þ}|\}}}}	}yVti|||ƒ|_|idjotdI||fIJn|ii|ƒWnitij
oZ}
|idjotdI||fIJn|io|iiƒnd|_qünXPqüW|ipti|
‚n|iƒ\}}
|idjotdI|
IJn||
fS(	spConnect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        t:iisnonnumeric portsconnect:s!getaddrinfo returns an empty lists
connect fail:N(R5R3tfindtrfindtitintt
ValueErrorR7terrort	SMTP_PORTRR<tstderrRR$tsocktgetaddrinfotSOCK_STREAMtrestaftsocktypetprotot	canonnametsaR4R tgetreplyR(RR3R5RNRLRBRKRMRRORRP((RR4sJ
'

	
	
cCs‹|idjotdIt|ƒIJn|ioGy|ii|ƒWq‡tij
o|i	ƒt
dƒ‚q‡Xn
t
dƒ‚dS(sSend `str' to the server.issend:sServer not connectedsplease run connect() firstN(RR<RGtreprRRHR!R7RER R(RR((RR7s

cCsE|djod|tf}nd||tf}|i|ƒdS(sSend a command to the server.R#s%s%ss%s %s%sN(RtcmdR/RRR(RRSRR((RtputcmdCs

cCs?g}|id
jo|iidƒ|_nxÌ|iiƒ}|djo|iƒt	dƒ‚n|i
djotdIt|ƒIJn|i
|diƒƒ|d }yt|ƒ}Wntj
od	}PnX|dd!d
joPq2q2Wdi|ƒ}|i
djotd||fIJn||fS(s¨Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        trbiR#sConnection unexpectedly closedisreply:iiiÿÿÿÿt-s
sreply: retcode (%s); Msg: %sN(trespRtfileR$RHtmakefileR'tlineR RR<RGRRtappendtstripRRCterrcodeRDtjointerrmsg(RRR]RZRWR_((RRQKs2



cCs|i||ƒ|iƒS(s-Send a command, and return its response code.N(RRTRSRRQ(RRSR((RtdocmdsscCs?|id|p|iƒ|iƒ\}}||_||fS(swSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        theloN(RRTtnameR6RQRRt	helo_resp(RRbRR((RRays
	c
Cs®h|_|id|p|iƒ|iƒ\}}|djo-t|ƒdjo|i	ƒt
dƒ‚n||_|djo||fSnd|_|ii
dƒ}|d=xì|D]ä}ti|ƒ}	|	o8|iidd	ƒd
|	idƒd|id<q¼ntid|ƒ}|ow|idƒiƒ}|i|idƒiƒ}|djo(|ii|d	ƒd
||i|<q ||i|<q¼q¼W||fS(sx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        tehloiÿÿÿÿisServer not connectediúis
tauthR#t s((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?tfeatureN(RR2RTRbR6RQRRRR Rt	ehlo_respt
does_esmtptsplitRWteacht
OLDSTYLE_AUTHtmatcht
auth_matchtgettgroupsR-R(tgrouptlowerRgtstringtendR\tparams(
RRbRR(RgRuRkRRWRn((RRdƒs6	 
	
	1
(cCs|iƒ|ijS(s7Does the server support a given SMTP service extension?N(toptRrRR2(RRv((Rthas_extnµscCs|id|ƒ|iƒS(s;SMTP 'help' command.
        Returns help text from server.thelpN(RRTRRQ(RR((RRx¹scCs
|idƒS(s&SMTP 'rset' command -- resets session.trsetN(RR`(R((RRy¿scCs
|idƒS(s-SMTP 'noop' command -- doesn't do anything :>tnoopN(RR`(R((RRzÃscCsXd}|o!|ioddi|ƒ}n|iddt|ƒ|fƒ|iƒS(s0SMTP 'mail' command -- begins mail xfer session.R#Rftmails	FROM:%s%sN(	t
optionlisttoptionsRRiR^RTR	RRQ(RRR}R|((RR{Çs cCsXd}|o!|ioddi|ƒ}n|iddt|ƒ|fƒ|iƒS(s;SMTP 'rcpt' command -- indicates 1 recipient for this mail.R#RftrcptsTO:%s%sN(	R|R}RRiR^RTR	trecipRQ(RRR}R|((RR~Ïs cCsù|idƒ|iƒ\}}|idjotdI||fIJn|djot||ƒ‚nt|ƒ}|dtjo|t}n|dt}|i|ƒ|iƒ\}}|idjotdI||fIJn||fSdS(sHSMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.
        R0isdata:ibiþÿÿÿR1N(
RRTRQRtreplR<RGRR
RtqR/R(RRRRR€((RR0×s 


cCs |idt|ƒƒ|iƒS(s5SMTP 'verify' command -- checks for address validity.tvrfyN(RRTR	taddressRQ(RRƒ((RtverifyîscCs |idt|ƒƒ|iƒS(s5SMTP 'verify' command -- checks for address validity.texpnN(RRTR	RƒRQ(RRƒ((RR…õscCs”d„}d„}
d}d}d}
|idjoƒ|idjosd|i	ƒdjo
djnpG|i
ƒ\}}d|jo
djnpt
||ƒ‚q³q·n|id	ƒptd
ƒ‚n|id	iƒ}|||
g}	d}x&|	D]}||jo|}PqqW||joX|id|ƒ\}}|djo||fSn|i||||ƒƒ\}}nØ||jo-|id|d
|
||ƒƒ\}}nž||
jos|idd|
t|ddƒfƒ\}}|djot||ƒ‚n|it|ddƒƒ\}}n|djotdƒ‚n|ddgjot||ƒ‚n||fS(sALog in on an SMTP server that requires authentication.

        The arguments are:
            - user:     The user name to authenticate with.
            - password: The password for the authentication.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPException            No suitable authentication method was
                                  found.
        cCs?ti|ƒ}|dti||ƒiƒ}t	|ddƒS(NRfteolR#(
tbase64tdecodestringt	challengetuserthmactHMACtpasswordt	hexdigesttresponset
encode_base64(R‰RŠRR((Rtencode_cram_md5s cCstd|||fddƒS(Ns%s%s%sR†R#(RRŠR(RŠR((Rtencode_plainstPLAINsCRAM-MD5tLOGINiÈii+Res,SMTP AUTH extension not supported by server.tAUTHi÷Rfs%s %sR†R#iNs(No suitable authentication method found.iëN(R‘R’t
AUTH_PLAINt
AUTH_CRAM_MD5t
AUTH_LOGINRRcR$RhRdRaRRWRRwRR2Rjtauthlisttpreferred_authst
authmethodtmethodR`RŠRRR(RRŠRRR›RWRœR‘R™RšR˜R—R–R’((RtloginüsP		 (
	

%
	$
	%
%
cCsl|idƒ\}}|djo@ti|i||ƒ}t
|i|ƒ|_t|ƒ|_n||fS(svPuts the connection to the SMTP server into TLS mode.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.
        tSTARTTLSiÜN(
RR`RWtreplyR7tsslRHtkeyfiletcertfileRRR"RX(RR¡R¢RRŸRW((RtstarttlsNs
cCs%|idjoƒ|idjosd|iƒdjo
djnpG|iƒ\}}	d|jo
djnpt||	ƒ‚qq“ng}|i
oM|idƒo|idt
|ƒƒnx|D]}|i|ƒqÕWn|i||ƒ\}}	|djo |iƒt||	|ƒ‚nh}t|tƒo
|g}nxT|D]L}
|i|
|ƒ\}}	|djo!|djo||	f||
<q_q_Wt
|ƒt
|ƒjo|iƒt|ƒ‚n|i|ƒ\}}	|djo|iƒt||	ƒ‚n|S(	sÔ	This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        iÈii+tsizessize=%diúiûN(RRcR$RhRdRaRRWRt
esmtp_optsRiRwR[RRtmail_optionstoptionR{t	from_addrRyRtsenderrst
isinstancetto_addrst
basestringRkR~trcpt_optionsRR0R(RR¨R«RR¦R­RR§R¥RWRkR©((Rtsendmail^sB8 (






cCsL|io|iiƒnd|_|io|iiƒnd|_dS(s(Close the connection to the SMTP server.N(RRXR R$RH(R((RR ¼s
	
cCs|idƒ|iƒdS(sTerminate the SMTP session.tquitN(RR`R (R((RR¯Æs
(!RR
RR<R$RXRcRhRiRR=R4RRTRQR`RaRdRwRxRyRzR{R~R0R„R‚R…RR£R®R R¯(((RRÄs<		)		(
2							R^	
t__main__cCs'tii|dƒtiiƒiƒS(Ns: (tsyststdoutRtprompttstdinR'R\(R³((RR³ÑstFromtTot,sEnter message, end with ^D:R#isMessage length is %dR>(.RR7R-R)R‡R‹temail.base64MIMEtencodeRR±RGt__all__RFR/tcompiletIRlt	ExceptionRRRRRRRRRRR"R	R
RRR³tfromaddrRjttoaddrsRR´R'RZRtserverR=R®R¯( R‡RRR"R³R¿RºRRRFR-RRRRRR)R¾RR±RR	RRZR7R
RÀRGRRlR‹R/((Rt?!sZ					

*

		
ÿÿ
		


Anon7 - 2021