403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/test/test_email/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/test_email/__pycache__/test_headerregistry.cpython-312.opt-1.pyc
�

���g����ddlZddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
ddlmZddlm
Z
mZddlmZdd	lmZe�ZGd
�de	�ZGd�d
e	�ZGd�de�Ze
Gd�de��Ze
Gd�de��Ze
Gd�de��Ze
Gd�de��Ze
Gd�de��Ze
Gd�de��Ze
Gd�de��ZGd�de	�ZGd �d!e�Z e!d"k(rejD�yy)#�N)�errors��policy)�Message)�
TestEmailBase�parameterize)�headerregistry)�Address�Group)�
decode_header)�	ALWAYS_EQc�^�eZdZd�Zd�ZGd�d�Zd�ZGd�d�Zd�Zd	�Z	d
�Z
d�Zy)
�TestHeaderRegistryc��tj�}|dd�}|j|tj�|j|tj�y�N�foobar�test�r	�HeaderRegistry�assertIsInstance�
BaseHeader�UnstructuredHeader��self�factory�hs   �8C:\Python312\\Lib\test\test_email\test_headerregistry.py� test_arbitrary_name_unstructuredz3TestHeaderRegistry.test_arbitrary_name_unstructuredsH�� �/�/�1���H�f�%�����a��!:�!:�;����a��!B�!B�C�c��tj�}|jd|j�|dd�}|j	|tj
�|j	|tj�y)N�Subjectr)r	r�assertNotIn�registryrr�UniqueUnstructuredHeaderrs   r�test_name_case_ignoredz)TestHeaderRegistry.test_name_case_ignoreds^�� �/�/�1������G�$4�$4�5��I�v�&�����a��!:�!:�;����a��!H�!H�Irc��eZdZd�Zy)�TestHeaderRegistry.FooBasec��y�N�)r�args�kws   r�__init__z#TestHeaderRegistry.FooBase.__init__"s��rN)�__name__�
__module__�__qualname__r-r*rr�FooBaser'!s��	rr1c���tj|j��}|dd�}|j||j�|j|tj�y)N)�
base_classrr)r	rr1rrrs   r� test_override_default_base_classz3TestHeaderRegistry.test_override_default_base_class%sL�� �/�/�4�<�<�H���H�f�%�����a����.����a��!B�!B�Crc�8�eZdZejj
Zy)�TestHeaderRegistry.FooDefaultN)r.r/r0r	r�parser*rr�
FooDefaultr6+s���1�1�7�7�rr8c���tj|j��}|dd�}|j|tj�|j||j�y)N��
default_classrr)r	rr8rrrs   r�test_override_default_classz.TestHeaderRegistry.test_override_default_class.sL�� �/�/�d�o�o�N���H�f�%�����a��!:�!:�;����a����1rc���tj|j��}|dd�}|j|tj�|j|tj
�y)Nr:�subjectr)r	rr8rrr$rs   r�2test_override_default_class_only_overrides_defaultzETestHeaderRegistry.test_override_default_class_only_overrides_default4sN�� �/�/�d�o�o�N���I�v�&�����a��!:�!:�;����a��!H�!H�Irc���tjd��}|dd�}|j|tj�|j|tj�y)NF)�use_default_mapr>rrrs   r�test_dont_use_default_mapz,TestHeaderRegistry.test_dont_use_default_map:sJ�� �/�/��F���I�v�&�����a��!:�!:�;����a��!B�!B�Crc��tj�}|dd�}|jdtj�|dd�}|j	|tj
�|j	|tj�|j	|tj
�|j	|tj�yr)r	r�map_to_typer$rrr)rr�h1�h2s    r�test_map_to_typez#TestHeaderRegistry.test_map_to_type@s��� �/�/�1��
�X�v�
&�����H�n�&M�&M�N�
�X�v�
&�����b�.�";�";�<����b�.�"C�"C�D����b�.�";�";�<����b�.�"I�"I�JrN)r.r/r0rr%r1r4r8r<r?rBrGr*rrrrs?��D�J���D�8�8�2�J�D�Krrc�4�eZdZej�Zd�Zy)�TestHeaderBasec�&�|j||�Sr))r)r�name�values   r�make_headerzTestHeaderBase.make_headerOs���|�|�D�%�(�(rN)r.r/r0r	rrrMr*rrrIrIKs��+�n�+�+�-�G�)rrIc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TestBaseHeaderFeaturesc��|jdd�}|j|t�|j|d�|jt|�d�y�Nr>�this is a test)rMr�str�assertEqual�rrs  r�test_strzTestBaseHeaderFeatures.test_strUsK�����Y�(8�9�����a��%�����,�-�����Q��!1�2rc�R�|jdd�}|j|ddd�y)Nr>rR���is)rMrTrUs  r�test_substrz"TestBaseHeaderFeatures.test_substr[s+�����Y�(8�9������1�Q���&rc�`�|jdd�}|j|jd�yrQ)rMrTrKrUs  r�
test_has_namez$TestBaseHeaderFeatures.test_has_name_s)�����Y�(8�9���������+rc��|jdd�}|jt�5t||d�ddd�y#1swYyxYw)Nr>rR�foo)rM�assertRaises�AttributeError�setattr)r�attrrs   r�
_test_attr_roz$TestBaseHeaderFeatures._test_attr_rocs;�����Y�(8�9��
�
�
�~�
.��A�t�U�#�/�
.�
.�s	�?�Ac�&�|jd�y)NrK�rd�rs r�test_name_read_onlyz*TestBaseHeaderFeatures.test_name_read_onlyhs�����6�"rc�&�|jd�y)N�defectsrfrgs r�test_defects_read_onlyz-TestBaseHeaderFeatures.test_defects_read_onlyks�����9�%rc�`�|jdd�}|jt|j�d�|j	|jt
�|jdd�}|jt|j�d�|j	|jt
�y)Nr>rRr�date��)rMrT�lenrjr�tuplerUs  r�test_defects_is_tuplez,TestBaseHeaderFeatures.test_defects_is_tuplens�����Y�(8�9������Q�Y�Y���+����a�i�i��/����V�R�(������Q�Y�Y���+����a�i�i��/rN)
r.r/r0rVr[r]rdrhrkrrr*rrrOrOSs%��3�'�,�$�
#�&�0rrOc�0�eZdZd�Zddgdfddgdfddd	�Zy
)�TestUnstructuredHeaderc�H�t|�}|dkDr|dng}d|rdndz}||dkDr|dn|zdz}|jd|�}|j||�|j|j|�|j|jtj��|�y)	NrzSubject:� rnro�
r!r)rprMrT�assertDefectsEqualrj�foldr�default)	r�source�decodedr+�lrj�header�foldedrs	         r�string_as_valuez&TestUnstructuredHeader.string_as_value�s���
��I���q�S�$�q�'�b���f�s�"�5���a��c�4��7�v�6��=�����Y��/������G�$�����	�	�7�3�������v�~�~��6��?rz=?utf-8?q?this_is_a_test?=rRz!=?gb2312?b?1eLKx9bQzsSy4srUo6E=?=u这是中文测试!z(=?utf-8?b?6L+Z5piv5Lit5paH5rWL6K+V77yB?=)z=?utf-8?q?=C3=89ric?=�Éric)z$The =?utf-8?q?=C3=89ric=2C?= Himself�The Éric, Himself)�rfc2047_simple_quopri�rfc2047_gb2312_base64�rfc2047_simple_nonascii_quopri� rfc2047_quopri_with_regular_textN)r.r/r0r��
string_paramsr*rrrtrt�s?��@� 
)����	"�
0�8��6�	"8�+�-"�%�Mrrtc	���eZdZdZej
d��Zeje�Zejdddddd	e�
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zd�Zd�Zy)�TestDateHeaderzSun, 23 Sep 2001 20:10:55 -0700i����)�hoursi��	���
�7)�tzinfoc�`�|jd|j�}|j||j�|j|j|j�|j|jj�|j
�|j|jd�y�Nrmr*)rM�
datestringrT�datetime�dt�	utcoffsetrjrUs  r�test_parse_datezTestDateHeader.test_parse_date�sy�����V�T�_�_�5������D�O�O�,�������T�W�W�-�������-�-�/����@�������B�'rc��|jd|j�}|j||j�|j|j|j�|j|j
d�yr�)rMr�rTr�r�rjrUs  r�test_set_from_datetimez%TestDateHeader.test_set_from_datetime�sX�����V�T�W�W�-������D�O�O�,�������T�W�W�-�������B�'rc���|jd|j�}|j|tj�|j|jd�|j|jd�y)Nrmror*)rMr�rr	�UniqueDateHeaderrT�	max_countrjrUs  r�test_date_header_propertiesz*TestDateHeader.test_date_header_properties�sV�����V�T�_�_�5�����a��!@�!@�A�������a�(�������B�'rc���|jd|j�}|j|tj�|j|jd�|j|jd�y)Nzresent-dater*)rMr�rr	�
DateHeaderrTr�rjrUs  r�"test_resent_date_header_propertiesz1TestDateHeader.test_resent_date_header_properties�sV�����]�D�O�O�<�����a��!:�!:�;�������d�+�������B�'rc���|jdd�}|jt|j�d�|j	|jdt
j�y)Nrmrnror)rMrTrprjrr�HeaderMissingRequiredValuerUs  r�test_no_value_is_defectz&TestDateHeader.test_no_value_is_defect�sJ�����V�R�(������Q�Y�Y���+����a�i�i��l�F�,M�,M�Nrc�*�d}|jd|�}|j||�|j|j�|jt	|j
�d�|j
|j
dtj�y)NzNot a date headerrmror�	rMrT�assertIsNoner�rprjrr�InvalidDateDefect�r�srs   r�test_invalid_date_formatz'TestDateHeader.test_invalid_date_format�sq�������V�Q�'������A�����!�*�*�%�����Q�Y�Y���+����a�i�i��l�F�,D�,D�Erc�*�d}|jd|�}|j||�|j|j�|jt	|j
�d�|j
|j
dtj�y)NzTue, 06 Jun 2017 27:39:33 +0600rmrorr�r�s   r�test_invalid_date_valuez&TestDateHeader.test_invalid_date_value�sq��-�����V�Q�'������A�����!�*�*�%�����Q�Y�Y���+����a�i�i��l�F�,D�,D�Erc��|jd|j�}|jt�5d|_ddd�y#1swYyxYw)Nrmr_)rMr�r`rar�rUs  r�test_datetime_read_onlyz&TestDateHeader.test_datetime_read_only�s9�����V�T�_�_�5��
�
�
�~�
.��A�J�/�
.�
.�s�A�Ac���ttj��}|j|d<|j	|d|j
�|j	|dj|j�y)Nr�Date)rrrzr�rTr�r�)r�ms  r�"test_set_date_header_from_datetimez1TestDateHeader.test_set_date_header_from_datetime�sS���6�>�>�*���G�G��&�	�����6��D�O�O�4�����6��+�+�T�W�W�5rN)r.r/r0r�r��	timedeltar��timezone�tzr�r�r�r�r�r�r�r�r�r�r*rrr�r��s{��3�J�"��"�"��,�I�	��	�	�9�	%�B�	��	�	�4��B��B��2�	>�B�(�(�(�(�O�
F�F��
6rr�c�L�eZdZd�Zidddddddigd	f�d
ddddddigd	f�dd	dddddif�d
ddddiej
gf�dddddiej
gf�dddddiej
gf�dddddiej
gf�dd�dd�dd�dd�dddddddif�d d!ddddd"if�d#d$ddddd%if�d&d'dddddigd(f�d)d*dddd+digd,f�d-d.dddd+d/if�id0d1dddd+d2if�d3d4dddd5d5d6�ej
gd7zf�d8d9d:d;d<d=d>igd?f�d@dAdBdCdDdEdFdGdH�gdIdJf�dKdLdBdCdDdEdFdGdMdN�gdLdOf�dPdQdBdCdDdRdSif�dTdUdBdCdDdRdVif�dWdXdBdCdDdRdYigdXf�dZd[j
d\�jdd]�d^d_d`dadbdc�ejgd7zdddef�dfdgdBdCdDdRdhigdif�djdkdBdCdDd`dligdmf�dndoj
d\�jdd]�dddddpdq�ejgdrdsf�dtdudddddigd	f�dvdwddddRdxigdyf�dzd{ddddRd|iej
gd}zd~f�dd�ddddd�dq�ej
gd}zd�d�f�d�d�d�d�d�dRd�iej
gd}zd�f��d�d�d�d�dRd�igd�fd�ddddRd�iej
gd�fd�ddddRd�iej
gd}zd�fd�ddddRd�iej
gd}zd�fd�ddddRd�iej
gd�d�fd�ddddRd�igd�fd�ddddd�iejgd�d�fd�ddddd�iejgd�d�fd�ddddd�igd�d�fd�d�d�d�dRd�iej
gd�fd�d�d�d�dRd�iej
gd7zd�fd�d�d�d�dRd�iej
gd}zd�fd�d�d�d�dRd�igd�d�fd��
�Z	y�)��TestContentTypeHeaderc���t|�}|dkDr|dni}|dkDr|dng}|dkDr|dtur|dn|}	|rdnd}
|dkDr|dn|
|	zdz}|jd|�}|j|j|�|j|j
|�|j|j|�|j|j|�|jt�5d	|jd
<ddd�|j|j|�|j||	�|j|jtj��|�y#1swY�hxYw)Nrro�zContent-Type: rn�rwzContent-Type�xyz�abcr)rp�DITTOrMrT�content_type�maintype�subtype�paramsr`�	TypeErrorrxrjryrrz)
rr{r�r�r�r+r}�parmdictrjr|r~rrs
             r�content_type_as_valuez+TestContentTypeHeader.content_type_as_value�s>��
��I����c�4��7�r����c�4��7�r����c�d�1�g�U�&:�4��7���*0�&�b���a�C��a��V�g�%5��%<�����^�V�4���������6�������X�.�������G�,�������8�,�
�
�
�y�
)�#�A�H�H�U�O�*�����	�	�7�3�����G�$�������v�~�~��6��?�	*�
)�s�*E!�!E*�
RFC_2045_1z)text/plain; charset=us-ascii (Plain text)�
text/plain�text�plain�charsetzus-asciiztext/plain; charset="us-ascii"�
RFC_2045_2ztext/plain; charset=us-ascii�
RFC_2045_3�no_subtype_in_content_typeztext/�no_slash_in_content_typer_�junk_text_in_content_typez<crazy "stuff">� too_many_slashes_in_content_typezimage/jpeg/foo�unknown_content_type)�	bad/namesr��bad�names�mixed_case_content_type)z
ImAge/JPeg�
image/jpeg�image�jpeg�spaces_in_content_type)z  text  /  plain  r�r�r��cfws_in_content_type)z"(foo) text (bar)/(baz)plain(stuff)r�r�r��
charset_paramztext/plain; charset="utf-8"zutf-8�capitalized_charsetztext/plain; charset="US-ASCII"zUS-ASCII�unknown_charsetztext/plain; charset="fOo"�fOo�*capitalized_charset_param_name_and_commentz*text/plain; (interjection) Charset="utf-8"ztext/plain; Charset="utf-8"�unquoted_param_valueztext/plain; title=foo�titleztext/plain; title="foo"�param_value_with_tspecialsz!text/plain; title="(bar)foo blue"z
(bar)foo blue�"param_with_extra_quoted_whitespacez0text/plain; title="  a     loong  way 	 home   "z  a     loong  way 	 home   �
bad_paramszblarg; baz; boorn)�baz�boor��spaces_around_param_equalsz0Multipart/mixed; boundary = "CPIMSSMTPC06p5f3tG"zmultipart/mixed�	multipart�mixed�boundary�CPIMSSMTPC06p5f3tGz.Multipart/mixed; boundary="CPIMSSMTPC06p5f3tG"�spaces_around_semiszPimage/jpeg; name="wibble.JPG" ; x-mac-type="4A504547" ; x-mac-creator="474B4F4E"r�r�r�z
wibble.JPG�4A504547�474B4F4E)rK�
x-mac-type�
x-mac-creatorzNimage/jpeg; name="wibble.JPG"; x-mac-type="4A504547"; x-mac-creator="474B4F4E"z^Content-Type: image/jpeg; name="wibble.JPG"; x-mac-type="4A504547";
 x-mac-creator="474B4F4E"
�lots_of_mime_paramszmimage/jpeg; name="wibble.JPG"; x-mac-type="4A504547"; x-mac-creator="474B4F4E"; x-extrastuff="make it longer"zmake it longer)rKr�r�zx-extrastuffz}Content-Type: image/jpeg; name="wibble.JPG"; x-mac-type="4A504547";
 x-mac-creator="474B4F4E"; x-extrastuff="make it longer"
�semis_inside_quotesz$image/jpeg; name="Jim&amp;&amp;Jill"rKzJim&amp;&amp;Jill�single_quotes_inside_quotesz!image/jpeg; name="Jim 'Bob' Jill"zJim 'Bob' Jill�double_quotes_inside_quotesz#image/jpeg; name="Jim \"Bob\" Jill"zJim "Bob" Jill�non_ascii_in_paramsufoo§/bar; b§r=two; baz=thr§ezlatin-1�surrogateescapeu
foo�/barufoo��bar�twouthr�e)ub�rr�u&foo�/bar; b�r="two"; baz="thr�e"uVContent-Type: =?unknown-8bit?q?foo=A7?=/bar; b�r="two";
 baz*=unknown-8bit''thr%A7e
�rfc2231_segmented_normal_valuesz(image/jpeg; name*0="abc"; name*1=".html"zabc.htmlzimage/jpeg; name="abc.html"�quotes_inside_rfc2231_valuez.image/jpeg; bar*0="baz\"foobar"; bar*1="\"baz"zbaz"foobar"bazz"image/jpeg; bar="baz\"foobar\"baz"�non_ascii_rfc2231_valueuGtext/plain; charset=us-ascii; title*=us-ascii'en'This%20is%20not%20f§nuThis is not f�n)r�r�u9text/plain; charset="us-ascii"; title="This is not f�n"z\Content-Type: text/plain; charset="us-ascii";
 title*=unknown-8bit''This%20is%20not%20f%A7n
�rfc2231_encoded_charsetz-text/plain; charset*=ansi-x3.4-1968''us-ascii� rfc2231_encoded_no_double_quotesz\text/plain;	name*0*=''This%20is%20;	name*1*=%2A%2A%2Afun%2A%2A%2A%20;	name*2="is it not.pdf"zThis is ***fun*** is it not.pdfz2text/plain; name="This is ***fun*** is it not.pdf"�"rfc2231_encoded_with_double_quoteszvtext/plain;	name*0*="us-ascii''This%20is%20even%20more%20";	name*1*="%2A%2A%2Afun%2A%2A%2A%20";	name*2="is it not.pdf"z)This is even more ***fun*** is it not.pdfr�z<text/plain; name="This is even more ***fun*** is it not.pdf"�)rfc2231_single_quote_inside_double_quotesz�text/plain; charset=us-ascii;	title*0*="us-ascii'en'This%20is%20really%20";	title*1*="%2A%2A%2Afun%2A%2A%2A%20";	title*2="isn't it!"z"This is really ***fun*** isn't it!zJtext/plain; charset="us-ascii"; title="This is really ***fun*** isn't it!"zZContent-Type: text/plain; charset="us-ascii";
 title="This is really ***fun*** isn't it!"
�3rfc2231_single_quote_in_value_with_charset_and_langzHapplication/x-foo;	name*0*="us-ascii'en-us'Frank's"; name*1*=" Document"zapplication/x-foo�applicationzx-foozFrank's Documentz*application/x-foo; name="Frank's Document"zFapplication/x-foo;	name*0="us-ascii'en-us'Frank's"; name*1=" Document"zus-ascii'en-us'Frank's Documentz9application/x-foo; name="us-ascii'en-us'Frank's Document"z/text/plain; NAME*0*=english_is_the_default.htmlzenglish_is_the_default.htmlz.text/plain; NAME="english_is_the_default.html"zjtext/plain;	name*0*="''This%20is%20even%20more%20";	name*1*="%2A%2A%2Afun%2A%2A%2A%20";	name*2="is it.pdf"z%This is even more ***fun*** is it.pdfz8text/plain; name="This is even more ***fun*** is it.pdf"zitext/plain;	name*0*="''This%20is%20even%20more%20";	name*1="%2A%2A%2Afun%2A%2A%2A%20";	name*2="is it.pdf"z3This is even more %2A%2A%2Afun%2A%2A%2A%20is it.pdfzFtext/plain; name="This is even more %2A%2A%2Afun%2A%2A%2A%20is it.pdf"zVContent-Type: text/plain;
 name="This is even more %2A%2A%2Afun%2A%2A%2A%20is it.pdf"
z1text/plain; name*0*=bogus'xx'ascii_is_the_default�ascii_is_the_defaultz'text/plain; name="ascii_is_the_default"z*text/plain; charset*=ascii''utf-8%F1%F2%F3uutf-8���u$text/plain; charset="utf-8���"z@Content-Type: text/plain; charset*=unknown-8bit''utf-8%F1%F2%F3
z*text/plain; charset*=ascii''utf-8%E2%80%9Duutf-8”utext/plain; charset="utf-8”"z@Content-Type: text/plain; charset*=unknown-8bit''utf-8%E2%80%9D
u-text/plain; charset*=utf-8”''utf-8%E2%80%9Dz9Content-Type: text/plain; charset*=utf-8''utf-8%E2%80%9D
zUapplication/x-foo;	name*0*="us-ascii'en-us'My";	name*1=" Document";	name*2=" For You"zMy Document For Youz-application/x-foo; name="My Document For You"zTapplication/x-foo;	name*0=us-ascii'en-us'My;	name*1*=" Document";	name*2*=" For You"zVapplication/x-foo;	name*0="us-ascii'en-us'My";	name*1*=" Document";	name*2*=" For You"z"us-ascii'en-us'My Document For Youz<application/x-foo; name="us-ascii'en-us'My Document For You"zrapplication/x-foo;	name="with spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaces"zXwith spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaceszrapplication/x-foo; name="with spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaceswith spaces"z�Content-Type: application/x-foo;
 name*0*=us-ascii''with%20spaceswith%20spaceswith%20spaceswith%20spaceswith;
 name*1*=%20spaceswith%20spaceswith%20spaceswith%20spaces
)
�)rfc2231_single_quote_in_non_encoded_value�rfc2231_no_language_or_charset�rfc2231_encoded_no_charset�rfc2231_partly_encoded�rfc2231_partly_encoded_2�(rfc2231_unknown_charset_treated_as_ascii�0rfc2231_bad_character_in_charset_parameter_value�8rfc2231_utf8_in_supposedly_ascii_charset_parameter_value�6rfc2231_nonascii_in_charset_of_charset_parameter_value�'rfc2231_encoded_then_unencoded_segments�'rfc2231_unencoded_then_encoded_segments�.rfc2231_quoted_unencoded_then_encoded_segments�+rfc2231_folded_segments_correctly_formattedN)
r.r/r0r�r�InvalidHeaderDefect�encode�decode�UndecodableBytesDefect�content_type_paramsr*rrr�r��sw��@�.[�	�7����
�
�#��,�.�	[�	�*����
�
�#��,�.�[�,	�,����
�
�#�%�-[�@	%������
�
'�
'�(�
'*�A[�P	#������
�
'�
'�(�
%*�Q[�`	$������
�
'�
'�(�
&*�a[�p	+������
�
'�
'�(�
-*�q[�L	�!�M[�\	"�$�][�h	!�#�i[�t	�!�u[�H	�)����
�� �"�I[�V	�,����
�
�#� %�W[�d	�'����
��� �e[�r	5�8����
�� ��)�7+�s[�R	�#����
�e���%�!�S[�f	%�/����
�o�&�'(�g[�t	-�?����
�5�6�/8�u[�B	������r�"�
�
'�
'�(��*�
,�C[�R	%�>����
�-�.��<�'�S[�f	�+����!�%�(�
*�
�+�+� �g[�H	�J����!�%�(�-�
/�
�J�J� �I[�p	�2����
�(�)� +�q[�~	&�1����
�%�&�((�[�L	&�2����
�%�&��2�(4�M[�^	��%�v�i�0���
�8I�2K�����|�4�
�
*�
*�+�A�-�4�
,�! �_[�J	*�6����
�Z� ��)�,+�K[�\	&�=����
�$�%��1�(3�][�n	"��#�V�I�.�v�v�j�5F�0H����"�-C�D��+�+�
,�
H�
>�
$�o[�L		"�=����
�
�#��,�$.�M	[�`		+�+�
���
�6�7��@�-�a	[�|		-�+�
���
�@�A�
�
'�
'�(��*�J�/�}	[�V
	4�(�
���"�-Q�R�
�
'�
'�(��*�=�A�6�W
[�v
	>�N����
�'�(�
�
'�
'�(��*�9�	@�w
[�NL����
�6�7��J�	6�
>����
�2�3�
�
'�
'�(�<�+>�'�
���
�<�=�
�
'�
'�(��*�F�'�'�
���
�<�=�
�
'�
'�(��*�F�#�'�
���
�J�K�
�
'�
'�(�K��%�$
@����
�+�,��5�57�
9����
�1�2�
�
*�
*�+�;�
7�
=�
9����
�
�#�
�
*�
*�+�,�
7�E�
<����
�
�#��,�
0�
C�&�
 ���
�*�+�
�
'�
'�(�;�4�"'�
 ���
�*�+�
�
'�
'�(��*�;�4�0'�
 ���
�9�:�
�
'�
'�(��*�L�;�$3����
�_�%��?�
J�
8�Y[�rr�c�b�eZdZd�Zdddej
gddfddejgfddgfd	�Zy
)�TestContentTransferEncodingc��t|�}|dkDr|dng}|dkDr|dtur|dn|}|rdnd}|dkDr|dn||zdz}|jd|�}	|j|	j|�|j|	j|�|j|	|�|j|	jtj��|�y)	NrrozContent-Transfer-Encoding: rnr�rwzContent-Transfer-Encodingr)
rpr�rMrT�cterxrjryrrz)
rr{rr+r}rjr|r~rrs
          r�cte_as_valuez(TestContentTransferEncoding.cte_as_value's���
��I����c�4��7�r����c�d�1�g�U�&:�4��7���7=�3�2���a�C��a��V�f�_�t�%;�����8�&�A���������$�����	�	�7�3�����G�$�������v�~�~��6��?r)�base64rrn�7bitzContent-Transfer-Encoding:
z7bit and a bunch morezbase64 r)�
RFC_2183_1�no_value�junk_after_cte�extra_space_after_cteN)r.r/r0rrr�r�
cte_paramsr*rrrr$s\��
@�"�

��
�
.�
.�/��*��
$��
�
'�
'�(�*�
���"�'�Jrrc���eZdZd�Zdddddd�gdd	fd
diej
gd
dfd
diejgfddddiejgfddddiejgdzddfddddiejgddfd�Zy)�TestContentDispositionc��t|�}|dkDr|dni}|dkDr|dng}|dkDr|dtur|dn|}|rdnd}|dkDr|dn||zdz}	|jd|�}
|j|
j|�|j|
j
|�|j
|
j|�|j|
|�|j|
jtj�	�|	�y)
Nrror�zContent-Disposition: rnr�rwzContent-Dispositionr)rpr�rMrT�content_dispositionr�rxrjryrrz)rr{r#r+r}r�rjr|r~rrs           r�content_disp_as_valuez,TestContentDisposition.content_disp_as_valueTs���
��I����c�4��7�r����c�4��7�r����c�d�1�g�U�&:�4��7���17�-�R���a�C��a��V�f�_�t�%;�����2�F�;������.�.�0C�D�������8�,�����	�	�7�3�����G�$�������v�~�~��6��?r)�inliner%zWattachment; filename=genome.jpeg;  modification-date="Wed, 12 Feb 1997 16:29:51 -0500";�
attachmentzgenome.jpegzWed, 12 Feb 1997 16:29:51 -0500)�filenamezmodification-datezWattachment; filename="genome.jpeg"; modification-date="Wed, 12 Feb 1997 16:29:51 -0500"znContent-Disposition: attachment; filename="genome.jpeg";
 modification-date="Wed, 12 Feb 1997 16:29:51 -0500"
rnNzContent-Disposition:
zab./kzab.zab./k; filename="foo"r'r_zaattachment; filename="=?UTF-8?Q?Schulbesuchsbest=C3=A4ttigung=2E?=               =?UTF-8?Q?pdf?="uSchulbesuchsbestättigung.pdfr�u4attachment; filename="Schulbesuchsbestättigung.pdf"zUContent-Disposition: attachment;
 filename*=utf-8''Schulbesuchsbest%C3%A4ttigung.pdf
z<attachment; filename="File =?utf-8?q?Name?= With Spaces.pdf"zFile Name With Spaces.pdfz0attachment; filename="File Name With Spaces.pdf"zFContent-Disposition: attachment; filename="File Name With Spaces.pdf"
)r�
RFC_2183_2r�
invalid_value�invalid_value_with_params�+invalid_parameter_value_with_fws_between_ew�'parameter_value_with_fws_between_tokens)r.r/r0r$rr�r�content_disp_paramsr*rrr!r!Qs���@�*�
F��&�"C�
E��G�F��
���
�
.�
.�/��$�
&�
���
�
'�
'�(�	*�
$��
���
�
'�
'�(�	&*�
.��
�8�9�
�
'�
'�(��*�
C�G�	8�
K��
�4�5�
�
'�
'�(�>�
V�
4�i<�rr!c��eZdZd�Zdddddgfdddddgfdddddgfdddddgfdddddgfd	d	d	d
dgfdddddgfdddddgfd
d
dddej
gfdddddej
gfdddddej
gfdddddej
gfdddddej
gfdddddej
gfdddddejgfd�Zy)�TestMIMEVersionHeaderc��|jd|�}|j||�|j|j|�|j|j|�|j|j|�|j|j|�|rd|z}|j|jtj��d|zdz�y)NzMIME-Versionrvrz
MIME-Version:rw)
rMrT�version�major�minorrxrjryrrz)rr{r|r1r2r3rjrs        r�version_string_as_MIME_Versionz4TestMIMEVersionHeader.version_string_as_MIME_Version�s���
���^�V�4������G�$�������G�,�������%�(�������%�(�����	�	�7�3���6�\�F�������v�~�~��6�(�6�1�D�8�	:rz1.0rorz1.0 (produced by MetaSend Vx.x)z(produced by MetaSend Vx.x) 1.0z1.(produced by MetaSend Vx.x)0z1.1z2.1r�z1 .0z  1.0  z	1.0 <abc>z	<abc> 1.0Nz1.<abc>0z1..0z2.xr_rn)r�r�r��
RFC_2045_4�1_1�2_1�
whitespace�#leading_trailing_whitespace_ignored�non_comment_garbage_after�non_comment_garbage_before�non_comment_garbage_inside�two_periods�2_xr_�missing)r.r/r0r4rrr��version_string_paramsr*rrr/r/�s���:�.
���
�
��
�
.�-��
�
��
�
.�-��
�
��
�
-�,��
�
��
�
���
�
��
�
���
�
��
�
���
�
��
�
���
�
��
0�
���
�
�
�
'�
'�(�
&*�
�����
�
'�
'�(�
'*�
�����
�
'�
'�(�
'*�
�����
�
'�
'�(�
*�
�����
�
'�
'�(�
*�
�����
�
'�
'�(�
*�
�����
�
.�
.�/�
1�}F
�rr/c
���eZdZiddejgddddddf�ddgddddddf�d	d
gd
dddddf�dd
gd
dddddf�ddgddddddf�ddgddddddf�ddej
gddddd df�d!d"ejgd#zd$dd$d%d df�d&d'gd'dd'd(d df�d)d*ejgd+zd,dd,d-d df�d.d/ejgd0zd1dd1d2d df�d3d4ej
gd5dd5d6d df�d7d8gd9d:d;d<d df�d=d>gd?d@d;d<d df�dAdBejejgd9d:d;d<d df�dCdDej
gdEdFddd df�dGdHejej
gdIdJddd df�ZdK�ZdL�ZdM�Z	dN�Z
dO�ZdP�ZdQ�Z
dR�ZdS�ZdT�ZdU�ZdV�ZdW�Zy)X�TestAddressHeader�empty�<>rnN�address_onlyzzippy@pinhead.com�zippyzpinhead.com�name_and_addressz%Zaphrod Beblebrux <zippy@pinhead.com>zZaphrod Beblebrux�quoted_local_partz)Zaphrod Beblebrux <"foo bar"@pinhead.com>z"foo bar"@pinhead.com�foo bar�quoted_parens_in_namez'"A \(Special\) Person" <person@dom.ain>z%"A (Special) Person" <person@dom.ain>zA (Special) Personzperson@dom.ain�personzdom.ain�quoted_backslashes_in_namez."Arthur \\Backslash\\ Foobar" <person@dom.ain>zArthur \Backslash\ Foobar�
name_with_dotzJohn X. Doe <jxd@example.com>z"John X. Doe" <jxd@example.com>zJohn X. Doezjxd@example.com�jxd�example.com�quoted_strings_in_local_partz""example" example"@example.comr�z"example example"@example.comzexample example�$escaped_quoted_strings_in_local_partz!"\"example\" example"@example.comz"example" example�escaped_escapes_in_local_partz#"\\"example\\" example"@example.comrXz#"\\example\\\\ example"@example.comz\example\\ example�'spaces_in_unquoted_local_part_collapsedzmerwok  wok  @example.comr�z"merwok wok"@example.comz
merwok wok�(spaces_around_dots_in_local_part_removedzmerwok. wok .  wok@example.comzmerwok.wok.wok@example.comzmerwok.wok.wok�rfc2047_atom_is_decodedz'=?utf-8?q?=C3=89ric?= <foo@example.com>uÉric <foo@example.com>r��foo@example.comr_�!rfc2047_atom_in_phrase_is_decodedz6The =?utf-8?q?=C3=89ric=2C?= Himself <foo@example.com>u&"The Éric, Himself" <foo@example.com>r��(rfc2047_atom_in_quoted_string_is_decodedz)"=?utf-8?q?=C3=89ric?=" <foo@example.com>�"name_ending_with_dot_without_spacezJohn X.<jxd@example.com>z"John X." <jxd@example.com>zJohn X.�name_starting_with_dotz. Doe <jxd@example.com>z". Doe" <jxd@example.com>z. Doec	��|jd|�}	|j|	|�|j|	j|�|	j}
|jt|
�|�|jt
|	j�d�|j|
gt|	jdj��|j|
gt|	j��|j|
j|�|j|
j|�|j|
j|�|j|
j|�y)N�senderror)rMrTrxrj�addressrSrp�groups�list�	addresses�display_name�	addr_spec�username�domain)rr{rjr|rarbrcrd�commentr�as           r�example_as_addressz$TestAddressHeader.example_as_address�s������X�v�.������G�$�����	�	�7�3�
�I�I������Q���)�����Q�X�X���*����!��d�1�8�8�A�;�#8�#8�9�:����!��d�1�;�;�/�0��������6�������i�0�������X�.�������6�*rc	��dj|�}|rdj|�nd}	|jd|�}
|j|
|	�|j|
j|�|j|
j
dj|
j�|jt|
j
�d�|jt|
j�d�|
jd}|jt|�|�|j|j|�|j|j|�|j|j|�|j|j|�y)Nzfoo: {};�foo:;�torro)
�formatrMrTrxrjr^r`rprSrarbrcrd)rr{rjr|rarbrcrdre�gdecodedrrfs            r�example_as_groupz"TestAddressHeader.example_as_group	s ���"�"�6�*��18�:�$�$�W�-�g�����T�6�*������H�%�����	�	�7�3�������!��.�.����<�����Q�X�X���*�����Q�[�[�)�1�-�
�K�K��N������Q���)��������6�������i�0�������X�.�������6�*rc��d}|jd|�}|j||�|jt|j�d�|jt|j�d�td�D];}|j|j|jd|j|��=|jt
|jd�d�|jt
|jd�d�|jt
|jd�d	�|j|jdjd
�y)NzTFred <dinsdale@python.org>, foo@example.com, "Harry W. Hastings" <hasty@example.com>rjr�rzFred <dinsdale@python.org>rorVr�z'"Harry W. Hastings" <hasty@example.com>zHarry W. Hastings)rMrTrpr^r`�rangerSra)rrLr�is    r�test_simple_address_listz*TestAddressHeader.test_simple_address_lists��>�����T�5�)������E�"�����Q�X�X���*�����Q�[�[�)�1�-��q��A����Q�X�X�a�[�2�2�1�5�q�{�{�1�~�F������Q�[�[��^�,�.J�K�����Q�[�[��^�,�.?�@�����Q�[�[��^�,�5�	7�������Q��4�4��	!rc���t|jj��}ddj|ddD�cgc]}|d��	c}�zdzdzdj|ddD�cgc]}|d��	c}�zdzdj|ddD�cgc]}|d��	c}�z}ddj|ddD�cgc]}|d	��	c}�zdzdzdj|ddD�cgc]}|d	��	c}�zd
zdj|ddD�cgc]}|d	��	c}�z}|j	d|�}|j|j
d�|j
d��|j||�|jt|j�d
t|�zdz
�|j|jdjd�|j|jdjd�|j|jdjd�|jt|j�t|��td�D]k}|j|j|d	zj�|jt|j|d	zjd�||d	��mtd
d
t|�zdz
�D]h}|j|j|j�|jt|j|jd�||dz
d	��jtt|��D]_}|jt|j|�||d	�|j|j|j||d��aycc}wcc}wcc}wcc}wcc}wcc}w)Nz dummy list:;, another: (empty);,z, �rz"A \"list\"": �z;,zdummy list:;, another:;, r�z;, rj�,rYz
dummy listro�anotherzA "list")r_�example_params�values�joinrMrT�splitrpr^rar`ror�rSrb)r�examples�xr{�expectedrrps       r�test_complex_address_listz+TestAddressHeader.test_complex_address_list*s�����+�+�2�2�4�5��4����(�2�A�,�7�,�Q�A�a�D�,�7�8�9�;?�@�"�#��I�I�X�a��]�;�]��q��t�]�;�<�=�@D�D����(�1�2�,�7�,�Q�A�a�D�,�7�8�	9��0����(�2�A�,�7�,�Q�A�a�D�,�7�8�9�;?�@�"�#��I�I�X�a��]�;�]��q��t�]�;�<�=�@E�E����(�1�2�,�7�,�Q�A�a�D�,�7�8�	9��
���T�6�*����������x�~�~�c�':�;�����H�%�����Q�X�X���C��M�(9�A�(=�>�������!��1�1�<�@�������!��1�1�9�=�������!��1�1�:�>�����Q�[�[�)�3�x�=�9��q��A����a�h�h�q��s�m�8�8�9����S����!�A�#��!8�!8��!;�<�h�q�k�!�n�M���q�!�c�(�m�+�a�/�0�A����a�h�h�q�k�6�6�7����S����!��!6�!6�q�!9�:�H�Q�q�S�M�!�<L�M�1��s�8�}�%�A����S����Q��0�(�1�+�a�.�A����Q�[�[��^�5�5�x��{�1�~�F�&��98��;��7��
8��;��7s#�O
�#O

�O
�4O
� O
�	O
c��|jdd�}|jt�5d|_ddd�y#1swYyxYw�Nr\zabc@xyz.comr_)rMr`rar]rUs  r�test_address_read_onlyz(TestAddressHeader.test_address_read_onlyMs5�����X�}�5��
�
�
�~�
.��A�I�/�
.�
.��	�9�Ac��|jdd�}|jt�5d|_ddd�y#1swYyxYwr�)rMr`rar`rUs  r�test_addresses_read_onlyz*TestAddressHeader.test_addresses_read_onlyRs5�����X�}�5��
�
�
�~�
.��A�K�/�
.�
.�r�c��|jdd�}|jt�5d|_ddd�y#1swYyxYwr�)rMr`rar^rUs  r�test_groups_read_onlyz'TestAddressHeader.test_groups_read_onlyWs5�����X�}�5��
�
�
�~�
.��A�H�/�
.�
.�r�c��d}|jd|�}|j|jt�|j|jdt�y�Nzme <who@example.com>rjr)rMrr`rqr
�rr{rs   r�test_addresses_typesz&TestAddressHeader.test_addresses_types\sE��'�����T�6�*�����a�k�k�5�1����a�k�k�!�n�g�6rc��d}|jd|�}|j|jt�|j|jdt�yr�)rMrr^rqrr�s   r�test_groups_typesz#TestAddressHeader.test_groups_typesbsE��'�����T�6�*�����a�h�h��.����a�h�h�q�k�5�1rc�b�|jdtddd��}|j|d�y)Nrj�mer_rOzme <foo@example.com>�rMr
rTrUs  r�test_set_from_Addressz'TestAddressHeader.test_set_from_Addresshs.�����T�7�4��
�#F�G������2�3rc	�|�|jdtddd�tddd�g�}|j|d�y)Nrjr�r_rO�your�z+me <foo@example.com>, you <bar@example.com>r�rUs  r�test_set_from_Address_listz,TestAddressHeader.test_set_from_Address_listlsC�����T�G�D�%��$G�$+�E�5�-�$H�$J�
K������I�Jrc
�B�|jdtddd�tdtddd�td	d
d�g�tdd
d�g�}|j|d�|j|j	t
jjd����d�y)Nrjr�r_rO�bing�fiz�z�b.com�zif�f�c.comr�r�zPme <foo@example.com>, bing: fiz <z@b.com>, zif <f@c.com>;, you <bar@example.com>�(��max_line_lengthrzWto: me <foo@example.com>,
 bing: fiz <z@b.com>, zif <f@c.com>;,
 you <bar@example.com>
)rMr
rrTryrrz�clonerUs  r�$test_set_from_Address_and_Group_listz6TestAddressHeader.test_set_from_Address_and_Group_listqs������T�G�D�%��$G�$)�&�7�5�#�w�3O�3:�5�#�w�3O�3Q�%R�$+�E�5�-�$H�$J�
K��	
����D�	E�������v�~�~�';�';�B�';�'O��P�3�	4rc��|jdtdtddd�tddd�g�g�}|j|d	�y)
Nrjr�r�r�r�r�r�r�z#bing: fiz <z@b.com>, zif <f@c.com>;)rMrr
rTrUs  r�test_set_from_Group_listz*TestAddressHeader.test_set_from_Group_list}sS�����T�E�&�7�5�#�w�3O�3:�5�#�w�3O�3Q�%R�$S�
T������A�Br)r.r/r0rr�ObsoleteHeaderDefectrwrgrmrqr~r�r�r�r�r�r�r�r�r�r*rrrBrBBs���m
��
��(�(�
)�
�
�
�
�
�
�
�m
�	�
 �
�
 �
�
 �
�
�
�
�m
�,	�
4�
�
4�
 �
 �
�
�
�
�/m
�@	�
8�
�
8�
 �
$�
�
�
�
�Cm
�T	 �
7�
�
4�
!�
�
�
�
�
�Wm
�h	%�
>�
�
>�
)�
�
�
�
�
�km
�|	�
,��)�)�
*�
.�
�
�
�
�
�
�m
�P	'�
.��(�(�
)�!�
+�
,�
�
,�
�
�
�
�Sm
�d	/�
1�
�
1�
�
1�
!�
��
�gm
�x	(�
3��(�(�
)�!�
+�
3�
�
3�
"�
��
�{m
�L	2�
(��(�(�
)�!�
+�
'�
�
'�
�
�
�
�Om
�`	3�
-��)�)�
*�
)�
�
)�
�
�
�
�cm
�t	"�
6��%������
�wm
�H	,�
E��4� �����
�Km
�\	3�
8�
�
'�
'��&�&�
(�%������
�_m
�r	-�
'��)�)�
*�
*�
�
�
�
�
�
�um
�F	!�
&��(�(�&�*E�*E�
F�
(�
�
�
�
�
�
�Im
�N�f
+�"+�"!� !G�F�
 �
�
7�2�4�K�

4�CrrBc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$y#)$�TestAddressAndGroupc�r�|jt�5t||d�ddd�y#1swYyxYw)Nr_)r`rarb)r�objrcs   rrdz!TestAddressAndGroup._test_attr_ro�s(��
�
�
�~�
.��C��u�%�/�
.�
.���-�6c�>�|jtddd�d�y)Nr_r�r�ra�rdr
rgs r�test_address_display_name_roz0TestAddressAndGroup.test_address_display_name_ro�s�����7�5�%��7��Hrc�>�|jtddd�d�y)Nr_r�r�rcr�rgs r�test_address_username_roz,TestAddressAndGroup.test_address_username_ro�s�����7�5�%��7��Drc�>�|jtddd�d�y)Nr_r�r�rdr�rgs r�test_address_domain_roz*TestAddressAndGroup.test_address_domain_ro�s�����7�5�%��7��Brc�:�|jtd�d�y)Nr_ra�rdrrgs r�test_group_display_name_roz.TestAddressAndGroup.test_group_display_name_ro�s�����5��<��8rc�:�|jtd�d�y)Nr_r`r�rgs r�test_group_addresses_roz+TestAddressAndGroup.test_group_addresses_ro�s�����5��<��5rc�4�tddd�}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr_r�r��bar@baz�
foo <bar@baz>�r
rTrarcrdrbrS�rrfs  r�!test_address_from_username_domainz5TestAddressAndGroup.test_address_from_username_domain�st���E�5�%�(���������/�������U�+�������5�)�������i�0�����Q���1rc�4�tdd��}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr_r��rbr�r�r�r�r�s  r�test_address_from_addr_specz/TestAddressAndGroup.test_address_from_addr_spec�sr���E�Y�/���������/�������U�+�������5�)�������i�0�����Q���1rc�2�td��}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr�r�rnr�r�r�r�s  r�!test_address_with_no_display_namez5TestAddressAndGroup.test_address_with_no_display_name�sp���i�(���������,�������U�+�������5�)�������i�0�����Q���+rc�.�t�}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)NrnrDr�r�s  r�test_null_addressz%TestAddressAndGroup.test_null_address�sm���I���������,�������R�(�������2�&�������d�+�����Q���&rc�2�td��}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)N�buzz�rdrnz@buzzr�r�s  r�test_domain_onlyz$TestAddressAndGroup.test_domain_only�sp���6�"���������,�������R�(�������6�*�������g�.�����Q���)rc�2�td��}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr��rcrnr�r�s  r�test_username_onlyz&TestAddressAndGroup.test_username_only�sp���V�$���������,�������V�,�������2�&�������f�-�����Q���(rc�0�td�}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr�rnrDzbuzz <>r�r�s  r�test_display_name_onlyz*TestAddressAndGroup.test_display_name_only�so���F�O���������0�������R�(�������2�&�������d�+�����Q���+rc�4�tddd�}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)NzSara J.zbad namerOz"bad name"@example.comz""Sara J." <"bad name"@example.com>r�r�s  r�test_quotingz TestAddressAndGroup.test_quoting�sx��
�I�z�=�9���������3�������Z�0�������=�1�������&>�?�����Q��!E�Frc�4�tddd�}|j|jd�|j|jd�|j|jd�|j|j
d�|jt
|�d�y)Nr��wokuexàmple.comuwok@exàmple.comuÉric <wok@exàmple.com>r�r�s  r�	test_il8nzTestAddressAndGroup.test_il8n�sv���G�U�N�3���������1�������U�+�������>�2�������&8�9�����Q��!;�<rc���td��td��td��td��td��td��td	�
�td�
�td�
�td
��td��td��f}|D]G}|j|��5|jtd�5t	di|��ddd�ddd��Iy#1swY�xYw#1swY�`xYw)Nzfoo
)razfoo
zfoo
zexample.com
r�zexample.com
z
example.com
zwok
r�zwok
zwok
zwok@example.com
r�zwok@example.com
zwok@example.com
)�kwargszinvalid argumentsr*)�dict�subTest�assertRaisesRegex�
ValueErrorr
)r�casesr�s   r�$test_crlf_in_constructor_args_raisesz8TestAddressAndGroup.test_crlf_in_constructor_args_raises�s����g�&��g�&��i�(���(���(��)�*��'�"��'�"��)�$��.�/��.�/��0�1�

���F����V��,�d�.D�.D�Z�Qd�.e��!�&�!�/f�,�,��.e�.e��,�,�s$�C �5C�C �C�C � C)	c�r�|jt�5tdd��ddd�y#1swYyxYw)Nr_uwők@example.comr��r`r�r
rgs r�+test_non_ascii_username_in_addr_spec_raisesz?TestAddressAndGroup.test_non_ascii_username_in_addr_spec_raises�s'��
�
�
�z�
*��E�%7�8�+�
*�
*�r�c�t�|jt�5tddd��ddd�y#1swYyxYw)Nr_r�r�)rcrb�r`r�r
rgs r�*test_address_addr_spec_and_username_raisesz>TestAddressAndGroup.test_address_addr_spec_and_username_raisess(��
�
�
�y�
)��E�F�i�@�*�
)�
)���.�7c�t�|jt�5tddd��ddd�y#1swYyxYw)Nr_r�r�)rdrbr�rgs r�(test_address_addr_spec_and_domain_raisesz<TestAddressAndGroup.test_address_addr_spec_and_domain_raisess(��
�
�
�y�
)��E�&�I�>�*�
)�
)�r�c�v�|jt�5tdddd��ddd�y#1swYyxYw)Nr_�bongr�r�)rcrdrbr�rgs r�5test_address_addr_spec_and_username_and_domain_raiseszITestAddressAndGroup.test_address_addr_spec_and_username_and_domain_raisess*��
�
�
�y�
)��E�F�6�Y�O�*�
)�
)�s�/�8c�r�|jt�5tdd��ddd�y#1swYyxYw)Nr_zbad name@example.comr�r�rgs r�'test_space_in_addr_spec_username_raisesz;TestAddressAndGroup.test_space_in_addr_spec_username_raisess'��
�
�
�z�
*��E�%;�<�+�
*�
*�r�c�r�|jt�5tdd��ddd�y#1swYyxYw)Nr_zname@ex[]ample.comr�r�rgs r�test_bad_addr_sepc_raisesz-TestAddressAndGroup.test_bad_addr_sepc_raisess'��
�
�
�z�
*��E�%9�:�+�
*�
*�r�c���td�}|j|jd�|j|jt	��|jt|�d�y)Nr_ri�rrTrar`rqrS�r�gs  r�test_empty_groupz$TestAddressAndGroup.test_empty_groupsI���%�L���������/�������e�g�.�����Q���)rc���tdg��}|j|jd�|j|jt	��|jt|�d�y)Nr_�r`rir�r�s  r�test_empty_group_listz)TestAddressAndGroup.test_empty_group_listsL���%�2�&���������/�������e�g�.�����Q���)rc���t�}|j|j�|j|jt��|jt
|�d�y)NzNone:;)rr�rarTr`rqrSr�s  r�test_null_groupz#TestAddressAndGroup.test_null_group sE���G�����!�.�.�)�������e�g�.�����Q���*rc��tddd�tddd�g}td|�}|j|jd�|j|jt|��|jt
|�d�y)N�b�crfr_zfoo: b <b@c>, a <b@c>;)r
rrTrar`rqrS�r�addrsr�s   r�test_group_with_addressesz-TestAddressAndGroup.test_group_with_addresses&sk����c�3�'���c�#�)>�?���%�����������/�������e�E�l�3�����Q��!9�:rc��tddd�tddd�g}t|��}|j|j�|j	|j
t
|��|j	t|�d�y)Nr�r�rfr�zNone: b <b@c>, a <b@c>;�r
rr�rarTr`rqrSr�s   r�)test_group_with_addresses_no_display_namez=TestAddressAndGroup.test_group_with_addresses_no_display_name-sg����c�3�'���c�#�)>�?���E�"�����!�.�.�)�������e�E�l�3�����Q��!:�;rc���tddd�g}t|��}|j|j�|j	|j
t
|��|j	t|�d�y)Nr�r�r�zb <b@c>r�r�s   r�+test_group_with_one_address_no_display_namez?TestAddressAndGroup.test_group_with_one_address_no_display_name4s[����c�3�'�(���E�"�����!�.�.�)�������e�E�l�3�����Q���+rc���td�}|j|jd�|j|jt	��|jt|�d�y)Nzfoo.barz"foo.bar":;r�r�s  r�test_display_name_quotingz-TestAddressAndGroup.test_display_name_quoting;sJ���)����������3�������e�g�.�����Q���/rc���td�}|j|jd�|j|jt	��|jt|�d�y)NrI�	foo bar:;r�r�s  r�#test_display_name_blanks_not_quotedz7TestAddressAndGroup.test_display_name_blanks_not_quotedAsJ���)����������3�������e�g�.�����Q���-rc���tddd�}ttj��}||d<|j	|dd�|j	|dj
|f�y)Nr_r�rOr�Torjzfoo <bar@example.com>)r
rrrzrTr`)rrfr�s   r�$test_set_message_header_from_addressz8TestAddressAndGroup.test_set_message_header_from_addressGsX���E�5�-�0���6�>�>�*����$������4��"9�:�����4��*�*�Q�D�1rc���td�}ttj��}||d<|j	|dd�|j	|dj
|j
�y)NrIrrrjr)rrrrzrTr`)rr�r�s   r�"test_set_message_header_from_groupz6TestAddressAndGroup.test_set_message_header_from_groupNsU���)����6�>�>�*����$������4��+�.�����4��*�*�A�K�K�8rc�n�tddd�}|jtddd�|�|jtddd�|�|jtddd�|�|jtddd�|�|j|t	�k(�|j|tk(�y)Nr_r�rOr�)r
rT�assertNotEqual�assertFalse�object�
assertTruer
r�s  r�test_address_comparisonz+TestAddressAndGroup.test_address_comparisonUs����E�5�-�0��������}�=�q�A����G�E�5�-�@�!�D����G�E�5�-�@�!�D����G�E�5�%�8�!�<�����f�h��'�����Y��'rc�L�tddd�}td|g�}|jtd|f�|�|jtd|g�|�|jtdg�|�|j	|t�k(�|j
|tk(�y)Nr_r�rOrIr�)r
rrTrr	r
rr
)rrfr�s   r�test_group_comparisonz)TestAddressAndGroup.test_group_comparison^s����E�5�-�0���)�a�S�!������y�1�$�/��3����E�%�!��-�q�1����E�)�R�0�!�4�����f�h��'�����Y��'rN)%r.r/r0rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr*rrr�r��s���&�I�E�C�9�6�2�2�,�'�*�)�,�G�=�"�&9�A�?�P�=�;�*�*�+�;�<�,�0�.�2�9�(�(rr�c�`�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zy)�TestFoldingc��dD]U\}}|jdt|d���}|j|jtj
��d|z��Wy)z1Test the folding and encoding of address headers.)	)zFoo Bar, Francez"Foo Bar, France")zFoo Bar (France)z"Foo Bar (France)")uFoo Bar, Españaz"Foo =?utf-8?q?Bar=2C_Espa=C3=B1a?=)uFoo Bar (España)z Foo Bar =?utf-8?b?KEVzcGHDsWEp?=)uFoo, Bar Españaz"=?utf-8?q?Foo=2C_Bar_Espa=C3=B1a?=)uFoo, Bar [España]z(=?utf-8?q?Foo=2C_Bar_=5BEspa=C3=B1a=5D?=)uFoo Bär, Francez"Foo =?utf-8?q?B=C3=A4r=2C?= France)uFoo Bär <France>z%Foo =?utf-8?q?B=C3=A4r_=3CFrance=3E?=)urLôrem ipsum dôlôr sit amet, cônsectetuer adipiscing. Suspendisse pôtenti. Aliquam nibh. Suspendisse pôtenti.z�=?utf-8?q?L=C3=B4rem_ipsum_d=C3=B4l=C3=B4r_sit_amet=2C_c=C3=B4nsectetuer?=
 =?utf-8?q?_adipiscing=2E_Suspendisse_p=C3=B4tenti=2E_Aliquam_nibh=2E?=
 Suspendisse =?utf-8?q?p=C3=B4tenti=2E?=rza@b.comr�rzTo: %s <a@b.com>
N)rMr
rTryrrz)rrK�resultrs    r�test_address_display_namesz&TestFolding.test_address_display_namesjsU���L�D�&�$� � ��w�t�y�'I�J�A����Q�V�V�6�>�>�V�:�$8�6�$A�
C�'rc��|jdd�}|j|jtj��d�y)Nr>rRrzsubject: this is a test
�rMrTryrrzrUs  r�test_short_unstructuredz#TestFolding.test_short_unstructured�s7�����Y�(8�9��������v�~�~��6�4�	6rc��|jdd�}|j|jtj��d�y)Nr!zhThis is a long header line that will need to be folded into two lines and will demonstrate basic foldingrzsSubject: This is a long header line that will need to be folded into two lines
 and will demonstrate basic folding
rrUs  r�test_long_unstructuredz"TestFolding.test_long_unstructured�sA�����Y�)1�
2��	
������v�~�~��6�@�	Arc���|jdd�}|j|jtjjd����t
jd��y)Nr!z1this is a short header that will be folded anywayr�r�rz�                Subject: this is a
                 short header that
                 will be folded
                 anyway
                �rMrTryrrzr��textwrap�dedentrUs  r�'test_unstructured_short_max_line_lengthz3TestFolding.test_unstructured_short_max_line_length�sX�����Y�))�
*�����
�F�F�&�.�.�.�.�r�.�B�F�C��O�O��
�	rc��|jdd�}|j|jtj��d�y)Nr!rrzSubject: test
rrUs  r�"test_fold_unstructured_single_wordz.TestFolding.test_fold_unstructured_single_word�s4�����Y��/��������v�~�~��6�8I�Jrc��|jdd�}|j|jtj��d�y)Nr!ztest test testrzSubject: test test test
rrUs  r�test_fold_unstructured_shortz(TestFolding.test_fold_unstructured_short�s7�����Y�(8�9��������v�~�~��6�3�	5rc��|jdd�}|j|jtjjd����d�y)Nr!�5thisisaverylonglineconsistingofasinglewordthatwontfitr�r�rz�Subject: 
 =?utf-8?q?thisisa?=
 =?utf-8?q?verylon?=
 =?utf-8?q?glineco?=
 =?utf-8?q?nsistin?=
 =?utf-8?q?gofasin?=
 =?utf-8?q?gleword?=
 =?utf-8?q?thatwon?=
 =?utf-8?q?tfit?=
�rMrTryrrzr�rUs  r�)test_fold_unstructured_with_overlong_wordz5TestFolding.test_fold_unstructured_with_overlong_word�sL�����Y�)$�
%�����
�F�F�&�.�.�.�.�r�.�B�F�C�
"�	rc��|jdd�}|j|jtjjd����d�y)Nr!zXthisisaverylonglineconsistingofasinglewordthatwontfit plusanotherverylongwordthatwontfitr�r�raSubject: 
 =?utf-8?q?thisisa?=
 =?utf-8?q?verylon?=
 =?utf-8?q?glineco?=
 =?utf-8?q?nsistin?=
 =?utf-8?q?gofasin?=
 =?utf-8?q?gleword?=
 =?utf-8?q?thatwon?=
 =?utf-8?q?tfit_pl?=
 =?utf-8?q?usanoth?=
 =?utf-8?q?erveryl?=
 =?utf-8?q?ongword?=
 =?utf-8?q?thatwon?=
 =?utf-8?q?tfit?=
r$rUs  r�.test_fold_unstructured_with_two_overlong_wordsz:TestFolding.test_fold_unstructured_with_two_overlong_words�sN�����Y�)G�
H�����
�F�F�&�.�.�.�.�r�.�B�F�C�

"�	rc��|jdd�}|j|jtjjd����d�y)Nr!� thislongwordislessthanmaxlinelen�#r�rz+Subject:
 thislongwordislessthanmaxlinelen
r$rUs  r�.test_fold_unstructured_with_slightly_long_wordz:TestFolding.test_fold_unstructured_with_slightly_long_word�sF�����Y�(J�K�����
�F�F�&�.�.�.�.�r�.�B�F�C�;�	=rc���|jdd�}|j|jtjjd����t
jd��y)Nr!z�This header is intended to demonstrate, in a fairly succinct way, that we now do not give a , special treatment in unstructured headers.�<r�rz�                Subject: This header is intended to demonstrate, in a fairly
                 succinct way, that we now do not give a , special treatment
                 in unstructured headers.
                 rrUs  r�"test_fold_unstructured_with_commasz.TestFolding.test_fold_unstructured_with_commas�s\�����Y�)F�
G��	
���
�F�F�&�.�.�.�.�r�.�B�F�C��O�O��
�	rc��|jdd�}|j|jtj��tjd��y)Nrz�"Theodore H. Perfect" <yes@man.com>, "My address is very long because my name is long" <foo@bar.com>, "Only A. Friend" <no@yes.com>rz�            To: "Theodore H. Perfect" <yes@man.com>,
             "My address is very long because my name is long" <foo@bar.com>,
             "Only A. Friend" <no@yes.com>
             )rMrTryrrzrrrUs  r�test_fold_address_listz"TestFolding.test_fold_address_list�sK�����T�$,�
-��	
������v�~�~��6����I�9�	rc��|jdd�}|j|jtj��d�y)Nr�zSat, 2 Feb 2002 17:00:06 -0800rz&Date: Sat, 02 Feb 2002 17:00:06 -0800
rrUs  r�test_fold_date_headerz!TestFolding.test_fold_date_header�s8�����V�%E�F��������v�~�~��6�A�	Crc��|jdd�}|j|jtj��d�y)NzX-Report-Abusez]<https://www.mailitapp.com/report_abuse.php?mid=xxx-xxx-xxxxxxxxxxxxxxxxxxxxxxxx==-xxx-xx-xx>rz�X-Report-Abuse: =?utf-8?q?=3Chttps=3A//www=2Emailitapp=2Ecom/report=5Fabuse?=
 =?utf-8?q?=2Ephp=3Fmid=3Dxxx-xxx-xxxxxxxxxxxxxxxxxxxxxxxx=3D=3D-xxx-xx-xx?=
 =?utf-8?q?=3E?=
rrUs  r�&test_fold_overlong_words_using_RFC2047z2TestFolding.test_fold_overlong_words_using_RFC2047�sC������
B�
C��	
���
�F�F�&�.�.�F�)�
!�	"rc��|jdd�}|j|jtjjd����d�|jdd�}|j|jtjjd����d�|jdd	�}|j|jtjjd
����d�|jdd�}|j|jtjjd����d
�y)Nz
Message-IDz+<somemessageidlongerthan@maxlinelength.com>r�r�rz8Message-ID: <somemessageidlongerthan@maxlinelength.com>
z1<somemessageidlongerthan@[127.0.0.0.0.0.0.0.0.1]>z>Message-ID: <somemessageidlongerthan@[127.0.0.0.0.0.0.0.0.1]>
u<ईमेल@wők.com>�u$Message-ID: <ईमेल@wők.com>
u"<ईमेलfromMessage@wők.com>u0Message-ID:
 <ईमेलfromMessage@wők.com>
r$rUs  r�$test_message_id_header_is_not_foldedz0TestFolding.test_message_id_header_is_not_folded�s&������9�
;��	
���
�F�F�&�.�.�.�.�r�.�B�F�C�G�	I�

����?�
A��	
���
�F�F�&�.�.�.�.�r�.�B�F�C�M�	O�

���\�+D�E�����
�F�F�&�.�.�.�.�r�.�B�F�C�3�	5�
���\�+O�P�����
�F�F�&�.�.�.�.�r�.�B�F�C�@�	BrN)r.r/r0rrrrrr!r%r'r+r.r0r2r4r7r*rrrrhsM��C�06�
A�
�K�5�
� �.=���C�
"�Brr�__main__)#r�r�unittest�emailrr�
email.messager�test.test_emailrrr	�email.headerregistryr
r�email.headerr�test.supportr
r
r�rrIrOrtr�r�rr!r/rBr�rr.�mainr*rr�<module>rAsd�������!�7� �/�&�"�	���7K��7K�t)�]�)�"0�^�"0�\�%�^�%��%�P�>6�^�>6��>6�B�t�N�t��t�n�)�.�)��)�X�O�^�O��O�d�Z
�N�Z
��Z
�z�}C��}C��}C�@
b(�-�b(�JnB�.�nB�`�z���H�M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit