403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/core/mail/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/core/mail/__pycache__/message.cpython-311.pyc
�

�|�e�B��.�ddlZddlmZmZmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZddlmZddlmZdd	lmZdd
lmZddlmZmZmZmZddlmZm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)ejd��Z*de*_+ejd��Z,ej-e,_+dZ.dZ/Gd�de0��Z1hd�Z2d�Z3d�Z4Gd�d��Z5Gd�de5e��Z6Gd�de5e��Z7Gd�d e5e��Z8Gd!�d"��Z9Gd#�d$e9��Z:dS)%�N)�charset�encoders�	generator�message_from_string)�HeaderParseError)�Header)�Address�parser)�Message)�MIMEBase)�MIMEMessage)�
MIMEMultipart)�MIMEText)�
formataddr�
formatdate�getaddresses�
make_msgid)�BytesIO�StringIO)�Path)�settings)�DNS_NAME)�	force_str�punycode�utf-8zapplication/octet-streami�c��eZdZdS)�BadHeaderErrorN)�__name__�
__module__�__qualname__���:/usr/lib/python3/dist-packages/django/core/mail/message.pyrr#s�������Dr"r>�reply-to�	resent-cc�	resent-to�
resent-bcc�resent-from�
resent-sender�cc�to�bcc�from�senderc����ptj�t|��}d|vsd|vrtd|�d|�d����	|�d��|���dkr!t
|�����}n}#t$rp|���tvr0d�	�fd	�t|f��D����}n"t
|������}YnwxYw||fS)
z6Forbid multi-line headers to prevent header injection.�
�
z*Header values can't contain newlines (got z for header �)�ascii�subject�, c3�8�K�|]}t|���V��dS�N)�sanitize_address)�.0�addr�encodings  �r#�	<genexpr>z,forbid_multi_line_headers.<locals>.<genexpr>As.�����^�^��,�T�8�<�<�^�^�^�^�^�^r")r�DEFAULT_CHARSET�strr�encode�lowerr�UnicodeEncodeError�ADDRESS_HEADERS�joinr)�name�valr;s  `r#�forbid_multi_line_headersrF7s ����3�8�3�H�

�c�(�(�C��s�{�{�d�c�k�k��n�^a�^a�^a�cg�cg�cg�h�i�i�i�	'��
�
�7�����:�:�<�<�9�$�$���+�+�$�$�&�&�C����1�1�1��:�:�<�<�?�*�*��)�)�^�^�^�^��WZ�V\�I]�I]�^�^�^�^�^�C�C���h�'�'�.�.�0�0�C���	1������9�s�B
�
A7D�Dc��d}t|t��s�t|��}	tj|��\}}|rtd|�d|�d����|jpd}|j}|jpd}nK#tt
tf$rtd|z���wxYw|\}}|�dd��\}}||z|z}d	|vsd
|vrtd���	|�d��t|�����}n2#t$r%t||�����}YnwxYw	|�d��n2#t$r%t||�����}YnwxYwt|��}t!||�
��}	t#||	jf��S)zF
    Format a pair of (name, address) or an email address string.
    NzInvalid address; only z could be parsed from "�"�zInvalid address "%s"�@�r0r1z7Invalid address; address parts cannot contain newlines.r3)�username�domain)�
isinstance�tuplerr
�get_mailbox�
ValueError�display_name�
local_partrMr�
IndexError�rsplitr?rrArr	r�	addr_spec)
r:r;�address�token�rest�nm�	localpartrM�
address_parts�parsed_addresss
          r#r8r8Js���G��d�E�"�"�3������
	(� �,�T�2�2�K�E�4��
� �j��u�u�d�d�d�$�����#�)�r�B��(�I��\�'�R�F�F��!�*�j�9�	<�	<�	<��3�d�:�;�;�;�	<�������G�#�N�N�3��2�2��	�6���N�V�+�M��}����
� 5� 5��R�S�S�S�+�
�	�	�'����
�B�Z�Z�
�
�
 �
 �����+�+�+�
�B��
!�
!�
(�
(�
*�
*����+����9�����!�!�!�!���9�9�9��9�h�/�/�6�6�8�8�	�	�	�9����
�f�
�
�F��i��?�?�?�N��r�>�3�4�5�5�5s/�A1�1*B�6D�,E�E�E�,F�
Fc��eZdZdd�Zdd�ZdS)�	MIMEMixinFr0c��t��}tj|d���}|�|||���|���S)a&Return the entire formatted message as a string.
        Optional `unixfrom' when True, means include the Unix From_ envelope
        header.

        This overrides the default as_string() implementation to not mangle
        lines that begin with 'From '. See bug #13433 for details.
        F��mangle_from_��unixfrom�linesep)rr�	Generator�flatten�getvalue��selfrdre�fp�gs     r#�	as_stringzMIMEMixin.as_stringxsH���Z�Z������7�7�7��	�	�	�$��7�	�;�;�;��{�{�}�}�r"c��t��}tj|d���}|�|||���|���S)a"Return the entire formatted message as bytes.
        Optional `unixfrom' when True, means include the Unix From_ envelope
        header.

        This overrides the default as_bytes() implementation to not mangle
        lines that begin with 'From '. See bug #13433 for details.
        Frarc)rr�BytesGeneratorrgrhris     r#�as_byteszMIMEMixin.as_bytes�sH���Y�Y���$�R�e�<�<�<��	�	�	�$��7�	�;�;�;��{�{�}�}�r"N)Fr0)rrr rmrpr!r"r#r_r_ws<���������������r"r_c��eZdZd�ZdS)�SafeMIMEMessagec�Z�t||d��\}}tj|||��dS)Nr3)rFr
�__setitem__�rjrDrEs   r#rtzSafeMIMEMessage.__setitem__�s2��-�d�C��A�A�	��c����d�C�0�0�0�0�0r"N)rrr rtr!r"r#rrrr�s#������1�1�1�1�1r"rrc�$�eZdZdd�Zd�Zdd�ZdS)�SafeMIMEText�plainNc�D�||_tj||||���dS)N)�_subtype�_charset)r;r�__init__)rj�_textrzr{s    r#r|zSafeMIMEText.__init__�s)�� ��
���$���8�L�L�L�L�L�Lr"c�d�t|||j��\}}tj|||��dSr7)rFr;rrtrus   r#rtzSafeMIMEText.__setitem__�s4��-�d�C���G�G�	��c���T�4��-�-�-�-�-r"c���|dkrUt|tj��s;td�|���D����}|rtnt
}t
j|||���dS)Nrc3�jK�|].}t|�����tkV��/dSr7)�lenr?�RFC5322_EMAIL_LINE_LENGTH_LIMIT)r9�lines  r#r<z+SafeMIMEText.set_payload.<locals>.<genexpr>�sL����!�!���D�K�K�M�M�"�"�%D�D�!�!�!�!�!�!r")r)rN�Charset�any�
splitlines�utf8_charset_qp�utf8_charsetr�set_payload)rj�payloadr�has_long_liness    r#r�zSafeMIMEText.set_payload�s����g���j��'�/�&J�&J�� �!�!�#�.�.�0�0�!�!�!���N�*8�I�o�o�\�G���T�7�G�<�<�<�<�<�<r")rxNr7)rrr r|rtr�r!r"r#rwrw�sO������M�M�M�M�.�.�.�	=�	=�	=�	=�	=�	=r"rwc��eZdZdd�Zd�ZdS)�SafeMIMEMultipart�mixedNc�>�||_tj||||fi|��dSr7)r;rr|)rjrz�boundary�	_subpartsr;�_paramss      r#r|zSafeMIMEMultipart.__init__�s.�� ��
���t�X�x��N�N�g�N�N�N�N�Nr"c�d�t|||j��\}}tj|||��dSr7)rFr;rrtrus   r#rtzSafeMIMEMultipart.__setitem__�s4��-�d�C���G�G�	��c��!�$��c�2�2�2�2�2r")r�NNN)rrr r|rtr!r"r#r�r��s;������O�O�O�O�3�3�3�3�3r"r�c�x�eZdZdZdZdZdZ			dd�Zdd�Zd	�Z	d
�Z
dd�Zdd�Zdd
�Z
d�Zd�Zd�Zdd�Zd�ZdS)�EmailMessagez"A container for email information.rxr�NrIc��|r9t|t��rtd���t|��|_ng|_|	r9t|	t��rtd���t|	��|_ng|_|r9t|t��rtd���t|��|_ng|_|
r9t|
t��rtd���t|
��|_ng|_|ptj	|_
||_|pd|_g|_
|r:|D]7}t|t��r|�|���-|j|��8|pi|_||_dS)�g
        Initialize a single email message (which can be sent to multiple
        recipients).
        z%"to" argument must be a list or tuplez%"cc" argument must be a list or tuplez&"bcc" argument must be a list or tuplez+"reply_to" argument must be a list or tuplerIN)rNr>�	TypeError�listr+r*r,�reply_tor�DEFAULT_FROM_EMAIL�
from_emailr4�body�attachmentsr�attach�
extra_headers�
connection)rjr4r�r�r+r,r�r��headersr*r��
attachments            r#r|zEmailMessage.__init__�s����	��"�c�"�"�
I�� G�H�H�H��2�h�h�D�G�G��D�G�
�	��"�c�"�"�
I�� G�H�H�H��2�h�h�D�G�G��D�G��	��#�s�#�#�
J�� H�I�I�I��C�y�y�D�H�H��D�H��	��(�C�(�(�
O�� M�N�N�N� ��N�N�D�M�M��D�M�$�C��(C�������J�B��	�����	-�)�
-�
-�
��j�(�3�3�-��K�K�
�+�+�+�+��D�K��,�,�,�$�]����$����r"Fc�L�ddlm}|js||���|_|jS)Nr)�get_connection)�
fail_silently)�django.core.mailr�r�)rjr�r�s   r#r�zEmailMessage.get_connection�s;��3�3�3�3�3�3���	J�,�n�=�I�I�I�D�O���r"c��|jptj}t|j|j|��}|�|��}|j|d<|j�	d|j
��|d<|�|d|j��|�|d|j
��|�|d|j��d�|jD��}d|vrttj���|d	<d
|vrt#t$���|d<|j���D]"\}}|���d
kr|||<�#|S)N�Subject�From�To�CczReply-Toc�6�g|]}|�����Sr!)r@)r9�keys  r#�
<listcomp>z(EmailMessage.message.<locals>.<listcomp>s ��B�B�B���	�	���B�B�Br"�date)�	localtime�Datez
message-id)rMz
Message-IDr-)r;rr=rwr��content_subtype�_create_messager4r��getr��_set_list_header_if_not_emptyr+r*r�r�EMAIL_USE_LOCALTIMErr�itemsr@)rjr;�msg�header_namesrD�values      r#�messagezEmailMessage.message�sR���=�<�H�$<���4�9�d�&:�H�E�E���"�"�3�'�'�����I���(�,�,�V�T�_�E�E��F���*�*�3��d�g�>�>�>��*�*�3��d�g�>�>�>��*�*�3�
�D�M�J�J�J�C�B�t�/A�B�B�B����%�%�
%�x�/K�L�L�L�C��K��|�+�+� *�(� ;� ;� ;�C����-�3�3�5�5�	"�	"�K�D�%��z�z�|�|�v�%�%�!��D�	���
r"c�D�d�|j|jz|jzD��S)z�
        Return a list of all recipients of the email (includes direct
        addressees as well as Cc and Bcc entries).
        c��g|]}|�|��Sr!r!)r9�emails  r#r�z+EmailMessage.recipients.<locals>.<listcomp>s��K�K�K�%�U�K��K�K�Kr")r+r*r,)rjs r#�
recipientszEmailMessage.recipientss)��
L�K�D�G�d�g�$5���$@�K�K�K�Kr"c��|���sdS|�|���|g��S)zSend the email message.r)r�r��
send_messages)rjr�s  r#�sendzEmailMessage.sends?����� � �	��1��"�"�=�1�1�?�?���G�G�Gr"c���t|t��r$|�J�|�J�|j�|��dS|�J�|p t	j|��dpt}|�dd��\}}|dkrBt|t��r-	|�	��}n#t$r
t}YnwxYw|j�|||f��dS)a�
        Attach a file with the given filename and content. The filename can
        be omitted and the mimetype is guessed, if not provided.

        If the first parameter is a MIMEBase subclass, insert it directly
        into the resulting message attachments.

        For a text/* mimetype (guessed or specified), when a bytes object is
        specified as content, decode it as UTF-8. If that fails, set the
        mimetype to DEFAULT_ATTACHMENT_MIME_TYPE and don't decode the content.
        Nr�/rK�text)rNrr��append�	mimetypes�
guess_type�DEFAULT_ATTACHMENT_MIME_TYPE�split�bytes�decode�UnicodeDecodeError)rj�filename�content�mimetype�basetype�subtypes      r#r�zEmailMessage.attachs���h��)�)�	C��?�?�?��#�#�#���#�#�H�-�-�-�-�-��&�&�&��d�9�#7��#A�#A�!�#D�d�Hd�H� (���s�A� 6� 6��H�g��6�!�!��g�u�-�-�@�@�")�.�.�"2�"2����-�@�@�@�$@����@����

��#�#�X�w��$A�B�B�B�B�Bs�B+�+B?�>B?c���t|��}|�d��5}|���}|�|j||��ddd��dS#1swxYwYdS)al
        Attach a file from the filesystem.

        Set the mimetype to DEFAULT_ATTACHMENT_MIME_TYPE if it isn't specified
        and cannot be guessed.

        For a text/* mimetype (guessed or specified), decode the file's content
        as UTF-8. If that fails, set the mimetype to
        DEFAULT_ATTACHMENT_MIME_TYPE and don't decode the content.
        �rbN)r�open�readr�rD)rj�pathr��filer�s     r#�attach_filezEmailMessage.attach_file>s����D�z�z��
�Y�Y�t�_�_�	6���i�i�k�k�G��K�K��	�7�H�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s�1A#�#A'�*A'c�,�|�|��Sr7)�_create_attachments�rjr�s  r#r�zEmailMessage._create_messageNs���'�'��,�,�,r"c�n�|jr�|jptj}|}t	|j|���}|js|���r|�|��|jD]J}t|t��r|�|���-|�|j|����K|S�N)rzr;)r�r;rr=r��
mixed_subtyper��is_multipartr�rNr�_create_attachment)rjr�r;�body_msgr�s     r#r�z EmailMessage._create_attachmentsQs�����
	E��}�@��(@�H��H�#�T�-?�(�S�S�S�C��y�
%�H�1�1�3�3�
%��
�
�8�$�$�$�"�.�
E�
E�
��j�(�3�3�E��J�J�z�*�*�*�*��J�J�6�t�6�
�C�D�D�D�D��
r"c���|�dd��\}}|dkr%|jptj}t	|||��}n�|dkrr|dkrlt|t��r|���}n1t|t��stt|����}t||��}n9t||��}|�
|��tj|��|S)z�
        Convert the content, mimetype pair into a MIME attachment object.

        If the mimetype is message/rfc822, content may be an
        email.Message or EmailMessage object, as well as a str.
        r�rKr�r��rfc822)r�r;rr=rwrNr�r�rrrrrrr��Encoders�
encode_base64)rjr�r�r�r�r;r�s       r#�_create_mime_attachmentz$EmailMessage._create_mime_attachment_s���%�N�N�3��2�2���'��v����}�@��(@�H�%�g�w��A�A�J�J�
��
"�
"�w�(�':�':��'�<�0�0�
B�!�/�/�+�+������1�1�
B�.�i��.@�.@�A�A��(��'�:�:�J�J�"�(�G�4�4�J��"�"�7�+�+�+��"�:�.�.�.��r"c��|�||��}|rD	|�d��n#t$rdd|f}YnwxYw|�dd|���|S)zg
        Convert the filename, content, mimetype triple into a MIME attachment
        object.
        r3rrIzContent-Dispositionr�)r�)r�r?rA�
add_header)rjr�r�r�r�s     r#r�zEmailMessage._create_attachment}s���
�1�1�'�8�D�D�
��	Z�
3�����(�(�(�(��%�
3�
3�
3�#�R��2����
3�����!�!�"7��PX�!�Y�Y�Y��s�0�A�Ac��|rE	|j|}n/#t$r"d�d�|D����}YnwxYw|||<dSdS)zt
        Set msg's header, either from self.extra_headers, if present, or from
        the values argument.
        r5c3�4K�|]}t|��V��dSr7)r>)r9�vs  r#r<z=EmailMessage._set_list_header_if_not_empty.<locals>.<genexpr>�s(����!9�!9�Q�#�a�&�&�!9�!9�!9�!9�!9�!9r"N)r��KeyErrorrC)rjr��header�valuesr�s     r#r�z*EmailMessage._set_list_header_if_not_empty�sv��
�	 �
:��*�6�2�����
:�
:�
:��	�	�!9�!9�&�!9�!9�!9�9�9����
:�����C��K�K�K�	 �	 s�
�)>�>)
rIrINNNNNNNN)F)NNNr7)rrr �__doc__r�r�r;r|r�r�r�r�r�r�r�r�r�r�r�r!r"r#r�r��s������,�,��O��M��H�JN�EI��*%�*%�*%�*%�X�������6L�L�L�H�H�H�H�C�C�C�C�@6�6�6�6� -�-�-�������<����
 �
 �
 �
 �
 r"r�c�@��eZdZdZdZ			d	�fd�	Zd�Zd�Zd�Z�xZ	S)
�EmailMultiAlternativesz�
    A version of EmailMessage that makes it easy to send multipart/alternative
    messages. For example, including text and HTML versions of the text is
    made easier.
    �alternativerINc�n��t���|||||||||
|�
�
|	pg|_dS)r�N)�superr|�alternatives)
rjr4r�r�r+r,r�r�r�r�r*r��	__class__s
            �r#r|zEmailMultiAlternatives.__init__�sL���	������T�:�r�3�
�K��R��	
�	
�	
�)�.�B����r"c�N�|�J�|�J�|j�||f��dS)z-Attach an alternative content representation.N)r�r�)rjr�r�s   r#�attach_alternativez)EmailMultiAlternatives.attach_alternative�s<���"�"�"��#�#�#��� � �'�8�!4�5�5�5�5�5r"c�R�|�|�|����Sr7)r��_create_alternativesr�s  r#r�z&EmailMultiAlternatives._create_message�s$���'�'��(A�(A�#�(F�(F�G�G�Gr"c���|jptj}|jr[|}t	|j|���}|jr|�|��|jD]}|�|j|���� |Sr�)	r;rr=r�r��alternative_subtyper�r�r�)rjr�r;r�r�s     r#r�z+EmailMultiAlternatives._create_alternatives�s����=�<�H�$<����	G��H�#�T�-E�PX�Y�Y�Y�C��y�
%��
�
�8�$�$�$�#�0�
G�
G���
�
�7�4�7��E�F�F�F�F��
r")rIrINNNNNNNNN)
rrr r�r�r|r�r�r��
__classcell__)r�s@r#r�r��s����������
(��JN�OS�#'�/�/�/�/�/�/�6�6�6�H�H�H�	�	�	�	�	�	�	r"r�);r�r�rr�rr�rr�email.errorsr�email.headerr�email.headerregistryr	r
�
email.messager�email.mime.baser�email.mime.messager
�email.mime.multipartr�email.mime.textr�email.utilsrrrr�iorr�pathlibr�django.confr�django.core.mail.utilsr�django.utils.encodingrrr��
body_encodingr��QPr�r�rQrrBrFr8r_rrrwr�r�r�r!r"r#�<module>rs������������������*�)�)�)�)�)�������0�0�0�0�0�0�0�0�!�!�!�!�!�!�$�$�$�$�$�$�*�*�*�*�*�*�.�.�.�.�.�.�$�$�$�$�$�$�H�H�H�H�H�H�H�H�H�H�H�H� � � � � � � � ������� � � � � � �+�+�+�+�+�+�5�5�5�5�5�5�5�5��w��w�'�'��!���!�'�/�'�*�*�� '�
��� :��"%��	�	�	�	�	�Z�	�	�	�
�������&*6�*6�*6�Z��������81�1�1�1�1�i��1�1�1�=�=�=�=�=�9�h�=�=�=�,3�3�3�3�3�	�=�3�3�3�Y �Y �Y �Y �Y �Y �Y �Y �x'�'�'�'�'�\�'�'�'�'�'r"

Youez - 2016 - github.com/yon3zu
LinuXploit