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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21585/root/usr/lib64/python2.4/email/test/test_email.pyo
m
=5Dc@sdkZdkZdkZdkZdkZdkZdkZdklZdk	Z	dk
lZdkl
Z
lZlZdklZlZdklZlZdklZdklZdklZd	klZd
klZdk l!Z!dk"l#Z#d
k	l$Z$dk	l%Z%dk	l&Z&dk	l'Z'dk	l(Z(dk	l)Z)dk*l+Z+l,Z,dk-l.Z/dZ0dZ1dZ2ei3dde4e5ddZ6dei7fdYZ8de8fdYZ9dei7fd YZ:d!e8fd"YZ;d#ei7fd$YZ<d%ei7fd&YZ=d'ei7fd(YZ>d)ei7fd*YZ?d+e8fd,YZ@d-e8fd.YZAd/ei7fd0YZBd1e8fd2YZCd3e8fd4YZDd5e8fd6YZEd7e8fd8YZFd9e8fd:YZGd;ei7fd<YZHd=ei7fd>YZId?ei7fd@YZJdAe8fdBYZKdCe8fdDYZLdEZMdFZNdGZOe5dHjoeiPdIdJndS(KN(sStringIO(sCharset(sHeaders
decode_headersmake_header(sParsersHeaderParser(s	GeneratorsDecodedGenerator(sMessage(s	MIMEAudio(sMIMEText(s	MIMEImage(sMIMEBase(sMIMEMessage(s
MIMEMultipart(sUtils(sErrors(sEncoders(s	Iterators(s
base64MIME(s
quopriMIME(sfindfilesrun_unittest(s__file__s
tt tignoretrcCs1tiitiitd|}t||S(Ntdata(tostpathtjointdirnametlandmarktfilenametopentmode(R
RR((t-/usr/lib64/python2.4/email/test/test_email.pytopenfile/s$t
TestEmailBasecBstZdZdZRS(NcCs||jont|}t|}ti|i|i}t	}|tIti|IJ|i|indS(s:Like failUnlessEqual except use ndiff for readable output.N(tfirsttsecondtstrtsfirsttssecondtdifflibtndifft
splitlinestdifftStringIOtfptNLRtselftfailureExceptiontgetvalue(RRRRRRR((R
tndiffAssertEqual7s
	cCs7tt|}zti|}Wd|iX|S(N(RtfindfileR
Rtemailtmessage_from_filetmsgtclose(RR
RR#((R
t_msgobjAs(t__name__t
__module__RR%(((R
R6s	
tTestMessageAPIcBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,Z-d-Z.d.Z/d/Z0d0Z1d1Z2d2Z3d3Z4d4Z5RS(5NcCsT|i}|id}||iddddg||iddddS(Ns
msg_20.txttccsccc@zzz.orgsddd@zzz.orgseee@zzz.orgtxxsn/a(RtassertEqualteqR%R#tget_all(RR#R,((R
ttest_get_allMs	cCsL|i}t}||idtd}|i	|||dd||i
d||dd||idd||dd	||iid|i	d||id||ddt}d
|d<d|d
<d|d<|i	|||dd
||dd||dddS(Ns
iso-8859-1smime-versions1.0s
text/plainscontent-types text/plain; charset="iso-8859-1"tcharsetscontent-transfer-encodingsquoted-printables2.0sMIME-Versionstext/x-weirdsContent-Typesquinted-puntablesContent-Transfer-Encodings"text/x-weird; charset="iso-8859-1"(
RR+R,tMessageR#tget_charsettNonetCharsetR/tset_charsettget_typet	get_paramt
input_charset(RR/R#R,((R
ttest_getset_charsetSs,		

	



cCsJ|i}t}|id||iid||dddS(Nsus-asciiscontent-typestext/plain; charset="us-ascii"(RR+R,R0R#R4R1R7(RR#R,((R
ttest_set_charset_from_stringms
		
cCsBt}td}|id||i|iiddS(Ns
iso-8859-1sThis is a string payload(	R0R#R3R/tset_payloadRR+R1R7(RR#R/((R
ttest_set_payload_with_charsetts	c
Cs|i}|id}|i}||dddddg|id}|id}||dddddg|id}|i}||dddddd	ddgdS(
Ns
msg_08.txtsus-asciis
iso-8859-1s
iso-8859-2skoi8-rs
msg_09.txttdingbats
msg_12.txts
iso-8859-3(RR+R,R%R#tget_charsetstcharsetsR2(RR#R,R>((R
ttest_get_charsetszs	cCs|i}|id}g}|iD]}||iq)~}||ddg|id}|id}||iddS(Ns
msg_04.txtsmsg.txts
msg_07.txtisdingusfish.gif(RR+R,R%R#t_[1]tget_payloadtptget_filenamet	filenamestsubpart(RRERDR@RBR#R,((R
ttest_get_filenames	-cCs\|i}|id}g}|iD]}||iq)~}||ddgdS(Ns
msg_44.txtsmsg.txt(
RR+R,R%R#R@RARBRCRD(RRDR@RBR#R,((R
t%test_get_filename_with_name_parameters	-cCs/|i}|id}||iddS(Ns
msg_07.txttBOUNDARY(RR+R,R%R#tget_boundary(RR#R,((R
ttest_get_boundarys	cCs|i}|id}|id|id\}}||i	d||d|id}|id|id\}}||i	d||d|id}|i
ti|iddS(	Ns
msg_01.txtRHiscontent-types3text/plain; charset="us-ascii"; boundary="BOUNDARY"s
msg_04.txts$multipart/mixed; boundary="BOUNDARY"s
msg_03.txt(
RR+R,R%R#tset_boundarytitemstheadertvaluetlowertassertRaisestErrorstHeaderParseError(RRNRMR#R,((R
ttest_set_boundarys	



cCs|i}|id}||idtd||ididtd||ididtd||ididtd||id	idtd
dS(Ns
msg_10.txttdecodeis This is a 7bit encoded message.
is-This is a Quoted Printable encoded message!
is!This is a Base64 encoded message.is/This has no Content-Transfer-Encoding: header.
(RR+R,R%R#RAtTrueR2(RR#R,((R
ttest_get_decoded_payloads	cCs}|i}t}|idx1d
D])}||d<||idtdq&W|id	||idtd	dS(Ns$begin 666 -
+:&5L;&\@=V]R;&0 
 
end
s
x-uuencodetuuencodetuuesx-uuescontent-transfer-encodingRTshello worldtfoo(s
x-uuencodeRWRXsx-uue(	RR+R,R0R#R:tcteRARU(RR,RZR#((R
ttest_get_decoded_uu_payloads		


cCstt}|idd|d<ti}z$tt_}|idt	Wd|t_X|i|iddS(Ns%begin 664 foo.txt
%<W1F=0000H 
 
end
s
x-uuencodesContent-Transfer-EncodingRTR(
R0R#R:tsyststderrt
old_stderrRtsfpRARURR+R(RR_R^R#((R
t$test_decode_bogus_uu_payload_quietlys	

	
cCs{|i}|id}td}z|i}Wd|i	Xt
}t|}|i|||i|dS(Ns
msg_07.txts
msg_17.txt(RR+R,R%R#RRtreadttextR$RtstDecodedGeneratortgtflattenR(RRReRbRcR#R,((R
ttest_decoded_generators		
cCst}d|d<d|d<|id|j|id|j|id|j|id|j|id|j|id|jdS(	NtMetFromtYouttotfromtFROMtTotTO(R0R#Rt
failUnless(RR#((R
ttest__contains__s	

cCs|i}|id}td}z|i}Wd|i	X|||i
t|}|i
d}|i|did||ti|ddS(Ns
msg_01.txts
isFrom i(RR+R,R%R#RRRaRbR$t	as_stringRtfullreprtsplittlinesRpt
startswithRR(RRRbRuR#RsR,((R
ttest_as_strings	cCs,tid}|i|idddS(NsContent-Type: blarg; baz; boo
tbazR(R!tmessage_from_stringR#RR+R6(RR#((R
ttest_bad_param
scCs)tid}|i|iddS(Ns
From: foo
(R!RyR#RR+RCR2(RR#((R
ttest_missing_filenamescCs)tid}|i|iddS(Ns%Content-Disposition: blarg; filename
R(R!RyR#RR+RC(RR#((R
ttest_bogus_filenamescCs)tid}|i|iddS(Ns
From: foo
(R!RyR#RR+RIR2(RR#((R
ttest_missing_boundaryscCs|i}tid}||iddd
ddgtid
}||idddddg||idtid}||idddddgdS(Ns&X-Header: foo=one; bar=two; baz=three
RMsx-headerRYtonetbarttwoRxtthrees X-Header: foo; bar=one; baz=two
Rs"X-Header: foo; bar="one"; baz=two
(sfooR~(RR(sbazR(sfooR(RR~(sbazR(sfooR(RR~(sbazR(RR+R,R!RyR#t
get_paramsR2(RR#R,((R
ttest_get_paramss	cCs0t}d|d<|i|idddS(Ns>Content-Type: Multipart/mixed; boundary = "CPIMSSMTPC06p5f3tG"sContent-TypetboundarytCPIMSSMTPC06p5f3tG(R0R#RR+R6(RR#((R
ttest_get_param_liberal+s	
cCs|i}tid}||idddd||idddd||iddtid}||idddd	||idddd
||idddddS(Ns&X-Header: foo=one; bar=two; baz=three
RRMsx-headerRtquuzs"X-Header: foo; bar="one"; baz=two
RYRR~Rx(RR+R,R!RyR#R6R2(RR#R,((R
ttest_get_param0s	cCs5|id}|i|ididddS(Ns
msg_22.txtitnames
wibble.JPG(RR%R#R+RAR6(RR#((R
t'test_get_param_funky_continuation_linesAscCsKtid}|i|idd|i|iddtddS(Ns4Content-Type: image/pjpeg; name="Jim&amp;&amp;Jill"
RsJim&amp;&amp;Jilltunquotes"Jim&amp;&amp;Jill"(R!RyR#RR+R6tFalse(RR#((R
t#test_get_param_with_semis_in_quotesEscCsktid}|i|id|i|id|i|id|i|iddS(NsHeader: existsRMtHeadertHEADERtheaderi(R!RyR#RRpthas_keytfailIf(RR#((R
ttest_has_keyLs
cCs|i}t}|idd||idd|idd||idd||iddtd||id
ddg||idtdddg|idd
dd||idddd
dS(NR/siso-2022-jpt
importances
high valueRs"high value"s
text/plainRs
"iso-2022-jp"siso-9999-xxRMsX-Jimmy(s
text/plainR(scharsetsiso-2022-jp(Rs
high value(s
text/plainR(scharsets
"iso-2022-jp"(Rs"high value"(	RR+R,R0R#t	set_paramR6RR(RR#R,((R
ttest_set_paramSs		"cCs|i}|id}||idd	d
g|id}|id||iddg|i	d|||id
dd|fgdS(Ns
msg_05.txtsmultipart/reportRsreport-typesdelivery-statusRs%D1690A7AC1.996856090/mail.example.com(smultipart/reportR(sreport-typesdelivery-status(sboundarys%D1690A7AC1.996856090/mail.example.com(smultipart/reportR(sboundarys%D1690A7AC1.996856090/mail.example.com(smultipart/reportR(sboundarys%D1690A7AC1.996856090/mail.example.com(
RR+R,R%R#RR6told_valt	del_paramR(RR#RR,((R
ttest_del_paramds	

cCsGt}|idddd|idd|i|dddS(NsContent-Dispositiont
attachmentR
sbud.gifscontent-disposition(R0R#t
add_headerRRR+(RR#((R
ttest_del_param_on_other_headerus	cCs|i}t}|it|id|id||dd|idd||dd|id||dddS(	NRbs
text/plainscontent-typeR/sus-asciistext/plain; charset="us-ascii"s	text/htmlstext/html; charset="us-ascii"(	RR+R,R0R#RPt
ValueErrortset_typeR(RR#R,((R
t
test_set_type{s		

cCs;t}d|d<|idd|i|dddS(Ns
text/plainsX-Content-Typesapplication/octet-streamsx-content-type(R0R#RRR+(RR#((R
ttest_set_type_on_other_headers	
cCs#t}|i|iddS(Ns
text/plain(R0R#RR+tget_content_type(RR#((R
ttest_get_content_type_missings	cCs0t}|id|i|iddS(Nsmessage/rfc822(R0R#tset_default_typeRR+R(RR#((R
t/test_get_content_type_missing_with_default_types	
cCs2|id}|i|ididdS(Ns
msg_30.txtismessage/rfc822(RR%R#R+RAR(RR#((R
t+test_get_content_type_from_message_implicitscCs2|id}|i|ididdS(Ns
msg_28.txtismessage/rfc822(RR%R#R+RAR(RR#((R
t+test_get_content_type_from_message_explicitscCs)|id}|i|iddS(Ns
msg_03.txts
text/plain(RR%R#R+R(RR#((R
t6test_get_content_type_from_message_text_plain_implicitscCs)|id}|i|iddS(Ns
msg_01.txts
text/plain(RR%R#R+R(RR#((R
t6test_get_content_type_from_message_text_plain_explicitscCs#t}|i|iddS(NRb(R0R#RR+tget_content_maintype(RR#((R
t!test_get_content_maintype_missings	cCs0t}|id|i|iddS(Nsmessage/rfc822tmessage(R0R#RRR+R(RR#((R
t3test_get_content_maintype_missing_with_default_types	
cCs2|id}|i|ididdS(Ns
msg_30.txtiR(RR%R#R+RAR(RR#((R
t/test_get_content_maintype_from_message_implicitscCs2|id}|i|ididdS(Ns
msg_28.txtiR(RR%R#R+RAR(RR#((R
t/test_get_content_maintype_from_message_explicitscCs)|id}|i|iddS(Ns
msg_03.txtRb(RR%R#R+R(RR#((R
t:test_get_content_maintype_from_message_text_plain_implicitscCs)|id}|i|iddS(Ns
msg_01.txtRb(RR%R#R+R(RR#((R
t:test_get_content_maintype_from_message_text_plain_explicitscCs#t}|i|iddS(Ntplain(R0R#RR+tget_content_subtype(RR#((R
t test_get_content_subtype_missings	cCs0t}|id|i|iddS(Nsmessage/rfc822trfc822(R0R#RRR+R(RR#((R
t2test_get_content_subtype_missing_with_default_types	
cCs2|id}|i|ididdS(Ns
msg_30.txtiR(RR%R#R+RAR(RR#((R
t.test_get_content_subtype_from_message_implicitscCs2|id}|i|ididdS(Ns
msg_28.txtiR(RR%R#R+RAR(RR#((R
t.test_get_content_subtype_from_message_explicitscCs)|id}|i|iddS(Ns
msg_03.txtR(RR%R#R+R(RR#((R
t9test_get_content_subtype_from_message_text_plain_implicitscCs)|id}|i|iddS(Ns
msg_01.txtR(RR%R#R+R(RR#((R
t9test_get_content_subtype_from_message_text_plain_explicitscCs-t}d|d<|i|iddS(Nsno-slash-in-this-stringsContent-TypeRb(R0R#RR+R(RR#((R
ttest_get_content_maintype_errors	
cCs-t}d|d<|i|iddS(Nsno-slash-in-this-stringsContent-TypeR(R0R#RR+R(RR#((R
ttest_get_content_subtype_errors	
cCs=|i}t}|idd|idd|idd||idddg||idddg|idd||idddg||idddg|idd|idd	||iddddg||id	dddg|i	t
|id
ddS(NtFirsttOnetSecondtTwotThirdtThreetTwentytElevensOne HundredtFourthtMissing(RR+R,R0R#Rtkeystvaluestreplace_headerRPtKeyError(RR#R,((R
ttest_replace_headers		cCsPd}t}d|d<d|d<|i||i|idt|dS(NsAwDp0P7//y6LwKEAcPa/6Q=9saudio/x-midiscontent-typetbase64scontent-transfer-encodingRT(txR0R#R:RR+RARU(RR#R((R
ttest_broken_base64_payloads	


(6R&R'R.R8R9R;R?RFRGRJRSRVR[R`RgRqRwRzR{R|R}RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR(((R
R(Lsh												
	
																																						tTestEncoderscBs#tZdZdZdZRS(NcCs4|i}t}|id||dddS(Nsus-asciiscontent-transfer-encodingt7bit(RR+R,R0R#R4(RR#R,((R
ttest_encode_empty_payloads		
cCs*|i}td}||dddS(Nshello worldscontent-transfer-encodingR(RR+R,tMIMETextR#(RR#R,((R
ttest_default_ctes	cCsj|i}td}||ddtd}||ddtddd}||dddS(	Nshello worldscontent-transfer-encodingRs
hello  worldt8bitt_charsets
iso-8859-1squoted-printable(RR+R,RR#(RR#R,((R
Rs	(R&R'RR(((R
Rs		tTestLongHeaderscBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZRS(NcCsQ|i}tid}t}t|}|i
|||iddS(NsSubject: bug demonstration
	12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
	more text

test
(RRR,R!RyR#RR_t	GeneratorReRfR(RReR_R#R,((R
ttest_split_long_continuations		
cCsW|i}d}t|dd}||idt|}||iddS(Nsbug demonstration
	12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
	more texttcontinuation_wss	sbug demonstration
 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789
 more text(RRR,thstrRthtencode(RRR,R((R
t,test_another_long_almost_unsplittable_header/s	cCs|i}	td}td}td}d}
d}di	d}t|
|dd}|i
|||i
||t}||d<t}t|}|i||	|id	|	|i	d
dS(Ns
iso-8859-1s
iso-8859-2sutf-8sDie Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an sdlndischen Wandgemlden vorbei, gegen die rotierenden Klingen befrdert. s;Finanni metropole se hroutily pod tlakem jejich dvtipu.. u正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.」と言っています。theader_nametSubjectsSubject: =?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerd?=
 =?iso-8859-1?q?erband_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndi?=
 =?iso-8859-1?q?schen_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Kling?=
 =?iso-8859-1?q?en_bef=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_met?=
 =?iso-8859-2?q?ropole_se_hroutily_pod_tlakem_jejich_d=F9vtipu=2E=2E_?=
 =?utf-8?b?5q2j56K644Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE?=
 =?utf-8?b?44G+44Gb44KT44CC5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB?=
 =?utf-8?b?44GC44Go44Gv44Gn44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CM?=
 =?utf-8?q?Wenn_ist_das_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das?=
 =?utf-8?b?IE9kZXIgZGllIEZsaXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBow==?=
 =?utf-8?b?44Gm44GE44G+44GZ44CC?=

s=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerd?=
 =?iso-8859-1?q?erband_komfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndi?=
 =?iso-8859-1?q?schen_Wandgem=E4lden_vorbei=2C_gegen_die_rotierenden_Kling?=
 =?iso-8859-1?q?en_bef=F6rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_met?=
 =?iso-8859-2?q?ropole_se_hroutily_pod_tlakem_jejich_d=F9vtipu=2E=2E_?=
 =?utf-8?b?5q2j56K644Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE?=
 =?utf-8?b?44G+44Gb44KT44CC5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB?=
 =?utf-8?b?44GC44Go44Gv44Gn44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CM?=
 =?utf-8?q?Wenn_ist_das_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das?=
 =?utf-8?b?IE9kZXIgZGllIEZsaXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBow==?=
 =?utf-8?b?44Gm44GE44G+44GZ44CC?=(RRR,R3Retcztutf8tg_headtcz_headRt	utf8_headRRtappendR0R#RR_RRfR(RRReRRR_RRR#R,R((R
ttest_long_nonstring@s&		
	

cCs2|i}tddd}||iddS(Nsiwasnipoop; giraffes="very-long-necked-animals"; spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"RsX-Foobar-Spoink-Defrobnitsjwasnipoop; giraffes="very-long-necked-animals";
 spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"(RRR,RRR(RRR,((R
ttest_long_header_encodeks
	cCs8|i}tddddd}||iddS(Nsiwasnipoop; giraffes="very-long-necked-animals"; spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"RsX-Foobar-Spoink-DefrobnitRs	sjwasnipoop; giraffes="very-long-necked-animals";
	spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"(RRR,RRR(RRR,((R
t-test_long_header_encode_with_tab_continuationts	cCsX|i}td}d|d<t}t|}|i	|||i
ddS(NRsiwasnipoop; giraffes="very-long-necked-animals"; spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"sX-Foobar-Spoink-DefrobnitsContent-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals";
	spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"

(RRR,RR#RR_RReRfR(RReR_R#R,((R
ttest_header_splitter~s	
	
cCs|i}t}d|d<tig}tdD]}|d|q3~|d<|i
dt}t
|}|i|||iddS(Nstest@dom.ainRii
s<%d@dom.ain>t
ReferencestTestsFrom: test@dom.ain
References: <0@dom.ain> <1@dom.ain> <2@dom.ain> <3@dom.ain> <4@dom.ain>
	<5@dom.ain> <6@dom.ain> <7@dom.ain> <8@dom.ain> <9@dom.ain>

Test(RRR,R0R#tSPACERR@trangetiR:RR_RReRfR(RReRR_R@R#R,((R
ttest_no_semis_header_splitters		
8
	
cCs@|i}ddd}t|dd}||iddS(NsReferences: RiPRs	s\References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(RRR,RRRR(RRR,R((R
ttest_no_split_long_headers
	cCs8|i}d}t|dd}||iddS(NsWfrom babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]); by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81; for <mailman-admin@babylon.socal-raves.org>; Sat, 2 Feb 2002 17:00:06 -0800 (PST)
Rs	s_from babylon.socal-raves.org (localhost [127.0.0.1]);
	by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
	for <mailman-admin@babylon.socal-raves.org>;
	Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]);
	by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
	for <mailman-admin@babylon.socal-raves.org>;
	Sat, 2 Feb 2002 17:00:06 -0800 (PST)
	from babylon.socal-raves.org (localhost [127.0.0.1]);
	by babylon.socal-raves.org (Postfix) with ESMTP id B570E51B81;
	for <mailman-admin@babylon.socal-raves.org>;
	Sat, 2 Feb 2002 17:00:06 -0800 (PST)(RRR,RRRR(RRR,R((R
t"test_splitting_multiple_long_liness
	cCsD|i}d}t|dddddd}||iddS(	Nsfrom modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93] helo=cthulhu.gerg.ca)
	by kronos.mems-exchange.org with esmtp (Exim 4.05)
	id 17k4h5-00034i-00
	for test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400t
maxlineleniNRtReceivedRs	sfrom modemcable093.139-201-24.que.mc.videotron.ca ([24.201.139.93]
	helo=cthulhu.gerg.ca)
	by kronos.mems-exchange.org with esmtp (Exim 4.05)
	id 17k4h5-00034i-00
	for test@mems-exchange.org; Wed, 28 Aug 2002 11:25:20 -0400(RRR,RRRR(RRR,R((R
t&test_splitting_first_line_only_is_longs	cCsU|i}t}tdddd}|id||d<||iddS(NsBritische Regierung gibts
iso-8859-1RRs+grnes Licht fr Offshore-WindkraftprojektesSubject: =?iso-8859-1?q?Britische_Regierung_gibt?= =?iso-8859-1?q?gr=FCnes?=
 =?iso-8859-1?q?_Licht_f=FCr_Offshore-Windkraftprojekte?=

(	RRR,R0R#RRRRr(RRR#R,((R
ttest_long_8bit_headers			

cCs3|i}t}d|d<||iddS(NsfBritische Regierung gibt grnes Licht fr Offshore-Windkraftprojekte <a-very-long-address@example.com>sReply-TosrReply-To: Britische Regierung gibt grnes Licht fr Offshore-Windkraftprojekte <a-very-long-address@example.com>

(RRR,R0R#Rr(RR#R,((R
t test_long_8bit_header_no_charsets
		
cCs<|i}d}t}||d<||idddS(Ns"Someone Test #A" <someone@eecs.umich.edu>,<someone@eecs.umich.edu>,"Someone Test #B" <someone@umich.edu>, "Someone Test #C" <someone@eecs.umich.edu>, "Someone Test #D" <someone@eecs.umich.edu>RnisTo: "Someone Test #A" <someone@eecs.umich.edu>, <someone@eecs.umich.edu>,
	"Someone Test #B" <someone@umich.edu>,
	"Someone Test #C" <someone@eecs.umich.edu>,
	"Someone Test #D" <someone@eecs.umich.edu>

(RRR,RkR0R#Rr(RR#RkR,((R
ttest_long_to_headers		
cCs?|i}d}t|}|id||iddS(NsIThis is an example of string which has almost the limit of header length.sAdd another line.s\This is an example of string which has almost the limit of header length.
 Add another line.(RRR,RcRRRR(RRR,Rc((R
ttest_long_line_after_appends	
cCs?|i}d}t|}|id||iddS(NsThis is a shorter line.s!Add another sentence. (Surprise?)s9This is a shorter line. Add another sentence. (Surprise?)(RRR,RcRRRR(RRR,Rc((R
ttest_shorter_line_with_appends	
cCsA|i}d}d}t|dd|}||iddS(Ns!X-Very-Very-Very-Long-Header-NamesDie Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an sdlndischen Wandgemlden vorbei, gegen die rotierenden Klingen befrdert. s
iso-8859-1Rs=?iso-8859-1?q?Die_Mieter_treten_hier_?=
 =?iso-8859-1?q?ein_werden_mit_einem_Foerderband_komfortabel_den_Korridor_?=
 =?iso-8859-1?q?entlang=2C_an_s=FCdl=FCndischen_Wandgem=E4lden_vorbei=2C_g?=
 =?iso-8859-1?q?egen_die_rotierenden_Klingen_bef=F6rdert=2E_?=(RRR,tfntgsRRR(RRRR,R((R
ttest_long_field_names	cCsId}t}t|dd|d<||d<|i|iddS(Nsfrom FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP; Wed, 05 Mar 2003 18:10:18 -0700Rs	s
Received-1s
Received-2s1Received-1: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
	hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
	Wed, 05 Mar 2003 18:10:18 -0700
Received-2: from FOO.TLD (vizworld.acl.foo.tld [123.452.678.9]) by
	hrothgar.la.mastaler.com (tmda-ofmipd) with ESMTP;
	Wed, 05 Mar 2003 18:10:18 -0700

(RR0R#RRR+Rr(RR#R((R
ttest_long_received_headers	
cCsOd}t}t|dddd|d<||d<|i|iddS(Ns<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")Rs
Received-1Rs	s
Received-2sReceived-1: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
	(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")
Received-2: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de>
	(David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")

(RR0R#RRR+Rr(RR#R((R
ttest_string_headerinst_eqs	
cCsO|i}t}d}||d<t|dd|d<||iddS(Ns iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzpsFace-1RsFace-2s7Face-1: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
	locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp
Face-2: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUAAAAkHiJeRUIcGBi9
 locQDQ4zJykFBAXJfWDjAAACYUlEQVR4nF2TQY/jIAyFc6lydlG5x8Nyp1Y69wj1PN2I5gzp

(RRR,R0R#ttRRr(RRR#R,((R
t-test_long_unbreakable_lines_with_continuation,s		
cCs5|i}d}ti|}||iddS(NsReceived: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with Microsoft SMTPSVC(5.0.2195.4905);
	Wed, 16 Oct 2002 07:41:11 -0700sReceived: from siimage.com ([172.25.1.3]) by zima.siliconimage.com with
	Microsoft SMTPSVC(5.0.2195.4905); Wed, 16 Oct 2002 07:41:11 -0700

(RRR,tmR!RyR#Rr(RR#RR,((R
t"test_another_long_multiline_header<s
	cCsO|i}d}t}||d<t|dd|d<||iddS(NsList-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
        <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>tListRsQList: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
	<mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>
List: List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/spamassassin-talk>,
 <mailto:spamassassin-talk-request@lists.sourceforge.net?subject=unsubscribe>

(RRR,RR0R#RRr(RRR#R,((R
t%test_long_lines_with_different_headerHs		
(R&R'RRRRRRRRRRRRRRRRRRRRR(((R
Rs*			+			
						
			
								tTestFromManglingcBs#tZdZdZdZRS(NcCs-t|_d|id<|iiddS(Nsaaa@bbb.orgRis(From the desk of A.A.A.:
Blah blah blah
(R0RR#R:(R((R
tsetUp\s
cCsEt}t|dt}|i|i|i|i	ddS(Ntmangle_from_s<From: aaa@bbb.org

>From the desk of A.A.A.:
Blah blah blah
(
RRcRRUReRfRR#R+R(RReRc((R
ttest_mangled_fromds
	cCsEt}t|dt}|i|i|i|i	ddS(NRs;From: aaa@bbb.org

From the desk of A.A.A.:
Blah blah blah
(
RRcRRReRfRR#R+R(RReRc((R
ttest_dont_mangle_fromos
	(R&R'RRR(((R
R[s		t
TestMIMEAudiocBs5tZdZdZdZdZdZRS(NcCsstiitiitdd}ttd|d}z|i	|_Wd|iXt
|i|_dS(NRRsaudiotest.autrb(RRRRR	tdatadirRR RRaRt
_audiodataR$t	MIMEAudiot_au(RRR((R
R~s$cCs|i|iiddS(Nsaudio/basic(RR+RR5(R((R
ttest_guess_minor_typescCs/|ii}|iti||idS(N(RRRAtpayloadR+RtdecodestringR(RR((R
t
test_encodingscCs,t|id}|i|iddS(Ntfishs
audio/fish(R
RRtauR+R5(RR((R
ttest_checkSetMinorscCs|i}|i}|iidddd||idd||iidddd
g||iiddddg}||iidddd||iid	d
|dd|j||iid||j||iid|dd|jdS(NsContent-DispositionRR
saudiotest.auscontent-dispositions#attachment; filename="audiotest.au"RMRRYtfailobjtfoobar(s
attachmentR(R
saudiotest.au(
RR+R,RptunlessRRRR6tmissing(RRR,R((R
ttest_add_headers"		


(R&R'RRRRR(((R
R	}s
				t
TestMIMEImagecBs5tZdZdZdZdZdZRS(NcCsCtd}z|i|_Wd|iXt|i|_dS(NsPyBanner048.gif(RRRaRt_imgdataR$t	MIMEImaget_im(RR((R
RscCs|i|iiddS(Ns	image/gif(RR+RR5(R((R
RscCs/|ii}|iti||idS(N(RRRARR+RRR(RR((R
RscCs,t|id}|i|iddS(NRs
image/fish(RRRtimR+R5(RR((R
RscCs|i}|i}|iidddd||idd||iidddd
g||iiddddg}||iidddd||iid	d
|dd|j||iid||j||iid|dd|jdS(NsContent-DispositionRR
sdingusfish.gifscontent-dispositions%attachment; filename="dingusfish.gif"RMRRYRR(s
attachmentR(R
sdingusfish.gif(
RR+R,RpRRRRR6R(RRR,R((R
Rs"		


(R&R'RRRRR(((R
Rs
				tTestMIMETextcBs,tZdZdZdZdZRS(NcCstd|_dS(Nshello there(RRt_msg(R((R
RscCs|i}|i}||iid||iiddg}||iid||j||iid|dd|jdS(Ns
text/plainR/sus-asciiRRM(	RR+R,RpRR!R5R6R(RRR,R((R
t
test_typess		cCs4|i|iid|i|iidS(Nshello there(RR+R!RARptis_multipart(R((R
ttest_payloadscCsF|i}tddd}||iid||dddS(Nshello thereRsus-asciiscontent-typestext/plain; charset="us-ascii"(RR+R,RR#R1R7(RR#R,((R
ttest_charsets	(R&R'RR"R$R%(((R
R s		
	t
TestMultipartcBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZRS(NcCsZtd}z|i}Wd|iXtdddd}t|dd}	|	i	dd	d
dt
d}|i||i|	d|d
<d|d<d|d<d}ti|}|ddjo
ti}n
ti}|djo
d}nd}d||df}
tidti||
|d<||_|	|_||_dS(NsPyBanner048.gift	multiparttmixedRRHRsdingusfish.gifscontent-dispositionRR
s$Hi there,

This is the dingus fish.
sBarry <barry@digicool.com>Ris)Dingus Lovers <cravindogs@cravindogs.com>RnsHere is your dingus fishRf987809702.54848599iit-t+s %s%04di$s%a, %d %b %Y %H:%M:%StDate(RRRaRR$tMIMEBaset	containerRtimageRRtintrotattachtnowttimet	localtimet	timetuplettimezonettzsecstaltzonetsignttzoffsettstrftimeRR!Rt_txt(RRR-R4R6R8R/R1RR.R9((R
Rs:






	

			cCs|i}|i}|i}|i}||i	||i
d|t|id|t
|id|id}|id}|||ij|||ij||i||g||i	||i	dS(Nsmultipart/mixediii(RR+R,RpRRPtraisesR!RR#R5tlenRAt
IndexErrortm0tm1R;R(RRRR@R<R,R?((R
ttest_hierarchys				cCs2d}ti|}|i||idS(NsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY


--BOUNDARY--
(RbtParsertparsestrR#RRRr(RR#Rb((R
ttest_empty_multipart_idempotent0s
cCsTtdd}d|d<d|d<d|d<|id	|i|id
dS(NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRiRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY

--BOUNDARY--(R,touterRKRRRr(RRE((R
t/test_no_parts_in_a_multipart_with_none_epilogueAs



	cCsftdd}d|d<d|d<d|d<d	|_d	|_|id
|i|iddS(NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRiRRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY

--BOUNDARY--
(R,REtpreambletepilogueRKRRRr(RRE((R
t0test_no_parts_in_a_multipart_with_empty_epilogueRs


		
cCss|i}tdd}d|d<d|d<d|d<|id	td
}|i|||i	ddS(NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRiRHshello worldsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--(
RRR,R,RERKRR#R0Rr(RRER#R,((R
ttest_one_part_in_a_multipartgs	





cCs||i}tdd}d|d<d|d<d|d<d	|_td
}|i||i	d||i
ddS(
NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRiRshello worldRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain


--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--(RRR,R,RERGRR#R0RKRr(RRER#R,((R
t1test_seq_parts_in_a_multipart_with_empty_preambles	


	

cCs||i}tdd}d|d<d|d<d|d<d|_td	}|i	||i
d
||iddS(NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRishello worldRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--(RRR,R,RER2RGRR#R0RKRr(RRER#R,((R
t0test_seq_parts_in_a_multipart_with_none_preambles	


	


cCs||i}tdd}d|d<d|d<d|d<d|_td	}|i	||i
d
||iddS(NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRishello worldRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--(RRR,R,RER2RHRR#R0RKRr(RRER#R,((R
t0test_seq_parts_in_a_multipart_with_none_epilogues	


	


cCs||i}tdd}d|d<d|d<d|d<d	|_td
}|i||i	d||i
ddS(
NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRiRshello worldRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--
(RRR,R,RERHRR#R0RKRr(RRER#R,((R
t1test_seq_parts_in_a_multipart_with_empty_epilogues	


	

cCs||i}tdd}d|d<d|d<d|d<d	|_td
}|i||i	d||i
ddS(
NR'R(s	A subjectRsaperson@dom.ainRnsbperson@dom.ainRis
shello worldRHsContent-Type: multipart/mixed; boundary="BOUNDARY"
MIME-Version: 1.0
Subject: A subject
To: aperson@dom.ain
From: bperson@dom.ain

--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

hello world
--BOUNDARY--

(RRR,R,RERHRR#R0RKRr(RRER#R,((R
t.test_seq_parts_in_a_multipart_with_nl_epilogues	


	

cCs|i}|id}|t|id|id}||id|t|idxb|iD]T}||id|t|id|id}||idqyWdS(Ns
msg_36.txtiismultipart/alternativesmessage/external-bodyis
text/plain(RR+R,R%R#R=RAtmsg1RREt
subsubpart(RRPRER#R,RQ((R
ttest_message_external_bodys	
cCs/|id}|it|iddS(Ns
msg_37.txti(RR%R#R+R=RA(RR#((R
ttest_double_boundaryscCsH|i}|id}t}ti||||i	ddS(Ns
msg_38.txtsmultipart/mixed
    multipart/mixed
        multipart/alternative
            text/plain
        text/plain
    text/plain
    text/plain
(
RRR,R%R#RR_t	Iteratorst
_structureR(RR_R#R,((R
t)test_nested_inner_contains_outer_boundarys		cCsH|i}|id}t}ti||||i	ddS(Ns
msg_39.txtsmultipart/mixed
    multipart/mixed
        multipart/alternative
        application/octet-stream
        application/octet-stream
    text/plain
(
RRR,R%R#RR_RTRUR(RR_R#R,((R
ttest_nested_with_same_boundary+s		cCs)|id}|i|iddS(Ns
msg_40.txtsMIME-Version: 1.0
Content-Type: text/html; boundary="--961284236552522269"

----961284236552522269
Content-Type: text/html;
Content-Transfer-Encoding: 7Bit

<html></html>

----961284236552522269--
(RR%R#R+Rr(RR#((R
ttest_boundary_in_non_multipart<scCs[|i}tid}|i|i||id|t	|i
ddS(NsMIME-Version: 1.0
Content-Type: multipart/mixed; boundary="    XXXX"

--    XXXX
Content-Type: text/plain


--    XXXX
Content-Type: text/plain

--    XXXX--
s    XXXXi(RR+R,R!RyR#RpR#RIR=RA(RR#R,((R
t test_boundary_with_leading_spaceKs
	
cCs5tid}|i|ididdS(NsContent-Type: multipart/mixed; boundary="===============0012394164=="
MIME-Version: 1.0

--===============0012394164==
Content-Type: image/file1.jpg
MIME-Version: 1.0
Content-Transfer-Encoding: base64

YXNkZg==
--===============0012394164==--isYXNkZg==(RBRCRRtassertEqualsRA(RR((R
t&test_boundary_without_trailing_newline^s(R&R'RRARDRFRIRJRKRLRMRNRORRRSRVRWRXRYR[(((R
R&s$	(											
					tTestNonConformantcBsPtZdZdZdZdZdZdZdZdZ	RS(	NcCsU|i}|id}||id||id||iddS(Ns
msg_14.txtRbR(RR+R,R%R#R5RR(RR#R,((R
ttest_parse_missing_minor_typeps
	cCst|i}|id}|id}|t|d|it	|i
d|t|i
dti
dS(Ns
msg_15.txtitdefectsi(RRpRR%R#RAtinnerthasattrR+R=R^t
isinstanceRQtStartBoundaryNotFoundDefect(RRR_R#((R
ttest_same_boundary_inner_outerws	cCs|i}|id}|t|it|it	|i
d|t|i
dti|t|i
dti
dS(Ns
msg_25.txtiii(RRpRR%R#RaRARR+R=R^RQtNoBoundaryInMultipartDefectt!MultipartInvariantViolationDefect(RRR#((R
ttest_multipart_no_boundarys	cCs|i}|i}t}d|d<||id||id||i	d|d=d|d<||id||id||i	dt
}t|}|i|||iddS(NRbsContent-TypeRs
text/plainscontent-typeRYsContent-Type: foo

(RR+R,RtneqR0R#RRRRRcRReRfR(RReRcR#R,Rg((R
ttest_invalid_content_types 			

	
cCs/|i}|id}||iddS(Ns
msg_31.txtsm--BOUNDARY
Content-Type: text/plain

message 1

--BOUNDARY
Content-Type: text/plain

message 2

--BOUNDARY--
(RRR,R%R#RA(RR#R,((R
ttest_no_start_boundarys	cCs/|i}|id}||iddS(Ns
msg_35.txtsFrom: aperson@dom.ain
To: bperson@dom.ain
Subject: here's something interesting

counter to RFC 2822, there's no separating newline here
(RRR,R%R#Rr(RR#R,((R
ttest_no_separating_blank_lines	cCs|i}|id}|t|d|it|id|t	|idt
i|t	|idt
idS(Ns
msg_41.txtR^iii(
RRpRR%R#R`R+R=R^RaRQRdRe(RRR#((R
ttest_lying_multiparts	cCsd|id}|idid}|it|id|it	|idt
idS(Ns
msg_42.txtii(RR%RERAtbadR+R=R^RpRaRQRb(RRERl((R
ttest_missing_start_boundarys
	(
R&R'R]RcRfRhRiRjRkRm(((R
R\os		
							tTestRFC2047cBs#tZdZdZdZRS(NcCsQ|i}d}t|}||ddd	d
g|tt|ddS(NsVRe: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz
 foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=sRe:s
rksmrgssmac-icelandsbaz foo barsVRe: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar
 =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=(sRe:N(s
rksmrgssmac-iceland(sbaz foo barN(s
rksmrgssmac-iceland(	RR+R,Rct
decode_headertdhR2Rtmake_header(RRpRcR,((R
ttest_rfc2047_multilines	cCsZ|i}d}t|}||ddgtt|i	d}||ddS(	Ns0=?ISO-8859-1?Q?Andr=E9?= Pirard <pirard@dom.ain>sAndrs
iso-8859-1sPirard <pirard@dom.ain>slatin-1sAndr Pirard <pirard@dom.ain>(sAndrs
iso-8859-1(sPirard <pirard@dom.ain>N(RR+R,RcRoRpR2tunicodeRqRthu(RRpRtRcR,((R
ttest_whitespace_eater_unicodes	cCsW|i}d}t|}||dd	d
dgt|i}||ddS(NsWThe =?iso-8859-1?b?cXVpY2sgYnJvd24gZm94?= jumped over the =?iso-8859-1?b?bGF6eSBkb2c=?=tThesquick brown foxs
iso-8859-1sjumped over theslazy dogu,The quick brown fox jumped over the lazy dog(RvN(squick brown foxs
iso-8859-1(sjumped over theN(slazy dogs
iso-8859-1(
RR+R,RcRoRpR2Rqt__unicode__Rt(RRpRtRcR,((R
ttest_whitespace_eater_unicode_2s	(R&R'RrRuRx(((R
Rns		tTestMIMEMessagecBs}tZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZRS(NcCs1td}z|i|_Wd|iXdS(Ns
msg_11.txt(RRRaRt_textR$(RR((R
Rs
cCs|ittddS(Nsa plain string(RRPt	TypeErrortMIMEMessage(R((R
ttest_type_errorscCs|i}|i}d}t}||d<t|}||i
d|i}|t
|t|t|d|d}|||j||d|dS(Ns
A sub-messageRsmessage/rfc822iitsubject(RR+R,RpRR~R0RR|RR5RARRatlistR=RE(RRRERRR,RR~((R
ttest_valid_arguments			

cCsX|i}t}d|d<t}d|d<t|}|it	i
|i|dS(Ns	subpart 1Rs	subpart 2(RR+R,R0RPtmsg2R|RRPRQtMultipartConversionErrorR0(RRPRRR,((R
ttest_bad_multiparts		
	
cCsrt}d|d<|idt|}d|d<t}t|}|i	||i|iddS(NsAn enclosed messageRs!Here is the body of the message.
sThe enclosing messagesContent-Type: message/rfc822
MIME-Version: 1.0
Subject: The enclosing message

Subject: An enclosed message

Here is the body of the message.
(
R0RR:R|RRRcRReRfRR+R(RReRRcR((R
t
test_generates	


	
cCs|i}|i}|id}||id|i}|t
|t|t|d|d}|it
|t||dd||iddS(Ns
msg_11.txtsmessage/rfc822iiR~sAn enclosed messages!Here is the body of the message.
(RR+R,RpRR%R#R5RARRaRR=tsubmsgR0(RRRR#R,R((R
ttest_parse_message_rfc8220s		
c	Cs?|i}|i}|id}||id||i|t	|i
d|i
d}||id||i
d|i
d}||id|t	|i
d	|i
d}|t
|t||d
d||idd
dd||idd
dd|i
d}|t
|t||dd||id
dddg||idd
dd|i
d	}||id|i
}|t
|t|t	|d|d}|t
|t||id||dddS(Ns
msg_16.txtsmultipart/reportiis
text/plainsThis report relates to a message you sent with the following header fields:

  Message-id: <002001c144a6$8752e060$56104586@oxy.edu>
  Date: Sun, 23 Sep 2001 20:10:55 -0700
  From: "Ian T. Henry" <henryi@oxy.edu>
  To: SoCal Raves <scr@socal-raves.org>
  Subject: [scr] yeah for Ians!!

Your message cannot be delivered to the following recipients:

  Recipient address: jangel1@cougar.noc.ucla.edu
  Reason: recipient reached disk quota

ismessage/delivery-statusisoriginal-envelope-ids"0GK500B4HD0888@cougar.noc.ucla.edutdnsRMs
reporting-mtaRtnsdtactiontfailedsoriginal-recipientRsjangel1@cougar.noc.ucla.edusfinal-recipientsmessage/rfc822s
message-ids(<002001c144a6$8752e060$56104586@oxy.edu>(srfc822R(sjangel1@cougar.noc.ucla.eduR(RR+R,RpRR%R#R5R#R=RAREtdsn1RaR0R6R2tdsn2RRRRQ(	RRQRRERRR#R,R((R
ttest_dsn=sD		


c	Cs|i}td}z|i}Wd|iXt}d|d<d|d<d|d<d|_
d	|_td
}td}|idd
dd|i||i|t}t|}|i|||i|dS(Ns
msg_21.txtsaperson@dom.ainRisbperson@dom.ainRnRRsMIME messagesEnd of MIME message
RRsContent-Typesmultipart/mixedRRH(RRR,RRRaRbR$R0R#RGRHRRPRRR0RR_RReRfR(	RRRPReRRbR_R#R,((R
t
test_epiloguews*		


		

	
cCs|i}t}d|d<d|d<d|d<d|_d|_td	}td
}|i
ddd
d|i||i|||iddS(Nsaperson@dom.ainRisbperson@dom.ainRnRRsMIME messageRRRsContent-Typesmultipart/mixedRRHsdFrom: aperson@dom.ain
To: bperson@dom.ain
Subject: Test
Content-Type: multipart/mixed; boundary="BOUNDARY"

MIME message
--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

One
--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

Two
--BOUNDARY--
(
RRR,R0R#RGRHRRPRRR0Rr(RRPRR#R,((R
ttest_no_nl_preambles		


		

cCs|i}td}zti|}Wd|iX|i	d}||id||id|i	d}||id||id|i	d}||id||id|i	d}||id||iddS(Ns
msg_30.txtismessage/rfc822is
text/plain(RR+R,RRR!R"R#R$RAt
container1tget_default_typeR5R2t
container2tcontainer1atcontainer2a(RRRRRR#R,R((R
ttest_default_types$	cCs|i}td}zti|}Wd|iX|i	d}||id||id|i	d}||id||id|i	d}||id||id|i	d}||id||iddS(Ns
msg_28.txtismessage/rfc822is
text/plain(RR+R,RRR!R"R#R$RARRR5RRR(RRRRRR#R,R((R
t.test_default_type_with_explicit_container_types$	cCsX|i}|i}tdd}d|_td}td}t|}t|}|i||i|||id||id||id||id||idd|d	=|d
=|d	=|d
=||id||id||id||id||idddS(NtdigestRHRs
message 1
s
message 2
smessage/rfc822isContent-Type: multipart/digest; boundary="BOUNDARY"
MIME-Version: 1.0

--BOUNDARY
Content-Type: message/rfc822
MIME-Version: 1.0

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 1

--BOUNDARY
Content-Type: message/rfc822
MIME-Version: 1.0

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 2

--BOUNDARY--
scontent-typesmime-versionsBContent-Type: multipart/digest; boundary="BOUNDARY"
MIME-Version: 1.0

--BOUNDARY

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 1

--BOUNDARY

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

message 2

--BOUNDARY--
(RR+R,RRgt
MIMEMultipartR-RHRt	subpart1at	subpart2aR|tsubpart1tsubpart2R0R5RRrR2(RR-RRRR,RRg((R
ttest_default_type_non_parseds4			

cCs|i}td}td}td||f}|t|i	d||i	d|||i	d|dS(NRt	_subpartsiii(
RR+R,Rttext1ttext2RR#R=RA(RRRR#R,((R
t$test_mime_attachments_in_constructor#s	(R&R'RR}RRRRRRRRRRR(((R
Rys							
	:		#			JtTestIdempotentcBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZRS(NcCsCt|}z|i}Wd|iXti|}||fS(N(	RR
RRaRR$R!RyR#(RR
RR#R((R
R%4scCsH|i}t}t|dd}|i||||i
dS(Ntmaxheaderleni(RRR,RRcRReRfR#RbR(RR#RbReRcR,((R
t_idempotent=s
		
cCs|i}|id\}}||id||id||id||i	dd||i
dd||id||i
d|i||dS(	Ns
msg_01.txts
text/plainRbRiR/sus-ascii(scharsetsus-ascii(RRZR,R%R#RbR5RRRR6RGR2RHR(RR#RbR,((R
ttest_parse_text_messageDs	cCsn|i}|id\}}||id||id||i	dd|i
||dS(Ns
msg_03.txtR/(RRZR,R%R#RbR5R2RR6R(RR#RbR,((R
ttest_parse_untyped_messagePs	cCs)|id\}}|i||dS(Ns
msg_04.txt(RR%R#RbR(RR#Rb((R
ttest_simple_multipartXscCs)|id\}}|i||dS(Ns
msg_02.txt(RR%R#RbR(RR#Rb((R
ttest_MIME_digest\scCs)|id\}}|i||dS(Ns
msg_27.txt(RR%R#RbR(RR#Rb((R
ttest_long_header`scCs)|id\}}|i||dS(Ns
msg_28.txt(RR%R#RbR(RR#Rb((R
t"test_MIME_digest_with_part_headersdscCs)|id\}}|i||dS(Ns
msg_06.txt(RR%R#RbR(RR#Rb((R
ttest_mixed_with_imagehscCs)|id\}}|i||dS(Ns
msg_05.txt(RR%R#RbR(RR#Rb((R
ttest_multipart_reportlscCs)|id\}}|i||dS(Ns
msg_16.txt(RR%R#RbR(RR#Rb((R
RpscCs)|id\}}|i||dS(Ns
msg_21.txt(RR%R#RbR(RR#Rb((R
ttest_preamble_epiloguetscCs)|id\}}|i||dS(Ns
msg_23.txt(RR%R#RbR(RR#Rb((R
ttest_multipart_one_partxscCs)|id\}}|i||dS(Ns
msg_24.txt(RR%R#RbR(RR#Rb((R
ttest_multipart_no_parts|scCs)|id\}}|i||dS(Ns
msg_31.txt(RR%R#RbR(RR#Rb((R
RiscCs)|id\}}|i||dS(Ns
msg_32.txt(RR%R#RbR(RR#Rb((R
ttest_rfc2231_charsetscCs)|id\}}|i||dS(Ns
msg_33.txt(RR%R#RbR(RR#Rb((R
ttest_more_rfc2231_parametersscCs)|id\}}|i||dS(Ns
msg_34.txt(RR%R#RbR(RR#Rb((R
t%test_text_plain_in_a_multipart_digestscCs)|id\}}|i||dS(Nsmsg_12a.txt(RR%R#RbR(RR#Rb((R
ttest_nested_multipart_mixedsscCs)|id\}}|i||dS(Ns
msg_36.txt(RR%R#RbR(RR#Rb((R
t%test_message_external_body_idempotentsc
Cs|i}|i}|id\}	}||	idh}x$|	i
D]\}
}|||
<qMW||dd||dd||	i
d||	id|t|	id	|	id
}||id||id|	id
}||id||id|	id}||id|it|t|i}|t|t|t|d
|d
}|t|t||iddS(Ns
msg_05.txtsmultipart/reportsreport-typesdelivery-statusRs%D1690A7AC1.996856090/mail.example.coms%This is a MIME-encapsulated message.
s
iis
text/plainsYadda yadda yadda
iismessage/rfc822(RRZR,RpRR%R#RbR5tparamsRtpktpvRGRHR=RARPRR2tmsg3RaR0RRtmsg4(
RRPRRRRRbRRR#RR,R((R
ttest_content_types8		

cCs|i}|i}|id\}}||id|i	}|t|t|t
|d|d}|it|t||id|it|i	t||i	ddS(Ns
msg_06.txtsmessage/rfc822iis
text/plains
(RRZR,RpRR%R#RbR5RARRaRR=RPR0R(RRRbR#RPR,R((R
ttest_parsers		
(R&R'R%RRRRRRRRRRRRRRiRRRRRRR(((R
R3s,																						 tTestMiscellaneouscBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZRS(NcCs{td}z|i}Wd|iXti|}t}t
|dd}|i||i||idS(Ns
msg_01.txtRi(RRRaRbR$R!RyR#RRcRReRfRR+R(RRReRbRcR#((R
ttest_message_from_strings	
cCstd}zj|i}|idti|}t}t
|dd}|i||i||iWd|iXdS(Ns
msg_01.txtiR(RRRaRbtseekR!R"R#RRcRReRfRR+RR$(RRReRbRcR#((R
ttest_message_from_files
	
cCs|i}td}z|i}Wd|iXdtfdY}t
i||}|t
||td}z|i}Wd|iXt
i||}x'|iD]}|t
||qWdS(Ns
msg_01.txtt	MyMessagecBstZRS(N(R&R'(((R
Rss
msg_02.txt(RRpRRRRaRbR$R0RR!RyR#RatwalkRE(RRRRRERbR#((R
t#test_message_from_string_with_classs$	
cCs|i}dtfdY}td}zti||}Wd|i
X|t||td}zti||}Wd|i
Xx'|iD]}|t||qWdS(NRcBstZRS(N(R&R'(((R
Rss
msg_01.txts
msg_02.txt(RRpRR0RRRR!R"R#R$RaRRE(RRRRRER#((R
t!test_message_from_file_with_classs 	
cCsotd}|i}|i|i|dddddddd	d
ddd
ddddddddgdS(NR!R3tEncodersRQRRRTR
R,RR|RtMIMENonMultipartRR0RBtUtilst
base64MIMER"Ryt
quopriMIME(t
__import__tmodulet__all__talltsortRR+(RRR((R
ttest__all__s	
cCsCti}|ititi|d ti|d dS(Ni(R2R1RR+Rt	parsedatet
formatdatetgmtime(RR1((R
ttest_formatdate"scCsIti}|ititi|dtd ti|d dS(NR3i(	R2R1RR+RRRRUR3(RR1((R
ttest_formatdate_localtime's%cCs~ti}|iti|dttidti||iti|dtdt	tidti|dS(NR3s%a, %d %b %Y %H:%M:%S -0000tusegmts%a, %d %b %Y %H:%M:%S GMT(
R2R1RR+RRRR:RRU(RR1((R
ttest_formatdate_usegmt-s
cCs|itidddS(NR(RR+RRR2(R((R
ttest_parsedate_none6scCs&|itidtiddS(NsWed,3 Apr 2002 14:58:26 +0800sWed, 3 Apr 2002 14:58:26 +0800(RR+RR(R((R
ttest_parsedate_compact9scCs#|i}|tidddS(Ns25 Feb 2003 13:47:26 -0800iiii
i/iiii(
iiii
i/iiiii(RR+R,Rtparsedate_tz(RR,((R
ttest_parsedate_no_dayofweek>s	cCs#|i}|tidddS(Ns5 Feb 2003 13:47:26 -0800iiii
i/iiii(
iiii
i/iiiii(RR+R,RR(RR,((R
t#test_parsedate_compact_no_dayofweekCs	cCs|i}tid}tti|}|ti
|d |d |ttid|dtid}tti|d }|ti
|d |d |ttid|d ddS(Ns5 Feb 2003 13:47:26 -0800is%Yii	(
RR+R,RRttimetuptintR2tmktimeRR3R:R(RRRR,((R
t+test_parsedate_acceptable_to_time_functionsHs	cCs?|itidd|ititidddS(Ns<>R(RR(RR+Rt	parseaddrt
formataddr(R((R
ttest_parseaddr_emptySscCs|itidddS(NsA Silly Personsperson@dom.ainsA Silly Person <person@dom.ain>(sA Silly Personsperson@dom.ain(RR+RR(R((R
ttest_noquote_dumpWscCsW|itiddd}d}|ititi||f||fdS(NsA (Very) Silly Personsperson@dom.ains*"A \(Very\) Silly Person" <person@dom.ain>sA \(Special\) Person(sA (Very) Silly Personsperson@dom.ain(RR+RRtatbR(RRR((R
ttest_escape_dump\s
cCsW|itiddd}d}|ititi||f||fdS(NsArthur \Backslash\ Foobarsperson@dom.ains."Arthur \\Backslash\\ Foobar" <person@dom.ain>(sArthur \Backslash\ Foobarsperson@dom.ain(RR+RRRRR(RRR((R
ttest_escape_backslashesds
cCsyd}d}d\}}|iti|||f|iti|||f|iti||f|dS(NsJohn X. Doe <jxd@example.com>s"John X. Doe" <jxd@example.com>sJohn X. Doesjxd@example.com(sJohn X. Doesjxd@example.com(	RtyRRRR+RRR(RRRRR((R
ttest_name_with_dotlscCs|itidddS(NsA Silly; Personsperson@dom.ains""A Silly; Person" <person@dom.ain>(sA Silly; Personsperson@dom.ain(RR+RR(R((R
ttest_quote_dumpuscCs{|i}|tidd|tidd|tidd|tidd|tidddS(Nthelloshello
shello
shello
shello

s	hello

(RR+R,Rtfix_eols(RR,((R
t
test_fix_eolszs	cCs|i}|i}t}t}||d||d||d|d||d||d|||d||d||d|d||d||d|||||||dS(Nsus-asciisUS-ASCIIsUs-AsCiItusasciitUSASCIItUsAsCiI(RR+R,tfailIfEqualtneR3tcset1tcset2(RRRRR,((R
ttest_charset_richcomparisonss$				












cCs/|i}|tiddgddgdS(	Nsaperson@dom.ain (Al Person)sBud Person <bperson@dom.ain>s	Al Personsaperson@dom.ains
Bud Personsbperson@dom.ain(s	Al Personsaperson@dom.ain(s
Bud Personsbperson@dom.ain(RR+R,Rtgetaddresses(RR,((R
ttest_getaddressess	cCsm|i}|tidgdg|tidgd	d
dg|tiddgdd
gdS(Nsfoo: ;Rs	[]*-- =~$s*--s#"Jason R. Mastaler" <jason@dom.ain>sJason R. Mastalers
jason@dom.ain(RR(RR(RR(Rs*--(RR(sJason R. Mastalers
jason@dom.ain(RR+R,RR(RR,((R
ttest_getaddresses_nastys	cCs?|i}t}|idddd||iddS(Nscontent-dispositionRR
sfoo\wacky"name(RR+R,R0R#RRC(RR#R,((R
ttest_utils_quote_unquotes
		
cCs&td}|i|iddS(Ns
not a charsetR(R3R/RR+tget_body_encoding(RR/((R
t)test_get_body_encoding_with_bogus_charsetscCst|i}t}d|d<||dd|i}|t|d||ddt|d}||i
d|idd	|||id
||idt
d||ddt}d
|d<|i}|t|d||ddt|d}||i
ti|idd	|||id||dddS(Nstext/plain; charset=UTF-8sContent-Typescontent-typeiisutf-8Rshello worldR/saGVsbG8gd29ybGQ=
RTscontent-transfer-encodingstext/plain; charset="US-ASCII"sus-asciiR(RR+R,R0R#R=R>R=R3R/RR:RARURtencode_7or8bit(RR/R#R,R>((R
t-test_get_body_encoding_with_uppercase_charsets.		
	
cCs8td}td}|i|i|idS(Nsus-asciisUS-ASCII(R3tlctucRR+R(RRR((R
ttest_charsets_case_insensitivescCsH|i}|id}t}ti||||i	ddS(Ns
msg_43.txtsBmultipart/report
    text/plain
    message/delivery-status
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
        text/plain
    text/rfc822-headers
(
RRR,R%R#RR_RTRUR(RR_R#R,((R
t1test_partial_falls_inside_message_delivery_statuss		(R&R'RRRRRRRRRRRRRRRRRRRRRRRRRRRR(((R
Rs8																									
				t
TestIteratorscBs#tZdZdZdZRS(NcCs|i}|i}|id}ti|}t
|}|t|d|t
i||i|id}ti|}t
|}|t|dtd}z |t
i||iWd|iXdS(Ns
msg_01.txtis
msg_02.txti+s
msg_19.txt(RR+R,RRgR%R#RTtbody_line_iteratortitRRuR=tEMPTYSTRINGRRARRRaR$(RRRuRR#R,Rg((R
ttest_body_line_iterators 		 cCs|i}|id}ti|d}g}d}x+|D]#}|d7}|i|iq=W||d|t
i|ddS(Ns
msg_04.txtRbiiis`a simple kind of mirror
to reflect upon our own
a simple kind of mirror
to reflect upon our own
(RR+R,R%R#RTttyped_subpart_iteratorRRutsubpartsRERRARR(RRERuRRR#R,((R
ttest_typed_subpart_iterator	s	

cCs|i}|id}ti|dd}g}d}x+|D]#}|d7}|i|iq@W||d|t
i|ddS(Ns
msg_03.txtRbRiis%
Hi,

Do you like this message?

-Me
(RR+R,R%R#RTRRRuRRERRARR(RRERuRRR#R,((R
t(test_typed_subpart_iterator_default_type$	s	

(R&R'RRR	(((R
Rs		tTestParserscBsbtZdZdZdZdZdZdZdZdZ	d	Z
d
ZRS(NcCs|i}td}zti|}Wd|iX||dd||dd||i	d|i
|i|it
|itdS(Ns
msg_02.txtRlsppp-request@zzz.orgRksppp@zzz.orgsmultipart/mixed(RR+R,RRtHeaderParsertparseR#R$R5RR#RpRaRAR(RRR#R,((R
ttest_header_parser:	s	cCsQ|i}tid}||dd||dd||iddS(NsFrom: aperson@dom.ain
To: bperson@dom.ain
Subject: the next line has a space on it
 
Date: Mon, 8 Apr 2002 15:09:19 -0400
Message-ID: spam

Here's the message body
R~s!the next line has a space on it
 s
message-idtspamsHere's the message body
(RR+R,R!RyR#RA(RR#R,((R
ttest_whitespace_continuationH	s
	
cCsQ|i}tid}||dd||dd||iddS(NsFrom: aperson@dom.ain
To: bperson@dom.ain
Date: Mon, 8 Apr 2002 15:09:19 -0400
Message-ID: spam
Subject: the next line has a space on it
 

Here's the message body
R~s!the next line has a space on it
 s
message-idRsHere's the message body
(RR+R,R!RyR#RA(RR#R,((R
t(test_whitespace_continuation_last_headerZ	s
	
cCs|i}tddd}zti|}Wd|iX|t	|i
d|i
d}||id||i
d|i
d}||id	dS(
Ns
msg_26.txtRR
iis
text/plains!Simple email with attachment.

isapplication/riscos(RR+R,RRRBRR#R$R=RAtpart1R5tpart2(RRRRR#R,((R
ttest_crlf_separationl	s	c	Cs|i}|i}td}zti|}Wd|i
X||id|t|i
d|i
d}||id||id|t|i
d|i
d}||id||id||i
d|i
d}||id||id|t|i
d|i
d}||id||id||i
ddS(	Ns
msg_28.txtiiismessage/rfc822s
text/plains
message 1
s
message 2
(RR+R,RRgRRR!R"R#R$R#R=RARR5tpart1aRtpart2a(	RRRRRR#RR,Rg((R
t-test_multipart_digest_with_extra_mime_headersz	s2		cCs?dddg}titi|}|i|dddS(Ns$From: Andrew Person <aperson@dom.ains
Subject: Tests%Date: Tue, 20 Aug 2002 16:43:45 +1000tdatesTue, 20 Aug 2002 16:43:45 +1000(RuR!RyRRR#RR+(RR#Ru((R
ttest_three_lines	scCsd|i}d}d}d||f}ti|}||i	d|||i	d|dS(NRbs	more texts'Header: %s
Next-Header: %s

Body

RsNext-Header(
RR+R,tvalue1tvalue2RR!RyR#tget(RRRRR#R,((R
t3test_strip_line_feed_and_carriage_return_in_headers	s	cCsz|i}d}ti|}|t|id|i}|i	||dddg||i
ddS(Ns(>From: foo
From: bar
!"#QUX;~: zoo

bodyis!"#QUX;~s>FromRitbody(RR+R,RR!RyR#R=RRRA(RRRR#R,((R
ttest_rfc2822_header_syntax	s	
cCs;|i}d}ti|}|t|iddS(Ns<>From foo@example.com 11:25:53
From: bar
!"#QUX;~: zoo

bodyi(	RR+R,RR!RyR#R=R(RRR#R,((R
t(test_rfc2822_space_not_allowed_in_header	s	cCsa|i}d}ti|}|i}|i	||dddg||i
ddS(Ns7A: first header
B: second header
CC: third header

bodytAtBtCCR(RR+R,RR!RyR#RtheadersRRA(RRR#R#R,((R
t!test_rfc2822_one_character_header	s	
(R&R'R
RRRRRRRRR$(((R
R
9	s					"			
	t
TestBase64cBs,tZdZdZdZdZRS(NcCs|i}|tidttidddxtdD]}|djo
d}nc|djo
d}nL|djo
d	}n5|d
jo
d}n|djo
d}nd
}|tid||qAWdS(NRteolRiiiiiii	iiiR(
RR+R,Rt
base64_lenR=RRtsizetbsize(RR)R,R(((R
ttest_len	s"	










cCsk|i}|tidd|tidd|tiddd|tiddddS(NRsaGVsbG8=RtXsaGVsbG8NCndvcmxk
thelloXworld(RR+R,RRT(RR,((R
ttest_decode	s
	cCs|i}|tidd|tidd|tidd|tiddd|tidd	d
dd|tidd	d
dd
dddS(NRRs	aGVsbG8=
shello
s	aGVsbG8K
is
aGVsbG8NCg==
sxxxx iRi(seHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IA==
R&s
seHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg
eHh4eCB4eHh4IA==
(RR+R,RR(RR,((R
ttest_encode	s	cCs|i}ti}||dd||dd||dddd||ddtd	||d
ddd
d||d
ddd
ddddS(NRs=?iso-8859-1?b?aGVsbG8=?=shello
worlds!=?iso-8859-1?b?aGVsbG8NCndvcmxk?=R/s
iso-8859-2s=?iso-8859-2?b?aGVsbG8=?=t	keep_eolss!=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=sxxxx iRi(s=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?=
 =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?=
 =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?=
 =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?=
 =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?=
 =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=R&s
s=?iso-8859-1?b?eHh4eCB4eHh4IHh4eHggeHg=?=
 =?iso-8859-1?b?eHggeHh4eCB4eHh4IHh4eHg=?=
 =?iso-8859-1?b?IHh4eHggeHh4eCB4eHh4IHg=?=
 =?iso-8859-1?b?eHh4IHh4eHggeHh4eCB4eHg=?=
 =?iso-8859-1?b?eCB4eHh4IHh4eHggeHh4eCA=?=
 =?iso-8859-1?b?eHh4eCB4eHh4IHh4eHgg?=(RR+R,Rt
header_encodetheRU(RR,R1((R
ttest_header_encode	s		(R&R'R*R-R.R2(((R
R%	s	
		t
TestQuopricBsYtZdZdZdZdZdZdZdZdZ	d	Z
RS(
NcCsg}ttdtddD]}|t|q$~g}ttdtddD]}|t|qa~g}ttdtddD]}|t|q~dd	d
ddd
g|_g}tdD]-}t||ijo|t|qq~|_g}ttd
tddD]}|t|qC~dg|_|ii	dg}tdD]-}t||ijo|t|qq~|_
dS(NRtziR tZt0t9t!t*R*R)t/Rit~s	t=(R@RtordRtchrRthlitthnontblittremovetbnon(RR@R((R
R
sJJcCsXx'|iD]}|iti|q
Wx'|iD]}|iti|q4WdS(N(RR?tcRRtheader_quopri_checkR@Rp(RRD((R
ttest_header_quopri_check
s

cCsXx'|iD]}|iti|q
Wx'|iD]}|iti|q4WdS(N(RRARDRRtbody_quopri_checkRCRp(RRD((R
ttest_body_quopri_check%
s

c
Cs|i}ti}ti}x=d	D]5}|||t	||dddddq"Wx$|i
D]}|||dqeWx$|iD]}|||dqWdS(
NRs
h@e@l@l@o@R/RR&iii(shellos
h@e@l@l@o@(
RR+R,Rtheader_quopri_lenthqlR0tencRcR=R?RDR@(RRDRKRcRJR,((R
ttest_header_quopri_len+
s			3

cCsd|i}ti}x$|iD]}|||dqWx$|iD]}|||dqCWdS(Nii(	RR+R,Rtbody_quopri_lentbqlRARDRC(RRDR,RN((R
ttest_body_quopri_len7
s		

cCsIxBtdD]4}t|}|ititi||q
WdS(Ni(	RRR>RDRR+RRtquote(RRDR((R
ttest_quote_unquote_idempotent?
s
cCs|i}ti}||dd||dd||dddd||ddtd	||d
d||dd
ddd||dd
ddddddS(NRs=?iso-8859-1?q?hello?=shello
worlds!=?iso-8859-1?q?hello=0D=0Aworld?=R/s
iso-8859-2s=?iso-8859-2?q?hello?=R/s=?iso-8859-1?q?hello=0Aworld?=shellotheres=?iso-8859-1?q?hello=C7there?=sxxxx iRi(s=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?=
 =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?=
 =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?=
 =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?=
 =?iso-8859-1?q?x_xxxx_xxxx_?=R&s
s=?iso-8859-1?q?xxxx_xxxx_xxxx_xxxx_xx?=
 =?iso-8859-1?q?xx_xxxx_xxxx_xxxx_xxxx?=
 =?iso-8859-1?q?_xxxx_xxxx_xxxx_xxxx_x?=
 =?iso-8859-1?q?xxx_xxxx_xxxx_xxxx_xxx?=
 =?iso-8859-1?q?x_xxxx_xxxx_?=(RR+R,RR0R1RU(RR,R1((R
R2D
s		cCsk|i}|tidd|tidd|tiddd|tiddddS(NRRR+shello
worldR,(RR+R,RRT(RR,((R
R-^
s
	cCs|i}|tidd|tidd|tidd|tiddd|tidddd	d
|tidddd	ddd
|tidddS(NRRshello
worldshello
worldisxxxx iRi(sjxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=
 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=
x xxxx xxxx xxxx xxxx=20R&s
slxxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=
 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=
x xxxx xxxx xxxx xxxx=20sone line

two line(RR+R,RR(RR,((R
R.e
s	(R&R'RRFRHRLRORQR2R-R.(((R
R3
s								tTestCharsetcBs#tZdZdZdZRS(NcCs5dkl}y|id=Wntj
onXdS(N(sCharsettfake(R!R3t
CharsetModuletCHARSETSR(RRT((R
ttearDown
s

cCso|i}td}d}|i|}|||i|d}|i|}|||i|dS(Nsus-asciisHello World!s
(	RR+R,R3RDRct
to_splittabletsptfrom_splittable(RRDRXRcR,((R
ttest_idempotent
s	cCs
|i}td}|d|idtd}|d|idtd}|d|idtd}y3|d	|id
|d
|id
tWntj
onXdkl}|i
d|idtd}|d|iddS(
Ns
iso-8859-1s
hello w=F6rldshello wrldsutf-8saGVsbG8gd29ybGQ=
shello worldsus-asciiseuc-jps$B5FCO;~IW(Bsϻ(sCharsetRS(
RR+R,R3RDtbody_encodeRtLookupErrorR!RTtadd_charsettQPR2(RRDRTR,((R
ttest_body_encode
s&	
(R&R'RVRZR_(((R
RR
s		t
TestHeadercBstZdZdZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZRS(NcCsL|i}td}||id|id||iddS(NsHello World!s Goodbye World!sHello World!  Goodbye World!(RRR,RRRR(RRR,((R
ttest_simple
s
	
cCsL|i}td}||id|id||iddS(NsHello World!sGoodbye World!sHello World! Goodbye World!(RRR,RRRR(RRR,((R
ttest_simple_surprise
s
	
cCs)d}|it||dfgdS(Nsno decoding needed(RRR+RoR2(RR((R
ttest_header_needs_no_decoding
scCsUtddd}x<|iddidD]}|it|djq.WdS(NsI am the very model of a modern Major-General; I've information vegetable, animal, and mineral; I know the kings of England, and I quote the fights historical from Marathon to Waterloo, in order categorical; I'm very well acquainted, too, with matters mathematical; I understand equations, both the simple and quadratical; about binomial theorem I'm teeming with a lot o' news, with many cheerful facts about the square of the hypotenuse.RiLt
splitcharsRs
 (RRRRttlRRpR=(RRRe((R
t	test_long
s
cCs|i}
td}td}td}d}d}di	d}t||}	|	i
|||	i
|||	i	}|
|d|
t||df|df|dfgt|	}|
|i	ddtt|}|
||dS(	Ns
iso-8859-1s
iso-8859-2sutf-8sDie Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an sdlndischen Wandgemlden vorbei, gegen die rotierenden Klingen befrdert. s;Finanni metropole se hroutily pod tlakem jejich dvtipu.. u正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.」と言っています。s=?iso-8859-1?q?Die_Mieter_treten_hier_ein_werden_mit_einem_Foerderband_ko?=
 =?iso-8859-1?q?mfortabel_den_Korridor_entlang=2C_an_s=FCdl=FCndischen_Wan?=
 =?iso-8859-1?q?dgem=E4lden_vorbei=2C_gegen_die_rotierenden_Klingen_bef=F6?=
 =?iso-8859-1?q?rdert=2E_?= =?iso-8859-2?q?Finan=E8ni_metropole_se_hroutily?=
 =?iso-8859-2?q?_pod_tlakem_jejich_d=F9vtipu=2E=2E_?= =?utf-8?b?5q2j56K6?=
 =?utf-8?b?44Gr6KiA44GG44Go57+76Kiz44Gv44GV44KM44Gm44GE44G+44Gb44KT44CC?=
 =?utf-8?b?5LiA6YOo44Gv44OJ44Kk44OE6Kqe44Gn44GZ44GM44CB44GC44Go44Gv44Gn?=
 =?utf-8?b?44Gf44KJ44KB44Gn44GZ44CC5a6f6Zqb44Gr44Gv44CMV2VubiBpc3QgZGFz?=
 =?utf-8?q?_Nunstuck_git_und_Slotermeyer=3F_Ja!_Beiherhund_das_Oder_die_Fl?=
 =?utf-8?b?aXBwZXJ3YWxkdCBnZXJzcHV0LuOAjeOBqOiogOOBo+OBpuOBhOOBvuOBmQ==?=
 =?utf-8?b?44CC?=sDie Mieter treten hier ein werden mit einem Foerderband komfortabel den Korridor entlang, an südlündischen Wandgemälden vorbei, gegen die rotierenden Klingen befördert. Finančni metropole se hroutily pod tlakem jejich důvtipu.. 正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.」と言っています。(RRR,R3ReRRRRRRRRRRKRoRstustrRqtnewh(RRhRRgReRRRRKRR,R((R
ttest_multilingual
s(	"cCsF|i}t}||d|idtd||ddS(NRRYs
iso-8859-1s=?iso-8859-1?q?foo?=(RRR,RRRR3(RRR,((R
ttest_header_ctor_default_argss
		
cCs|i}d}t|}||idt|dd}||idt|dddd}||i|dS(Ns|A very long line that must get split to something other than at the 76th character boundary to test the non-default behaviors}A very long line that must get split to something other than at the 76th
 character boundary to test the non-default behaviorRRs}A very long line that must get split to something other than at the
 76th character boundary to test the non-default behaviorRi(RRR,RRRR(RRR,R((R
ttest_explicit_maxlinelens	cCsN|i}d}t|}||dgt|}|||i	dS(NR(shelloN(
RR+R,RcRoRR2RqRR(RRRcRR,((R
ttest_us_ascii_headers	cCs3|i}t}|idd||ddS(NRs
iso-8859-1s=?iso-8859-1?q?hello?=(RR+R,RRR(RRR,((R
ttest_string_charsets		cCsQ|i}tdd}||idtdd}||iddS(Nupöstalsutf-8s=?utf-8?q?p=C3=B6stal?=u菊地時夫s=?utf-8?b?6I+K5Zyw5pmC5aSr?=(RR+R,RRR(RRR,((R
ttest_utf8_shortest,s
	cCs|i}|i}d}|tt|t}|t|i	||t
t|dd||i	|dd|t
||dS(Ns0Ynwp4dUEbay Auction Semiar- No Charge  Earn Bigterrorstreplace(RRPR<R+R,RtUnicodeErrorRRRR(RRR<RR,((R
ttest_bad_8bit_header3s			cCsq|i}t}|idd|id|i}||dtt	|}||i|dS(NRs
iso-8859-1tworlds=?iso-8859-1?q?hello?= world(
RR+R,RRRRRcRqRo(RRcRR,((R
t test_encoded_adjacent_nonencoded>s		

cCsT|i}d}t|}||ddd	gt|}||i	ddS(
NsGSubject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztk=?= =?koi8-r?q?=CA?= zz.sSubject:s  skoi8-rszz.s6Subject: =?koi8-r?b?8NLP18XSy8EgzsEgxsnOwczYztnK?= zz.(sSubject:N(s  skoi8-r(szz.N(
RR+R,RcRotpartsR2RqthdrR(RRvRcRuR,((R
ttest_whitespace_eaterHs	cCs&|i}d}|tit|dS(NsXSubject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3IQ?=(RRPR<RcRQRRRo(RRcR<((R
ttest_broken_base64_headerQs	(R&R'RaRbRcRfRiRjRkRlRmRnRrRtRwRx(((R
R`
s					1							
		tTestRFC2231cBsYtZdZdZdZdZdZdZdZdZ	d	Z
RS(
NcCsN|i}|id}||idd||iddtd	dS(
Ns
msg_29.txtttitlesus-asciitens%This is even more ***fun*** isn't it!Rs'"This is even more ***fun*** isn't it!"(sus-asciiR{s%This is even more ***fun*** isn't it!(sus-asciiR{s'"This is even more ***fun*** isn't it!"(RR+R,R%R#R6R(RR#R,((R
RZs	cCs|i}t}|idddd||idd
|idddddd||idd|id}|idddddd||id	dS(NRzs%This is even more ***fun*** isn't it!R/sus-asciiRtlanguageR{s
msg_01.txts$Return-Path: <bbb@zzz.org>
Delivered-To: bbb@zzz.org
Received: by mail.zzz.org (Postfix, from userid 889)
	id 27CEAD38CC; Fri,  4 May 2001 14:05:44 -0400 (EDT)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
From: bbb@ddd.com (John X. Doe)
To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset=us-ascii;
	title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"


Hi,

Do you like this message?

-Me
(sus-asciiRs%This is even more ***fun*** isn't it!(sus-asciisens%This is even more ***fun*** isn't it!(	RR+R,R0R#RR6R%Rr(RR#R,((R
Rbs		
cCsz|i}|id}|idddddd|idd	dddd|idd
d||iddS(
Ns
msg_01.txtRYRR/sus-asciiR|R{Rzs%This is even more ***fun*** isn't it!RMsContent-Types&Return-Path: <bbb@zzz.org>
Delivered-To: bbb@zzz.org
Received: by mail.zzz.org (Postfix, from userid 889)
	id 27CEAD38CC; Fri,  4 May 2001 14:05:44 -0400 (EDT)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Message-ID: <15090.61304.110929.45684@aaa.zzz.org>
From: bbb@ddd.com (John X. Doe)
To: bbb@zzz.org
Subject: This is a test message
Date: Fri, 4 May 2001 14:05:44 -0400
Content-Type: text/plain; charset="us-ascii";
	title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"


Hi,

Do you like this message?

-Me
(RRR,R%R#RRRr(RR#R,((R
Rs	cCs/|i}|id}||iddS(Ns
msg_32.txtsus-ascii(RR+R,R%R#tget_content_charset(RR#R,((R
t test_rfc2231_get_content_charsets	cCs2d}ti|}|i|idddS(NsContent-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm"
Content-Type: text/html; NAME*0=file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEM; NAME*1=P_nsmail.htm

tNAMEsMfile____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm(NNsMfile____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm(RR!RyR#RR+R6R2(RR#R((R
t#test_rfc2231_no_language_or_charsetscCs/d}ti|}|i|iddS(NsContent-Disposition: inline;
	filename*0="This%20is%20even%20more%20";
	filename*1="%2A%2A%2Afun%2A%2A%2A%20";
	filename*2="is it not.pdf"

s)This is even more ***fun*** is it not.pdf(RR!RyR#RR+RC(RR#R((R
t/test_rfc2231_no_language_or_charset_in_filenamescCs/d}ti|}|i|iddS(NsContent-Type: multipart/alternative;
	boundary*0="This%20is%20even%20more%20";
	boundary*1="%2A%2A%2Afun%2A%2A%2A%20";
	boundary*2="is it not.pdf"

s)This is even more ***fun*** is it not.pdf(RR!RyR#RR+RI(RR#R((R
t/test_rfc2231_no_language_or_charset_in_boundaryscCs/d}ti|}|i|iddS(NsContent-Type: text/plain;
	charset*0="This%20is%20even%20more%20";
	charset*1="%2A%2A%2Afun%2A%2A%2A%20";
	charset*2="is it not.pdf"

s)this is even more ***fun*** is it not.pdf(RR!RyR#RR+R}(RR#R((R
t.test_rfc2231_no_language_or_charset_in_charsetscCs/d}ti|}|i|iddS(Ns_Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename*0=X-UNKNOWN''myfile.txt

s
myfile.txt(RR!RyR#RR+RC(RR#R((R
ttest_rfc2231_unknown_encodings(R&R'RRRR~RRRRR(((R
RyYs		%						
cCsOtit}g}t|D]*}|ido|t||qq~S(NR(	R\tmodulesR&tmodR@tdirRRvtgetattr(R@RR((R
t_testclassess
cCs:ti}x'tD]}|iti|qW|S(N(tunittestt	TestSuitetsuiteRt	testclasstaddTestt	makeSuite(RR((R
Rs

cCs"xtD]}t|q
WdS(N(RRtrun_unittest(R((R
t	test_mains
t__main__tdefaultTestR(QRR\R2RRRtwarningst	cStringIORR!t
email.CharsetR3temail.HeaderRRoRqtemail.ParserRBRtemail.GeneratorRRdt
email.MessageR0temail.MIMEAudioR
temail.MIMETextRtemail.MIMEImageRtemail.MIMEBaseR,temail.MIMEMessageR|temail.MIMEMultipartRRRQRRTRRttest.test_supportR Rt
email.testt__file__R	RRRtfilterwarningstDeprecationWarningR&RtTestCaseRR(RRRR	RR R&R\RnRyRRRR
R%R3RRR`RyRRRtmain(=RQRyRRqRR3RRRRRRRR\RRR R	RRR,RTR`RR(RRR R!RRRR
RRoRR\RRRRR%R3RRdR|R
RRRRBRRRR&RyR2R	RR0RRn((R
t?s~							
	














B"1+|g#;3;Ho5			


Anon7 - 2021