python (3.11.7)

(root)/
lib/
python3.11/
__pycache__/
smtplib.cpython-311.pyc

ej*dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZgdZdZdZdZdZd	Zd
ZejdejZGdd
eZGddeZGddeZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#GddeZ$d Z%d!Z&d"Z'd#Z(d$Z)	ddl*Z*d%Z+n
#e,$rd&Z+YnwxYwGd'd(Z-e+r#Gd)d*e-Z.e/d*d+Z0Gd,d-e-Z1e2d.krd/Z3e3d0Z4e3d15d2Z6e7d3d4Z8	ej9:Z;e;sne8e;zZ8"e7d6e<e8ze-d7Z=e=>d5e=?e4e6e8e=@dSdS)8aSMTP/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)body_encode)

SMTPExceptionSMTPNotSupportedErrorSMTPServerDisconnectedSMTPResponseExceptionSMTPSenderRefusedSMTPRecipientsRefused
SMTPDataErrorSMTPConnectError
SMTPHeloErrorSMTPAuthenticationError	quoteaddr	quotedataSMTPi
s
i z	auth=(.*)ceZdZdZdS)rz4Base class for all exceptions raised by this module.N__name__
__module____qualname____doc__;/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/smtplib.pyrrHs>>>>rrceZdZdZdS)rzThe command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    NrrrrrrKrrceZdZdZdS)rzNot 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.
    NrrrrrrRsrrceZdZdZdZdS)ra2Base 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.
    c4||_||_||f|_dSN)	smtp_code
smtp_errorargs)selfcodemsgs   r__init__zSMTPResponseException.__init__cs3K			rNrrrrr)rrrrrZs-     rrceZdZdZdZdS)rzSender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cD||_||_||_|||f|_dSr")r#r$senderr%)r&r'r(r-s    rr)zSMTPSenderRefused.__init__os)3'			rNr*rrrrrhs-(((((rrceZdZdZdZdS)r	zAll 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.
    c$||_|f|_dSr")
recipientsr%)r&r0s  rr)zSMTPRecipientsRefused.__init__}s$M			rNr*rrrr	r	us-"""""rr	ceZdZdZdS)r
z'The SMTP server didn't accept the data.Nrrrrr
r
s1111rr
ceZdZdZdS)rz&Error during connection establishment.Nrrrrrrs0000rrceZdZdZdS)rz"The server refused our HELO reply.Nrrrrrrs,,,,rrceZdZdZdS)r
zvAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    Nrrrrr
r
rrr
ctj|\}}||fdkr.|dr|Sd|zSd|zS)zQuote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    r7<z<%s>)emailutils	parseaddrstrip
startswith
addrstringdisplaynameaddrs   rrrsk
--j99KTh&&((--	
""D=rc^tj|\}}||fdkr|S|S)Nr6)r9r:r;r>s   r
_addr_onlyrCs7--j99KTh&&Krc	`tjddtjdt|S)zQuote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    internet CRLF end-of-line.
    z(?m)^\.z..(?:\r\n|\n|\r(?!\n))resubCRLFdatas rrrs.6*d
&d33555rc.tjdd|S)Ns(?m)^\.s..)rGrH)bindatas r_quote_periodsrNs
6+ug...rc8tjdt|S)NrErFrJs r	_fix_eolsrPsF*D$777rTFcHeZdZdZdZdZdZdZdZdZ	dZ
eZddde
jdfdZdZd	Zd
ZdZdZd-dZdZd.dZdZd.dZd.dZd.dZdZd.dZdZdZdZ d/dZ!d/dZ"dZ#dZ$e$Z%dZ&d Z'd!d"d#Z(d0d$Z)d0d%Z*d0d&Z+d!d"d'Z,d1d(Z-		d2d)Z.		d3d*Z/d+Z0d,Z1dS)4raThis 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.
        rNehloFr7c||_||_i|_d|_||_d|_|rC|||\}}|dkr$|t|||	||_	dStj}d|vr	||_	dSd}		tjtj
}	n#tj$rYnwxYwd|	z|_	dS)aInitialize 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.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        asciirN.z	127.0.0.1z[%s])_hosttimeoutesmtp_featurescommand_encodingsource_address_auth_challenge_countconnectcloserlocal_hostnamesocketgetfqdn
gethostbynamegethostnamegaierror)
r&hostportr_rXr[r'r(fqdnrAs
          rr)z
SMTP.__init__s$
  ',%&"	2,,tT22KT3s{{

&tS111%"0D
>##Dd{{&*####!/0B0D0DEEDDD&,tm###s%CCCc|Sr"rr&s r	__enter__zSMTP.__enter__src	|d\}}|dkrt||n#t$rYnwxYw|dS#|wxYw)NQUIT)docmdrrr^)r&r%r'messages    r__exit__z
SMTP.__exit__s	 JJv..MD's{{+D':::%			D	
JJLLLLLDJJLLLLs!.1A
>A>AA-c||_dS)zSet 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)
debuglevel)r&rrs  rset_debuglevelzSMTP.set_debuglevel"s%rc|jdkrJttjg|Rdt
jidSt|dt
jidS)Nfile)rrprintdatetimenowtimesysstderrr&r%s  r_print_debugzSMTP._print_debug+sk?Q(#''))..00I4IIIcjIIIII4)cj)))))rc||std|jdkr|d||f|jt	j||f||jS)N0Non-blocking socket (timeout=0) is not supportedrzconnect: to)
ValueErrorrrr~r[r`create_connection)r&rerfrXs    r_get_socketzSMTP._get_socket1smwOPPP?QmdD\4;NOOO'tg(,(;==	=r	localhostcR|r||_|s|d|dkr`|d}|dkrE|d|||dzd}}	t|}n#t$rtdwxYw|s|j}tjd||||	|||j
|_d|_|
\}}|jdkr#|dt!|||fS)apConnect 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.

        :rNruznonnumeric portzsmtplib.connectconnect:)r[findrfindintrOSErrordefault_portr{auditrrXsockrvgetreplyrrr~repr)r&rerfr[ir'r(s       rr]zSMTP.connect;s8	1"0D	534::c??::

3AAvv!"1"XtAEFF|d5t99DD!555!"34445	%$D	#T4666$$T4>>		mmoos?Qj$s))444c{s+A;;Bc|jdkr#|dt||jrt	|t
r||j}tj	d||	|j
|dS#t$r$|tdwxYwtd)zSend `s' to the server.rzsend:zsmtplib.sendServer not connectedzplease run connect() firstN)rrr~rr
isinstancestrencoderZr{rsendallrr^r)r&ss  rsendz	SMTP.send\s?QgtAww///9
	G!S!!
4HHT233IndA...
E	!!!$$$$$
E
E
E

,-CDDD
E))EFFFs<B.Cc|dkr|}n|d|}d|vsd|vr<|dddd}td|||tdS)	zSend a command to the server.r7 

z\nz\rz=command and arguments contain prohibited newline characters: N)replacerrrI)r&cmdr%rs    rputcmdzSMTP.putcmdos2::AAA199				$&&..tU;;ASPQSS
	
		Q,,,rcg}|j|jd|_		|jtdz}nE#t
$r8}|tdt|zd}~wwxYw|s#|td|j	dkr#|
dt|t|tkr$|tdd	||d
dd|dd}	t!|}n#t"$rd
}YnwxYw|dd
dkrnfd|}|j	dkr|
d|d|||fS)aGet 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.
        Nrbruz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:izLine too long.s 	
-
zreply: retcode (z); Msg: )rvrmakefilereadline_MAXLINErr^rrrrr~rlenrappendr<rrjoin)r&resplineer'errcodeerrmsgs       rrz
SMTP.getreply|s9	**400DI	
7y))(Q,77
7
7
7

,-O/21vv.6777
7
O

,-MNNN""!!(DJJ7774yy8##

+C1ABBBKKQRRz223338D
d))



AaCyD  5	8D!!?QPQQQs)"A
B3BBE--E<;E<cV||||S)z-Send a command, and return its response code.rr)r&rr%s   rrnz
SMTP.docmds$C}}rc|d|p|j|\}}||_||fS)zwSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        helo)rr_r	helo_resp)r&namer'r(s    rrz	SMTP.helosB
	
FD7D$7888mmoosc{rc$i|_||j|p|j|\}}|dkr6t|dkr#|td||_|dkr||fSd|_	t|jtsJt|j|j
dd}|d=|D]}t|}|rC|jdd	d
z|ddz|jd<bt'jd|}|r|d}|j|dd
}	|dkr+|j|d	d
z|	z|j|<|	|j|<||fS)zx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        rrrTzlatin-1rauthr7rz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?featureN)rYrehlo_msgr_rrr^r	ehlo_resp
does_esmtprbytesrdecodesplit
OLDSTYLE_AUTHmatchgetgroupsrGgrouplowerstringendr<)
r&rr'r(reach
auth_matchmrparamss
          rrRz	SMTP.ehlos
!DM4#>4+>???mmoos2::#c((a--JJLLL()?@@@3;;#;$.%00FF$t~2F2FFFF~$$Y//55d;;G	:	:D',,T22J
.2.A.E.Efb.Q.Q/ * 1 1! 4 4Q 7/8#F+DdKKA
:''),,2244!%%	"2"2"3"34::<<f$$373F3J3J7TV3W3W!4"$*4+D'004:D'0c{rc8||jvS)z7Does the server support a given SMTP service extension?)rrY)r&opts  rhas_extnz
SMTP.has_extnsyy{{d111rcb|d||dS)z;SMTP 'help' command.
        Returns help text from server.helprurr}s  rrz	SMTP.helps+	
FD!!!}}q!!rc:d|_|dS)z&SMTP 'rset' command -- resets session.rTrset)rZrnris rrz	SMTP.rsets 'zz&!!!rcR	|dS#t$rYdSwxYw)aInternal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        N)rrris r_rsetz
SMTP._rsets:	IIKKKKK%			DD	s
&&c,|dS)z-SMTP 'noop' command -- doesn't do anything :>noop)rnris rrz	SMTP.noopszz&!!!rrcJd}|rd|jr]td|Dr,|drd|_nt	ddd|z}|ddt|||S)	a8SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        r7c3FK|]}|dkVdS)smtputf8N)r).0xs  r	<genexpr>zSMTP.mail.<locals>.<genexpr>s/::Q17799j(::::::rrzutf-8z SMTPUTF8 not supported by serverrmailzFROM:)	ranyrrZrrrrr)r&r-options
optionlists    rrz	SMTP.mails
	1t	1::':::::
<==,,<,3D))/:<<<sxx000JFF9V+<+<+<jjIJJJ}}rcd}|r|jrdd|z}|ddt|||S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r7rrcptzTO:)rrrrr)r&reciprrs    rrz	SMTP.rcpt$sd
	1t	1sxx000JFF5)9)9)9::FGGG}}rcR|d|\}}|jdkr|d||f|dkrt	||t|tr"t|d}t|}|ddtkr
|tz}|dztz}|||\}}|jdkr|d||f||fS)	aSMTP '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.  If msg
        is a string, lone '\r' and '\n' characters are converted to
        '\r\n' characters.  If msg is bytes, it is transmitted as is.
        rKrzdata:ibrTN.)rrrrr~r
rrrPrrNbCRLFr)r&r(r'replqs     rrKz	SMTP.data,s	
F}}t?Qgd|4443;;d+++#s##
5nn++G44s##AvID5 AIIaLLL--//KT3""!!'D#;777#;rcp|dt||S)z5SMTP 'verify' command -- checks for address validity.vrfyrrCrr&addresss  rverifyzSMTP.verifyI,FJw//000}}rcp|dt||S)z.SMTP 'expn' command -- expands a mailing list.expnrrs  rrz	SMTP.expnPrrc|jd|j_d|dcxkrdks<n|\}}d|cxkrdksnt	||dSdSdSdS)abCall self.ehlo() and/or self.helo() if needed.

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

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        Nri+)rrrRrr)r&r'rs   rehlo_or_helo_if_neededzSMTP.ehlo_or_helo_if_neededWs>!dn&<499;;q>0000S0000#yy{{tt****s****'d333	"!&<&<00**rTinitial_response_okc|}|r
|nd}|Kt|dd}|d|dz|z\}}d|_n |d|\}}d|_|d	kr|xjdz
c_tj|}t||dd}||\}}|jtkr!td
t||fz|d	k|dvr||fSt||)aAuthentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        NrTr7)eolAUTHrruriNz4Server AUTH mechanism infinite loop. Last response: i)upper
encode_base64rrnr\base64decodebytes
_MAXCHALLENGErrr
)	r&	mechanism
authobjectrinitial_responseresponser'r	challenges	         rrz	SMTP.authhsu,OO%%	,?IJJLLLT'$%5%<%<W%E%E2NNNH::fi#o.HIILT4)*D&&::fi88LT4)*D&ckk&&!+&&*400I$
9%%,,W552???H::h//LT4)M99#JD$<(()ckk:$<%dD111rc|dS|jdztj|jd|dzS)zh Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set.NrrTmd5)userhmacHMACpasswordr	hexdigestr&r	s  r
auth_cram_md5zSMTP.auth_cram_md5sR4y3M  ))9e"="==FY[[I	Irc&d|jd|jS)ze Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set.)rrrs  r
auth_plainzSMTP.auth_plains"YYY

66rc8||jdkr|jS|jS)ze Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set.N)r\rrrs  r
auth_loginzSMTP.auth_logins' :Q > >9= rc||dstd|jdgd}fd|D}|std||c|_|_|D]z}d|	ddz}	|
|t|||	\}}	|d
vr||	fcSb#t$r}
|
}Yd}
~
sd}
~
wwxYw|)awLog in on an SMTP server that requires authentication.

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

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        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.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        rz,SMTP AUTH extension not supported by server.)zCRAM-MD5PLAINLOGINcg|]}|v|	Srr)rradvertised_authlists  r
<listcomp>zSMTP.login.<locals>.<listcomp>s.444T222222rz(No suitable authentication method found.auth_-_rrN)
rrrrYrrrrrrrgetattrr
)
r&rrrpreferred_authsauthlist
authmethodmethod_namer'rrlast_exceptionrs
            @rloginz
SMTP.logins~8	
##%%%}}V$$	@'>@@
@#1&9??AA9884444_444	L JKKK
$( 	4="	#	#J!J$4$4$6$6$>$>sC$H$HHK	
##yyk : :(; ) = =t
:%% $<'''&*
#
#
#!"
#s;0C//
D9DDcZ||dstd|d\}}|dkrtstd||t
d||t
d|| d	dl}|d
td|tj||}||j
|j
|_
d|_d|_d|_i|_d|_nt)||||fS)aPuts the connection to the SMTP server into TLS mode.

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

        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.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        starttlsz+STARTTLS extension not supported by server.STARTTLSrUz&No SSL support included in this PythonN4context and keyfile arguments are mutually exclusive5context and certfile arguments are mutually exclusiverAkeyfile and certfile are deprecated, use a custom context insteadrcertfilekeyfileserver_hostnameF)rrrrn	_have_sslRuntimeErrorrwarningswarnDeprecationWarningssl_create_stdlib_contextwrap_socketrrWrvrrrYrr)r&r1r0contextrreplyr6s       rr*z
SMTP.starttlss"	
##%%%}}Z((	?'=??
?

:..
u3;;
M"#KLLL"w': "-..."x'; "-..."h&:

78JAOOO4h=DFFF++DI<@J,HHDIDI
"DN!DN"$D#DOO
(e444e}rc<|g}t|tr"t|d}|jrT|dr%|dt|z|D]}|||	||\}}	|dkr@|dkr|
n|t||	|i}
t|tr|g}|D]W}|
||\}}	|dkr
|dkr||	f|
|<|dkr#|
t|
Xt|
t|kr#|t|
||\}}	|dkr?|dkr|
n|t!||	|
S)a|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.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \r and \n characters are converted to \r\n characters.

        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).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        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.

        rTsizezsize=%dri)rrrrPrrrrrrr^rrrr	rKr
)r&	from_addrto_addrsr(mail_optionsrcpt_options
esmtp_optsoptionr'rsenderrsrs            rsendmailz
SMTP.sendmail(s@	
##%%%
c3	1C..''00C?	*}}V$$
8!!)c#hh"6777&
*
*!!&))))yyJ77t3;;s{{



#D$	:::h$$	" zH	6	6D99T<88LT4$#++"&s{{

+H555x==CMM))JJLLL'111yy~~t3;;s{{



d+++rc||d}|d}n%t|dkrd}ntd|I|dz|vr||dzn
||dz}tj|gd	d}|Sd
||dz||dz||d
zfD}dtj|D}tj|}	|	d=|	d=d}
	d|g|	dn6#t$r)|dstdd}
YnwxYwtj5}|
rDtj||jd}g|ddR}ntj|}||	d|}
dddn#1swxYwY||||
||S)a~Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        zResent-DateNr7ruzResent-z0message has more than one 'Resent-' header blockSenderFromrcg|]}||Sr"r)rfs  rrz%SMTP.send_message.<locals>.<listcomp>s(--- m,mmrToBccCccg|]
}|dS)rur)ras  rrz%SMTP.send_message.<locals>.<listcomp>sLLL!LLLrz
Resent-BccFrTrzOne or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)utf8)policySMTPUTF8z
BODY=8BITMIMEr)linesep)rget_allrrr9r:getaddressescopyrrUnicodeEncodeErrorrrioBytesIO	generatorBytesGeneratorrTcloneflattengetvaluerH)r&r(rArBrCrDresent
header_prefixaddr_fieldsmsg_copy
internationalbytesmsggflatmsgs              rsend_messagezSMTP.send_messages>	
##%%%]++>MM
[[A

%MMOPPP -x7C??]X566 #MF$: ;
00)==a@CI--s=4+?'@'*=5+@'A'*=4+?'@'B---KMLek&>&>{&K&KLLLH9S>>UO\"
	!GGY**++227;;;;!	!	!	!==,,
L+KLLL!MMM
	!Z\\	*X
=O22SZ%5%54%5%@%@3BBKKzK?KKO228<<
IIhI///''))G	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*}}Y'<)++	+s%+D==0E0/E0BH##H'*H'c	|j}d|_|r||j}d|_|r|dSdS#|j}d|_|r|wwxYw)z(Close the connection to the SMTP server.N)rvr^r)r&rvrs   rr^z
SMTP.closes		9DDI


9DDI




9DDI



s$A'A5c|d}dx|_|_i|_d|_||S)zTerminate the SMTP session.quitNF)rnrrrYrr^)r&ress  rrmz	SMTP.quitsBjj  *.. 


rrrN)r7)rr")NNN)rr)NNrr)2rrrrrrrrvrrrr	SMTP_PORTrr`_GLOBAL_DEFAULT_TIMEOUTr)rjrprsr~rr]rrrrnrrRrrrrrrrrKrrrrrrrrr(r*rHrjr^rmrrrrrs8JDDIHIJLQt7 $.4.4.4.4`%%%***===BGGG&    ///b1111f222"""""""



"""*:
D444"BF.2.2.2.2.2`IIII7777
!!!!<@@@@@@D6666p?A ffffP:>35K+K+K+K+ZrrcHeZdZdZeZdddddejddfdZfdZ	xZ
S)SMTP_SSLa This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        r7rNc	2||td||td|| ddl}	|	dtd||_||_|t
j||}||_t
||||||dS)Nr,r-rr.rr/)rr6r7r8r1r0r9r:r<rr))
r&rerfr_r1r0rXr[r<r6s
          rr)zSMTP_SSL.__init__s"w': "-..."x'; "-..."h&:

78JAOOO"DL$DM4h=DFFF"DLMM$dNG(
*
*
*
*
*rc|jdkr|d||ft|||}|j||j}|S)Nrrr2)rrr~superrr<r;rW)r&rerfrX
new_socket	__class__s     rrzSMTP_SSL._get_socketsp""!!*tTl;;;,,T4AAJ11*BF*2NNJr)rrrr
SMTP_SSL_PORTrr`rqr)r
__classcell__rxs@rrsrsst		% "4!D#;$($	*	*	*	*.									rrsicHeZdZdZdZdeddejffd	Zd	fd	Z	xZ
S)
LMTPaLMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary.lhlor7NcTt|||||dS)zInitialize a new instance.)r_r[rXN)rvr))r&rerfr_r[rXrxs      rr)z
LMTP.__init__<s@	tN(6		I	I	I	I	Irrrc|ddkr$t|||S|j|jstd	t	jtjtj|_|jtjur|j	|jd|_
|j|nW#t$rJ|jdkr|
d||jr|jd|_wxYw|\}}|jdkr|
d|||fS)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r/)r[Nrz
connect fail:r)rvr]rXrr`AF_UNIXSOCK_STREAMrrq
settimeoutrvrrrr~r^r)r&rerfr[r'r(rxs      rr]zLMTP.connectBsS7c>>77??4n?MMM<#DL#OPPP	
fnf6HIIDI|6#AAA	$$T\222DIId####			""!!/4888y
"	!!!DI
	mmoos?Qj#...c{sBCAD&ro)rrrrr	LMTP_PORTr`rqr)r]rzr{s@rr}r},s44HYt $f.LIIIIIIrr}__main__ctj|dztjtjS)Nz: )r{stdoutwriteflushstdinrr<)prompts rrrasP
$'''
y!!##))+++rrKrN,zEnter message, end with ^D:r7ruzMessage length is %dr)Arr`r[rGemail.utilsr9
email.messageemail.generatorrr
rYrxr{email.base64mimerr__all__rpryrIrrrcompileIrrrrrrrr	r
rrr
rrCrrNrPr9r4ImportErrorrrsrrr}rrfromaddrrtoaddrsrwr(rrrrserverrsrHrmrrr<module>rsR


								







999999---

	



<..
?????G???M]     M   (((((-(((
"
"
"
"
"M
"
"
"22222)22211111,111-----)---3555///888JJJIIIIIttttttttl
1-----4---^NN:

	/////4///hz,,,
vf~~HfTll  %%G	E
'(((
Cy!!##	Dj	

E
 33s88
+,,,
T+

F
!
OOHgs+++
KKMMMMM)s7C>>DD