AlkantarClanX12

Your IP : 18.119.19.205


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/smtplib.cpython-311.opt-2.pyc

�

c��fw���(�	ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Zgd�ZdZdZdZdZdZd	Zejd
ej��ZGd�de��ZGd
�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Z Gd�de��Z!Gd�de��Z"Gd�de��Z#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*Z/Gd+�d,e,��Z0e1d-kr�d.�Z2e2d/��Z3e2d0���4d1��Z5e6d2��d3Z7	ej8�9��Z:e:sne7e:zZ7�"e6d5e;e7��z��e,d6��Z<e<�=d4��e<�>e3e5e7��e<�?��dSdS)7�N)�body_encode)
�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c��eZdZdS)rN��__name__�
__module__�__qualname__���./opt/alt/python311/lib64/python3.11/smtplib.pyrrHs������>�>rrc��eZdZdS)rNrrrrrrK��������rrc��eZdZdS)rNrrrrrrRs�������rrc��eZdZ	d�ZdS)rc�4�||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgs   r�__init__zSMTPResponseException.__init__cs���������3�K��	�	�	rN�rrrr(rrrrrZs(������� � � � � rrc��eZdZ	d�ZdS)rc�D�||_||_||_|||f|_dSr!)r"r#�senderr$)r%r&r'r,s    rr(zSMTPSenderRefused.__init__os)������������3��'��	�	�	rNr)rrrrrhs(�������(�(�(�(�(rrc��eZdZ	d�ZdS)r	c�$�||_|f|_dSr!)�
recipientsr$)r%r/s  rr(zSMTPRecipientsRefused.__init__}s��$����M��	�	�	rNr)rrrr	r	us(�������"�"�"�"�"rr	c��eZdZdS)r
Nrrrrr
r
�s������1�1rr
c��eZdZdS)rNrrrrrr�s������0�0rrc��eZdZdS)rNrrrrrr�s������,�,rrc��eZdZdS)r
Nrrrrr
r
�rrr
c��	tj�|��\}}||fdkr.|����d��r|Sd|zSd|zS)N��r6�<z<%s>)�email�utils�	parseaddr�strip�
startswith��
addrstring�displayname�addrs   rrr�sp�����-�-�j�9�9��K���T��h�&�&������(�(��-�-�	����
�"�"��D�=�rc�^�tj�|��\}}||fdkr|S|S)Nr5)r8r9r:r=s   r�
_addr_onlyrB�s7����-�-�j�9�9��K���T��h�&�&����Krc	�b�	tjddtjdt|����S)Nz(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datas rrr�s3���
�6�*�d�
��&��d�3�3�5�5�5rc�.�tjdd|��S)Ns(?m)^\.s..)rFrG)�bindatas r�_quote_periodsrM�s��
�6�+�u�g�.�.�.rc�8�tjdt|��S)NrDrErIs r�	_fix_eolsrO�s���F�*�D�$�7�7�7rTFc�F�eZdZ	dZdZdZdZdZdZdZ	e
Zdddej
dfd�Zd�Zd�Zd	�Zd
�Zd�Zd,d
�Zd�Zd-d�Zd�Zd-d�Zd-d�Zd-d�Zd�Zd-d�Zd�Zd�Zd�Zd.d�Z d.d�Z!d�Z"d�Z#e#Z$d�Z%d�Z&d d!�d"�Z'd/d#�Z(d/d$�Z)d/d%�Z*d d!�d&�Z+d0d'�Z,		d1d(�Z-		d2d)�Z.d*�Z/d+�Z0dS)3rrN�ehloFr6c���	||_||_i|_d|_||_d|_|rC|�||��\}}|dkr$|���t||���|�	||_	dStj��}d|vr	||_	dSd}		tjtj
����}	n#tj$rYnwxYwd|	z|_	dS)N�asciir���.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer�local_hostname�socket�getfqdn�
gethostbyname�gethostname�gaierror)
r%�host�portr^rWrZr&r'�fqdnr@s
          rr(z
SMTP.__init__�s��	���
���� ��� '���,���%&��"��	2��,�,�t�T�2�2�K�T�3��s�{�{��
�
����&�t�S�1�1�1��%�"0�D����
�>�#�#�D��d�{�{�&*��#�#�#�#���!�/��0B�0D�0D�E�E�D�D��������D�����&,�t�m��#�#�#s�%C�C�Cc��|Sr!r�r%s r�	__enter__zSMTP.__enter__s���rc���	|�d��\}}|dkrt||���n#t$rYnwxYw|���dS#|���wxYw)N�QUIT��)�docmdrrr])r%r$r&�messages    r�__exit__z
SMTP.__exit__s��	� �J�J�v�.�.�M�D�'��s�{�{�+�D�'�:�:�:���%�	�	�	��D�	����
�J�J�L�L�L�L�L��D�J�J�L�L�L�L���s!�.1�A�
>�A�>�A�A-c��	||_dSr!)�
debuglevel)r%rqs  r�set_debuglevelzSMTP.set_debuglevel"s��	�%����rc���|jdkrJttj������g|�Rdt
ji�dSt|dt
ji�dS)N��file)rq�print�datetime�now�time�sys�stderr�r%r$s  r�_print_debugzSMTP._print_debug+sk���?�Q����(�#�'�'�)�)�.�.�0�0�I�4�I�I�I�c�j�I�I�I�I�I��4�)�c�j�)�)�)�)�)rc��|�|std���|jdkr|�d||f|j��t	j||f||j��S)N�0Non-blocking socket (timeout=0) is not supportedrzconnect: to)�
ValueErrorrqr}rZr_�create_connection)r%rdrerWs    r�_get_socketzSMTP._get_socket1sm����w���O�P�P�P��?�Q������m�d�D�\�4�;N�O�O�O��'��t��g�(,�(;�=�=�	=r�	localhostc�T�	|r||_|s�|�d��|�d��kr`|�d��}|dkrE|d|�||dzd�}}	t|��}n#t$rtd���wxYw|s|j}tjd|||��|�	|||j
��|_d|_|�
��\}}|jdkr#|�dt!|����||fS)N�:rrtznonnumeric portzsmtplib.connect�connect:)rZ�find�rfind�intr��OSError�default_portrz�auditr�rW�sockru�getreplyrqr}�repr)r%rdrerZ�ir&r's       rr\zSMTP.connect;s=��		��	1�"0�D���	5����3���4�:�:�c�?�?�:�:��
�
�3���A��A�v�v�!�"�1�"�X�t�A��E�F�F�|�d��5��t�9�9�D�D��!�5�5�5�!�"3�4�4�4�5�����	%��$�D��	�#�T�4��6�6�6��$�$�T�4���>�>��	���	��m�m�o�o���s��?�Q������j�$�s�)�)�4�4�4��c�{�s�,A<�<Bc��	|jdkr#|�dt|����|jr�t	|t
��r|�|j��}tj	d||��	|j�
|��dS#t$r$|���td���wxYwtd���)Nrzsend:zsmtplib.send�Server not connectedzplease run connect() first)rqr}r�r��
isinstance�str�encoderYrzr��sendallr�r]r)r%�ss  r�sendz	SMTP.send\s���%��?�Q������g�t�A�w�w�/�/�/��9�
	G��!�S�!�!�
4��H�H�T�2�3�3���I�n�d�A�.�.�.�
E��	�!�!�!�$�$�$�$�$���
E�
E�
E��
�
����,�-C�D�D�D�
E����)�)E�F�F�Fs�=B�.Cc���	|dkr|}n|�d|��}d|vsd|vr<|�dd���dd��}td|�����|�|�t����dS)Nr6� �
�
z\nz\rz=command and arguments contain prohibited newline characters: )�replacer�r�rH)r%�cmdr$r�s    r�putcmdzSMTP.putcmdos���+��2�:�:��A�A�������A��1�9�9���	�	��	�	�$��&�&�.�.�t�U�;�;�A��S�PQ�S�S���
�	
�	�	�Q�,��,�,�����rc��	g}|j�|j�d��|_		|j�tdz��}nE#t
$r8}|���tdt|��z���d}~wwxYw|s#|���td���|j	dkr#|�
dt|����t|��tkr$|���tdd���|�|d	d��d
����|dd�}	t!|��}n#t"$rd}YnwxYw|dd	�d
krn��fd�|��}|j	dkr|�
d|�d|����||fS)N�rbrtz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (z); Msg: )rur��makefile�readline�_MAXLINEr�r]rr�rqr}r��lenr�appendr;r�r��join)r%�resp�line�er&�errcode�errmsgs       rr�z
SMTP.getreply|s���	����9���	�*�*�4�0�0�D�I�	�
7��y�)�)�(�Q�,�7�7�����
7�
7�
7��
�
����,�-O�/2�1�v�v�.6�7�7�7�����
7�����
O��
�
����,�-M�N�N�N����"�"��!�!�(�D��J�J�7�7�7��4�y�y�8�#�#��
�
����+�C�1A�B�B�B��K�K��Q�R�R����z�2�2�3�3�3�����8�D�
��d�)�)�����
�
�
�����
�����A�a�C�y�D� � ��5	�8���D�!�!���?�Q������������P�Q�Q�Q����s)�"A�
B�3B�B�E.�.E=�<E=c�X�	|�||��|���Sr!�r�r�)r%r�r$s   rrmz
SMTP.docmd�s'��;����C������}�}���rc��	|�d|p|j��|���\}}||_||fS)N�helo)r�r^r��	helo_resp)r%�namer&r's    rr�z	SMTP.helo�sG��	�	
���F�D�7�D�$7�8�8�8��m�m�o�o���s�����c�{�rc��	i|_|�|j|p|j��|���\}}|dkr6t|��dkr#|���td���||_|dkr||fSd|_	|j�
d���d��}|d=|D�]}t�
|��}|rC|j�dd	��d
z|�d��dz|jd<�bt!j
d|��}|r�|�d�����}|j|�d��d����}	|dkr+|j�|d	��d
z|	z|j|<��|	|j|<��||fS)
Nr�rr��Tzlatin-1r��authr6r�z((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�feature)rXr��ehlo_msgr^r�r�r]r�	ehlo_resp�
does_esmtp�decode�split�
OLDSTYLE_AUTH�match�get�groupsrF�group�lower�string�endr;)
r%r�r&r'r��each�
auth_match�mr��paramss
          rrQz	SMTP.ehlo�s���	�!������D�M�4�#>�4�+>�?�?�?��m�m�o�o���s��2�:�:�#�c�(�(�a�-�-��J�J�L�L�L�(�)?�@�@�@�����3�;�;��#�;������~�$�$�Y�/�/�5�5�d�;�;����G��	:�	:�D�'�,�,�T�2�2�J��
�.2�.A�.E�.E�f�b�.Q�.Q��/� *� 1� 1�!� 4� 4�Q� 7�/8��#�F�+����D�d�K�K�A��
:��'�'�)�,�,�2�2�4�4����!�%�%�	�"2�"2�"3�"3�4�:�:�<�<���f�$�$�37�3F�3J�3J�7�TV�3W�3W�!�4"�$*�4+�D�'��0�0�4:�D�'��0���c�{�rc�:�	|���|jvSr!)r�rX)r%�opts  r�has_extnz
SMTP.has_extn�s��E��y�y�{�{�d�1�1�1rc�d�	|�d|��|���dS)N�helprtr�r|s  rr�z	SMTP.help�s.��	*����F�D�!�!�!��}�}���q�!�!rc�<�	d|_|�d��S)NrS�rset)rYrmrhs rr�z	SMTP.rset�s��4� '����z�z�&�!�!�!rc�T�		|���dS#t$rYdSwxYwr!)r�rrhs r�_rsetz
SMTP._rset�s?��	�	��I�I�K�K�K�K�K��%�	�	�	��D�D�	���s��
'�'c�.�	|�d��S)N�noop)rmrhs rr�z	SMTP.noops��;��z�z�&�!�!�!rrc�L�	d}|rd|jr]td�|D����r,|�d��rd|_nt	d���dd�|��z}|�ddt|���|����|���S)	Nr6c3�FK�|]}|���dkV��dS)�smtputf8N)r�)�.0�xs  r�	<genexpr>zSMTP.mail.<locals>.<genexpr>s/����:�:�Q�1�7�7�9�9�j�(�:�:�:�:�:�:rr�zutf-8z SMTPUTF8 not supported by serverr��mailzFROM:)	r��anyr�rYrr�r�rr�)r%r,�options�
optionlists    rr�z	SMTP.mails���	��
��	1�t��	1��:�:�'�:�:�:�:�:�
<��=�=��,�,�<�,3�D�)�)�/�:�<�<�<��s�x�x��0�0�0�J����F�F�9�V�+<�+<�+<�j�j�I�J�J�J��}�}���rc���	d}|r|jrdd�|��z}|�ddt|���|����|���S)Nr6r��rcptzTO:)r�r�r�rr�)r%�recipr�r�s    rr�z	SMTP.rcpt$sg��I��
��	1�t��	1��s�x�x��0�0�0�J����F�F��5�)9�)9�)9�:�:�F�G�G�G��}�}���rc�T�	|�d��|���\}}|jdkr|�d||f��|dkrt	||���t|t��r"t|���d��}t|��}|dd�tkr
|tz}|dztz}|�|��|���\}}|jdkr|�d||f��||fS)NrJrzdata:ibrS����.)r�r�rqr}r
r�r�rOr�rM�bCRLFr�)r%r'r&�repl�qs     rrJz	SMTP.data,s��	�	
���F�����}�}�����t��?�Q������g��d�|�4�4�4��3�;�;���d�+�+�+��#�s�#�#�
5���n�n�+�+�G�4�4���s�#�#�A�����v������I���D��5� �A��I�I�a�L�L�L��-�-�/�/�K�T�3����"�"��!�!�'�D�#�;�7�7�7��#�;�rc�r�	|�dt|����|���S)N�vrfy�r�rBr��r%�addresss  r�verifyzSMTP.verifyIs/��C����F�J�w�/�/�0�0�0��}�}���rc�r�	|�dt|����|���S)N�expnr�r�s  rr�z	SMTP.expnPs/��<����F�J�w�/�/�0�0�0��}�}���rc���	|j�d|j�_d|���dcxkrdks<n|���\}}d|cxkrdksnt	||���dSdSdSdS)N��ri+)r�r�rQr�r)r%r&r�s   r�ehlo_or_helo_if_neededzSMTP.ehlo_or_helo_if_neededWs���		��>�!�d�n�&<��4�9�9�;�;�q�>�0�0�0�0�S�0�0�0�0�#�y�y�{�{���t��t�*�*�*�*�s�*�*�*�*�'��d�3�3�3�	"�!�&<�&<�0�0�*�*rT��initial_response_okc��	|���}|r
|��nd}|�Kt|�d��d���}|�d|dz|z��\}}d|_n |�d|��\}}d|_|dkr�|xjdz
c_tj|��}t||���d��d���}|�|��\}}|jtkr!td	t||f��z���|dk��|d
vr||fSt||���)NrSr6)�eol�AUTHr�rtriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64r�rmr[�base64�decodebytes�
_MAXCHALLENGErr�r
)	r%�	mechanism�
authobjectr��initial_response�responser&r��	challenges	         rr�z	SMTP.authhsz��	�*�O�O�%�%�	�,?�I�J�J�L�L�L�T���'�$�%5�%<�%<�W�%E�%E�2�N�N�N�H��:�:�f�i�#�o��.H�I�I�L�T�4�)*�D�&�&��:�:�f�i�8�8�L�T�4�)*�D�&��c�k�k��&�&�!�+�&�&��*�4�0�0�I�$��
�9�%�%�,�,�W�5�5�2�?�?�?�H��:�:�h�/�/�L�T�4��)�M�9�9�#�J��D�$�<�(�(�)�����c�k�k��:����$�<��%�d�D�1�1�1rc��	|�dS|jdztj|j�d��|d�����zS)Nr�rS�md5)�user�hmac�HMAC�passwordr��	hexdigest�r%rs  r�
auth_cram_md5zSMTP.auth_cram_md5�sW��	(����4��y�3�����M� � ��)�)�9�e�"=�"=�=F�Y�[�[�I�	Irc�&�d|j�d|j��S)N�)r	rrs  r�
auth_plainzSMTP.auth_plain�s��	$�!�Y�Y�Y��
�
�6�6rc�:�	|�|jdkr|jS|jS)N�)r[r	rrs  r�
auth_loginzSMTP.auth_login�s*��	$���� :�Q� >� >��9���=� rc���	|���|�d��std���|jd����gd�}�fd�|D��}|std���||c|_|_|D]z}d|����	dd��z}	|�
|t||��|�	��\}}	|d
vr||	fcS�b#t$r}
|
}Yd}
~
�sd}
~
wwxYw|�)Nr�z,SMTP AUTH extension not supported by server.)zCRAM-MD5�PLAIN�LOGINc���g|]}|�v�|��	Srr)r�r��advertised_authlists  �r�
<listcomp>zSMTP.login.<locals>.<listcomp>�s.���4�4�4�T��2�2�2��2�2�2rz(No suitable authentication method found.�auth_�-�_r�r�)
r�r�rrXr�rr	rr�r�r��getattrr
)
r%r	rr��preferred_auths�authlist�
authmethod�method_namer&r�r��last_exceptionrs
            @r�loginz
SMTP.login�s����	�6	
�#�#�%�%�%��}�}�V�$�$�	@�'�>�@�@�
@�#�1�&�9�?�?�A�A��9�8�8��4�4�4�4�_�4�4�4���	L�� J�K�K�K�
$(�� ��	�4�=�"�	#�	#�J�!�J�$4�$4�$6�$6�$>�$>�s�C�$H�$H�H�K�	
#�#�y�y����k� :� :�(;� )� =� =���t�
�:�%�%� �$�<�'�'�'�&��*�
#�
#�
#�!"�����������
#�����s�<0C0�0
D�:D�Dc�\�	|���|�d��std���|�d��\}}|dkr�tstd���|�|�t
d���|�|�t
d���|�|� ddl}|�d	td
��|�tj||���}|�|j
|j���|_
d|_d|_d|_i|_d
|_nt)||���||fS)N�starttlsz+STARTTLS extension not supported by server.�STARTTLSrTz&No SSL support included in this Python�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr��certfile�keyfile��server_hostnameF)r�r�rrm�	_have_ssl�RuntimeErrorr��warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketr�rVrur�r�rXr�r)r%r.r-�contextr��replyr3s       rr'z
SMTP.starttls�s���	� 	
�#�#�%�%�%��}�}�Z�(�(�	?�'�=�?�?�
?��
�
�:�.�.�
��u��3�;�;��
M�"�#K�L�L�L��"�w�':� �"-�.�.�.��"�x�';� �"-�.�.�.��"�h�&:������
�
�7�8J�A�O�O�O����4�h�=D�F�F�F���+�+�D�I�<@�J�,�H�H�D�I��D�I�
"�D�N�!�D�N�"$�D��#�D�O�O�
(��e�4�4�4��e�}�rc�>�	|���g}t|t��r"t|���d��}|jrT|�d��r%|�dt|��z��|D]}|�|���|�	||��\}}	|dkr@|dkr|�
��n|���t||	|���i}
t|t��r|g}|D]W}|�
||��\}}	|dkr
|dkr||	f|
|<|dkr#|�
��t|
����Xt|
��t|��kr#|���t|
���|�|��\}}	|dkr?|dkr|�
��n|���t!||	���|
S)NrS�sizezsize=%dr�i��)r�r�r�rOr�r�r�r�r�r�r]r�rr�r	rJr
)r%�	from_addr�to_addrsr'�mail_options�rcpt_options�
esmtp_opts�optionr&r��senderrsr�s            r�sendmailz
SMTP.sendmail(s��=	�|	
�#�#�%�%�%��
��c�3���	1��C�.�.�'�'��0�0�C��?�	*��}�}�V�$�$�
8��!�!�)�c�#�h�h�"6�7�7�7�&�
*�
*���!�!�&�)�)�)�)��y�y��J�7�7���t��3�;�;��s�{�{��
�
������
�
����#�D�$�	�:�:�:����h��$�$�	"� �z�H��	6�	6�D��9�9�T�<�8�8�L�T�4�����$�#�+�+�"&�������s�{�{��
�
����+�H�5�5�5���x�=�=�C��M�M�)�)��J�J�L�L�L�'��1�1�1��y�y��~�~���t��3�;�;��s�{�{��
�
������
�
������d�+�+�+��rc��	|���|�d��}|�d}n%t|��dkrd}ntd���|�I|dz|vr||dzn
||dz}tj�|g��dd}|�Sd	�||d
z||dz||dzfD��}d
�tj�|��D��}tj|��}	|	d=|	d=d}
	d�|g|����	d��n6#t$r)|�d��std���d}
YnwxYwtj��5}|
rDtj�||j�d������}g|�d�d�R}ntj�|��}|�|	d���|���}
ddd��n#1swxYwY|�|||
||��S)NzResent-Dater6rtzResent-z0message has more than one 'Resent-' header block�Sender�Fromrc��g|]}|�|��Sr!r)r��fs  rrz%SMTP.send_message.<locals>.<listcomp>�s(��-�-�-�� �m��,�m�mr�To�Bcc�Ccc��g|]
}|d��S)rtr)r��as  rrz%SMTP.send_message.<locals>.<listcomp>�s��L�L�L���!��L�L�Lrz
Resent-BccFrSr�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8z
BODY=8BITMIMEr)�linesep)r��get_allr�r�r8r9�getaddresses�copyr�r��UnicodeEncodeErrorr�r�io�BytesIO�	generator�BytesGeneratorrQ�clone�flatten�getvaluerE)r%r'r>r?r@rA�resent�
header_prefix�addr_fields�msg_copy�
international�bytesmsg�g�flatmsgs              r�send_messagezSMTP.send_message�s���	�:	
�#�#�%�%�%����]�+�+���>��M�M�
��[�[�A�
�
�%�M�M��O�P�P�P��� -�x�7�C�?�?��]�X�5�6�6� #�M�F�$:� ;�
���0�0�)��=�=�a�@��C�I���-�-�s�=�4�+?�'@�'*�=�5�+@�'A�'*�=�4�+?�'@�'B�-�-�-�K�M�L�e�k�&>�&>�{�&K�&K�L�L�L�H��9�S�>�>���U�O��\�"��
�	!��G�G�Y�*��*�+�+�2�2�7�;�;�;�;��!�	!�	!�	!��=�=��,�,�
L�+�K�L�L�L�!�M�M�M�
	!�����Z�\�\�	*�X��
=��O�2�2��S�Z�%5�%5�4�%5�%@�%@�3�B�B��K��K�z�K�?�K�K����O�2�2�8�<�<��
�I�I�h��I�/�/�/��'�'�)�)�G�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*��}�}�Y��'�<�)�+�+�	+s%�+D>�>0E1�0E1�BH$�$H(�+H(c���		|j}d|_|r|���|j}d|_|r|���dSdS#|j}d|_|r|���wwxYwr!)rur]r�)r%rur�s   rr]z
SMTP.close�s���6�		��9�D��D�I��
��
�
�����9�D��D�I��
��
�
������
�
���9�D��D�I��
��
�
�����
���s�$A�'A6c��	|�d��}dx|_|_i|_d|_|���|S)N�quitF)rmr�r�rXr�r])r%�ress  rrjz	SMTP.quit�sE��)��j�j�� � ��*.�.����� �������
�
�����
r�r�rN)r6)rr!)NNN)rr)NNrr)1rrrrqr�rur�r�r�r��	SMTP_PORTr�r_�_GLOBAL_DEFAULT_TIMEOUTr(rirorrr}r�r\r�r�r�rmr�rQr�r�r�r�r�r�r�rJr�r�r�r�r�rrrr%r'rErgr]rjrrrrr�s��������8�J��D��D��I��H��I��J��L��Q�t��7� $�.4�.4�.4�.4�`������%�%�%�*�*�*�=�=�=�����BG�G�G�& � � � �/�/�/�b��������1�1�1�1�f2�2�2�"�"�"�"�"�"�"�

�
�
�"�"�"�����*�������:���
�D����4�4�4�"BF�.2�.2�.2�.2�.2�`I�I�I�I�7�7�7�7�
!�!�!�!�<@�@�@�@�@�@�D6�6�6�6�p?A� �f�f�f�f�P:>�35�K+�K+�K+�K+�Z�������rrc�F��eZdZ	eZdddddejddfd�Z�fd�Z�xZ	S)�SMTP_SSLr6rNc	�2�|�|�td���|�|�td���|�|� ddl}	|	�dtd��||_||_|�t
j||���}||_t�
||||||��dS)Nr)r*rr+rr,)r�r3r4r5r.r-r6r7r9rr()
r%rdrer^r.r-rWrZr9r3s
          rr(zSMTP_SSL.__init__s����"�w�':� �"-�.�.�.��"�x�';� �"-�.�.�.��"�h�&:������
�
�7�8J�A�O�O�O�"�D�L�$�D�M����4�h�=D�F�F�F��"�D�L��M�M�$��d�N�G�(�
*�
*�
*�
*�
*rc����|jdkr|�d||f��t���|||��}|j�||j���}|S)Nrr�r/)rqr}�superr�r9r8rV)r%rdrerW�
new_socket�	__class__s     �rr�zSMTP_SSL._get_socketsp������"�"��!�!�*�t�T�l�;�;�;����,�,�T�4��A�A�J���1�1�*�BF�*�2�N�N�J��r)
rrr�
SMTP_SSL_PORTr�r_rnr(r��
__classcell__�rus@rrprp�so�������	�%�� "��4�!�D�#�;�$(�$�	*�	*�	*�	*�.	�	�	�	�	�	�	�	�	rrpi�c�F��eZdZ	dZdeddejf�fd�	Zd�fd�	Z�xZ	S)	�LMTP�lhlor6Nc�V��	t���|||||���dS)N)r^rZrW)rsr()r%rdrer^rZrWrus      �rr(z
LMTP.__init__<sA���(�
������t�N�(6��	�	I�	I�	I�	I�	Irr�rc����	|ddkr$t���|||���S|j�|jstd���	t	jtjtj��|_|jtjur|j�	|j��d|_
|j�|��nW#t$rJ|jdkr|�
d|��|jr|j���d|_�wxYw|���\}}|jdkr|�
d|��||fS)Nr�/)rZrz
connect fail:r�)rsr\rWr�r_�AF_UNIX�SOCK_STREAMr�rn�
settimeoutrur�rqr}r]r�)r%rdrerZr&r'rus      �rr\zLMTP.connectBsV���K���7�c�>�>��7�7�?�?�4��n�?�M�M�M��<�#�D�L�#��O�P�P�P�	��
�f�n�f�6H�I�I�D�I��|�6�#A�A�A��	�$�$�T�\�2�2�2��D�I��I���d�#�#�#�#���	�	�	����"�"��!�!�/�4�8�8�8��y�
"��	���!�!�!��D�I��
	�����m�m�o�o���s��?�Q������j�#�.�.�.��c�{�s�BC�AD'rl)
rrrr��	LMTP_PORTr_rnr(r\rwrxs@rrzrz,s|�������4��H��Y�t� $�f�.L�I�I�I�I�I�I����������rrz�__main__c���tj�|dz��tj���tj������S)Nz: )rz�stdout�write�flush�stdinr�r;)�prompts rr�r�asP���
����$��'�'�'��
�������y�!�!�#�#�)�)�+�+�+rrHrK�,zEnter message, end with ^D:r6rtzMessage length is %dr�)@r_rXrF�email.utilsr8�
email.message�email.generatorr�r
rVrwrz�email.base64mimerr��__all__rmrvrHr�r�r�compile�Ir�r�rrrrrr	r
rrr
rrBrrMrOr6r1�ImportErrorrrpr�r�rzrr��fromaddrr��toaddrsrvr'r�r�r�r��serverrrrErjrrr�<module>r�s����R�
�
�
�	�	�	�	�	�	�	�	�������������
�
�
�
�������������
�
�
�
�9�9�9�9�9�9�-�-�-��

�	��
�
�������
���
�<���.�.�
�?�?�?�?�?�G�?�?�?������M���������]���� � � � � �M� � � �(�(�(�(�(�-�(�(�(�
"�
"�
"�
"�
"�M�
"�
"�
"�2�2�2�2�2�)�2�2�2�1�1�1�1�1�,�1�1�1�-�-�-�-�-�)�-�-�-������3����������5�5�5�/�/�/�8�8�8���J�J�J��I�I�������I�I�I�����t�t�t�t�t�t�t�t�l
�1�-�-�-�-�-�4�-�-�-�^�N�N�:����

�	�/�/�/�/�/�4�/�/�/�h�z���,�,�,�
�v�f�~�~�H��f�T�l�l� � ��%�%�G�	�E�
'�(�(�(�
�C���y�!�!�#�#���	���D�j��	�

�E�
 �3�3�s�8�8�
+�,�,�,�
�T�+�
�
�F�
���!����
�O�O�H�g�s�+�+�+�
�K�K�M�M�M�M�M�)�s�6C=�=D�D