m &UIc@sdkZdkZdkZdkZdkZdkZdkZdklZdk Z dk l Z dk l Z lZlZdklZlZdklZlZdklZdklZdklZd klZd klZd k 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_headers make_header(sParsers HeaderParser(s GeneratorsDecodedGenerator(sMessage(s MIMEAudio(sMIMEText(s MIMEImage(sMIMEBase(s MIMEMessage(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((t2/data/zmath/lib/python2.4/email/test/test_email.pytopenfile/s$t TestEmailBasecBstZdZdZRS(NcCs||jont|}t|}ti|i|i}t }|t It i |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 Z d Z 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.txttccs ccc@zzz.orgs ddd@zzz.orgs eee@zzz.orgtxxsn/a(Rt assertEqualteqR%R#tget_all(RR#R,((R t test_get_allMs cCsL|i}t}||idtd}|i |||dd||i d||dd||i dd||dd ||ii d|i d||id||ddt}d |d ((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]t get_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 t i |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-encodingRTs hello worldtfoo(s x-uuencodeRWRXsx-uue( RR+R,R0R#R:tcteRARU(RR,RZR#((R ttest_get_decoded_uu_payloads     cCstt}|idd|dContent-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 ||id ddddS( 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&&Jill" RsJim&&Jilltunquotes"Jim&&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 d d ||idd d d dS(NR/s iso-2022-jpt importances high valueRs "high value"s text/plainRs "iso-2022-jp"s iso-9999-xxRMsX-Jimmy(s text/plainR(scharsets iso-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||id d g|i d|||id dd|fgdS(Ns msg_05.txtsmultipart/reportRs report-typesdelivery-statusRs%D1690A7AC1.996856090/mail.example.com(smultipart/reportR(s report-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 d dS( NtFirsttOnetSecondtTwotThirdtThreetTwentytElevens One HundredtFourthtMissing( RR+R,R0R#Rtkeystvaluestreplace_headerRPtKeyError(RR#R,((R ttest_replace_headers  cCsPd}t}d|dt 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 ; 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 ; 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 ; 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 ; 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 ; 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 ; 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 sReply-TosrReply-To: Britische Regierung gibt grnes Licht fr Offshore-Windkraftprojekte (RRR,R0R#Rr(RR#R,((R t test_long_8bit_header_no_charsets     cCs<|i}d}t}||d<||idddS(Ns"Someone Test #A" ,,"Someone Test #B" , "Someone Test #C" , "Someone Test #D" RnisTo: "Someone Test #A" , , "Someone Test #B" , "Someone Test #C" , "Someone Test #D" (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, tListRsQList: List-Unsubscribe: , List: List-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(Ns aaa@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 tdatadirR R RRaRt _audiodataR$t MIMEAudiot_au(RRR ((R R~s$ cCs|i|iiddS(Ns audio/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(Ns hello 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(Ns hello there(RR+R!RARpt is_multipart(R((R t test_payloadscCsF|i}tddd}||iid||dddS(Ns hello 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 Z d Z d Z d ZdZdZdZdZdZRS(Nc CsZtd}z|i}Wd|iXtdddd}t|dd} | i dd d dt d }|i ||i | d |d Ris)Dingus Lovers 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 ----961284236552522269-- (RR%R#R+Rr(RR#((R ttest_boundary_in_non_multipart<s cCs[|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 dt i |t|i dt i 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 i dS(Ns msg_42.txtii( RR%RERAtbadR+R=R^RpRaRQRb(RRERl((R ttest_missing_start_boundarys  ( R&R'R]RcRfRhRiRjRkRm(((R R\os    t TestRFC2047cBs#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 rksmrgss mac-icelands baz foo barsVRe: =?mac-iceland?q?r=8Aksm=9Arg=8Cs?= baz foo bar =?mac-iceland?q?r=8Aksm=9Arg=8Cs?=(sRe:N(s rksmrgss mac-iceland(s baz foo barN(s rksmrgss mac-iceland( RR+R,Rct decode_headertdhR2Rt make_header(RRpRcR,((R ttest_rfc2047_multilines   cCsZ|i}d}t|}||ddgtt|i d}||ddS( Ns0=?ISO-8859-1?Q?Andr=E9?= Pirard sAndrs iso-8859-1sPirard slatin-1sAndr Pirard (sAndrs iso-8859-1(sPirard N( RR+R,RcRoRpR2tunicodeRqRthu(RRpRtRcR,((R ttest_whitespace_eater_unicodes   cCsW|i}d}t|}||dd d d gt|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 Z d Z d Z d ZRS(NcCs1td}z|i|_Wd|iXdS(Ns msg_11.txt(RRRaRt_textR$(RR((R Rs  cCs|ittddS(Nsa plain string(RRPt TypeErrort MIMEMessage(R((R ttest_type_errorscCs|i}|i}d}t}||d Date: Sun, 23 Sep 2001 20:10:55 -0700 From: "Ian T. Henry" To: SoCal Raves 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|ds c Cs#|i}|tidd dS( Ns5 Feb 2003 13:47:26 -0800iiii i/iiiii( iiii i/iiiii(RR+R,RR(RR,((R t#test_parsedate_compact_no_dayofweekCs cCs|i}tid}tti|}|ti |d |d |tti d|dti d}tti|d }|ti |d |d |tti d|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 (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" 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" (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 s"John X. Doe" s John X. Doesjxd@example.com(s John X. Doesjxd@example.com( RtyRRRR+RRR(RRRRR((R ttest_name_with_dotls  cCs|itidddS(NsA Silly; Personsperson@dom.ains""A Silly; Person" (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,t failIfEqualtneR3tcset1tcset2(RRRRR,((R ttest_charset_richcomparisonss$                 cCs/|i}|tiddgddgdS( Nsaperson@dom.ain (Al Person)sBud Person 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 d g|tiddgd d gdS(Nsfoo: ;Rs []*-- =~$s*--s#"Jason R. Mastaler" 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  cCs4|i}tidg}||ddddS(s(Test proper handling of a nested comments%User ((nested comment)) iis foo@bar.comN(RR+R,RRtaddrs(RR,R((R t"test_getaddresses_embedded_comments 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|i dd |||i d ||i d t d||d dt}d |d<|i}|t|d||ddt|d}||i ti|i dd |||i d||d ddS(Nstext/plain; charset=UTF-8s Content-Types content-typeiisutf-8Rs hello 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'RRRRRRRRRRRRRRRRRRRRRRRRRRRRR(((R Rs:                       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=t EMPTYSTRINGRRARRRaR$(RRRuRR#R,Rg((R ttest_body_line_iterator s       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(RRERuRR R#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#RTRRRuR RERRARR(RRERuRR R#R,((R t(test_typed_subpart_iterator_default_type* s   (R&R'RR R (((R R s  t TestParserscBsbtZdZdZdZdZdZdZdZdZ d Z d Z RS( NcCs|i}td}zti|}Wd|iX||dd||dd||i d|i |i |i t |itdS(Ns msg_02.txtRlsppp-request@zzz.orgRks ppp@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_continuationN 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_header` 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,RRRBRR#R$R=RAtpart1R5tpart2(RRRRR#R,((R ttest_crlf_separationr s  c Cs|i}|i}td}zti|}Wd|i X||i d|t |i d|i d}||id||i d|t |i d|i d}||i d||id||i d|i d}||id||i d|t |i d|i d}||i d||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_headers s2    cCs?dddg}titi|}|i|dddS(Ns$From: Andrew Person 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'RRRRRRRR R!R&(((R R ? s     "  t TestBase64cBs,tZdZdZdZdZRS(NcCs|i}|tidttidddxtdD]}|djo d}nc|djo d}nL|djo d }n5|d jo d }n|d jo 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 t helloXworld(RR+R,RRT(RR,((R t test_decode s  cCs|i}|tidd|tidd|tidd|tiddd|tidd d d d |tidd d d d 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 t test_encode s cCs|i}ti}||dd||dd||dddd||ddtd ||d d d d d||d d d d ddddS(NRs=?iso-8859-1?b?aGVsbG8=?=s hello 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,R3((R ttest_header_encode s  (R&R'R,R/R0R4(((R R' s  t TestQuopricBsYtZdZdZdZdZdZdZdZdZ d Z RS( NcCsg}ttdtddD]}|t|q$~g}ttdtddD]}|t|qa~g}ttdtddD]}|t|q~dd d d d d g|_g}tdD]-}t||ijo|t|qq~|_t|it|idjpt g}ttd tddD]}|t|qm~dg|_ |i i dg}tdD]-}t||i jo|t|qq~|_ t|i t|i djpt dS(NRtziR"tZt0t9t!t*R*R)t/Rit~s t=( R@RtordRtchrRthlitthnonR=tAssertionErrortblittremovetbnon(RR@R((R R sJ*JJcCsXx'|iD]}|iti|q Wx'|iD]}|iti|q4WdS(N(RRAtcRRtheader_quopri_checkRBRp(RRG((R ttest_header_quopri_check% s   cCsXx'|iD]}|iti|q Wx'|iD]}|iti|q4WdS(N(RRDRGRRtbody_quopri_checkRFRp(RRG((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_lenthqlR2tencRcR=RARGRB(RRGRNRcRMR,((R ttest_header_quopri_len1 s   3  cCsd|i}ti}x$|iD]}|||dqWx$|iD]}|||dqCWdS(Nii( RR+R,Rtbody_quopri_lentbqlRDRGRF(RRGR,RQ((R ttest_body_quopri_len= s    cCsIxBtdD]4}t|}|ititi||q WdS(Ni( RRR@RGRR+RRtquote(RRGR((R ttest_quote_unquote_idempotentE s  cCs|i}ti}||dd||dd||dddd||ddtd ||d d ||d d ddd||d d ddddddS(NRs=?iso-8859-1?q?hello?=s hello worlds!=?iso-8859-1?q?hello=0D=0Aworld?=R/s iso-8859-2s=?iso-8859-2?q?hello?=R1s=?iso-8859-1?q?hello=0Aworld?=s hellotheres=?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,RR2R3RU(RR,R3((R R4J s  cCsk|i}|tidd|tidd|tiddd|tiddddS(NRRR-s hello worldR.(RR+R,RRT(RR,((R R/d s  cCs|i}|tidd|tidd|tidd|tiddd|tidddd d |tidddd d d d |tidddS(NRRs hello worlds hello 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 R0k s ( R&R'RRIRKRORRRTR4R/R0(((R R5 s      t TestCharsetcBs#tZdZdZdZRS(NcCs5dkl}y|id=Wntj onXdS(N(sCharsettfake(R!R3t CharsetModuletCHARSETSR(RRW((R ttearDown s  cCso|i}td}d}|i|}|||i|d}|i|}|||i|dS(Nsus-asciis Hello World!s ( RR+R,R3RGRct to_splittabletsptfrom_splittable(RRGR[RcR,((R ttest_idempotent s  cCs |i}td}|d|idtd}|d|idtd}|d|idtd}y3|d |id |d |id tWntj onXd kl}|i d |i dtd }|d|iddS( Ns iso-8859-1s hello w=F6rlds hello wrldsutf-8saGVsbG8gd29ybGQ= s hello worldsus-asciiseuc-jps$B5FCO;~IW(Bsϻ(sCharsetRV( RR+R,R3RGt body_encodeRt LookupErrorR!RWt add_charsettQPR2(RRGRWR,((R ttest_body_encode s&       (R&R'RYR]Rb(((R RU s  t TestHeadercBstZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZRS(NcCsL|i}td}||id|id||iddS(Ns Hello World!s Goodbye World!sHello World! Goodbye World!(RRR,RRRR(RRR,((R t test_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=(RRRh((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,R3ReRRRRRRRRRRNRoRstustrRqtnewh( RRkRRjReRRRRNRR,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_args s    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_maxlinelen s    cCsN|i}d}t|}||dgt|}|||i dS(NR(shelloN( RR+R,RcRoRR2RqRR(RRRcRR,((R ttest_us_ascii_header s    cCs3|i}t}|idd||ddS(NRs iso-8859-1s=?iso-8859-1?q?hello?=(RR+R,RRR(RRR,((R ttest_string_charset# s  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_shortest2 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_header9 s   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_nonencodedD 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(RRyRcRxR,((R ttest_whitespace_eaterN s    cCs&|i}d}|tit|dS(NsXSubject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3IQ?=(RRPR<RcRQRRRo(RRcR<((R ttest_broken_base64_headerW s (R&R'RdReRfRiRlRmRnRoRpRqRuRwRzR{(((R Rc s     1      t TestRFC2231cBstZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZRS(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 R` s  cCs|i}t}|idddd||idd |idddddd||idd |id}|idddddd||id dS( NR}s%This is even more ***fun*** isn't it!R/sus-asciiRtlanguageR~s msg_01.txts$Return-Path: 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 Rh s       cCsz|i}|id}|idddddd|idd dddd|idd d ||id dS( Ns msg_01.txtRYRR/sus-asciiRR~R}s%This is even more ***fun*** isn't it!RMs Content-Types&Return-Path: 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 R s   cCs/|i}|id}||iddS(Ns msg_32.txtsus-ascii(RR+R,R%R#tget_content_charset(RR#R,((R t test_rfc2231_get_content_charset s cCsNd}ti|}|id}|it|t |i |ddS(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( RR!RyR#R6tparamRRRattupleR+(RRRR#((R t#test_rfc2231_no_language_or_charset s  cCs/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_filename scCs/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 t7test_rfc2231_no_language_or_charset_in_filename_encoded scCs/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" s1This%20is%20even%20more%20***fun*** is it not.pdf(RR!RyR#RR+RC(RR#R((R ttest_rfc2231_partly_encoded scCs/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%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdf(RR!RyR#RR+RC(RR#R((R ttest_rfc2231_partly_nonencoded scCs/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_boundary scCs/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_charset scCs/d}ti|}|i|iddS(NsContent-Disposition: inline; filename*0*="bogus'xx'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_bad_encoding_in_filename scCs/d}ti|}|i|iddS(Ns:Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D (RR!RyR#RR+RR2(RR#R((R t$test_rfc2231_bad_encoding_in_charset scCs/d}ti|}|i|iddS(Ns:Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D (RR!RyR#RR+RR2(RR#R((R t%test_rfc2231_bad_character_in_charset scCs/d}ti|}|i|iddS(NsContent-Disposition: inline; filename*0*="ascii'xx'This%20is%20even%20more%20"; filename*1*="%2A%2A%2Afun%2A%2A%2A%20"; filename*2*="is it not.pdf%E2" u,This is even more ***fun*** is it not.pdf�(RR!RyR#RR+RC(RR#R((R t&test_rfc2231_bad_character_in_filename) scCs/d}ti|}|i|iddS(Ns^Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt s myfile.txt(RR!RyR#RR+RC(RR#R((R ttest_rfc2231_unknown_encoding5 scCsa|i}d}ti|}|id\}}}||d||d||ddS(NsJContent-Type: application/x-foo; name*0*="Frank's"; name*1*=" Document" RsFrank's Document( RR+R,RR!RyR#R6R/RRcR2(RRR/RRcR#R,((R t-test_rfc2231_single_tick_in_filename_extended> s   cCsNd}ti|}|id}|it|t |i |ddS(NsGContent-Type: application/x-foo; name*0="Frank's"; name*1=" Document" RsFrank's Document( RR!RyR#R6RRRRaRR+(RRRR#((R t$test_rfc2231_single_tick_in_filenameK s cCsa|i}d}ti|}|id\}}}||d||d||ddS(NsYContent-Type: application/x-foo; name*0*="us-ascii'en-us'Frank's"; name*1*=" Document" Rsus-asciisen-ussFrank's Document( RR+R,RR!RyR#R6R/RRc(RRR/RRcR#R,((R t!test_rfc2231_tick_attack_extendedU s   cCsNd}ti|}|id}|it|t |i |ddS(NsWContent-Type: application/x-foo; name*0="us-ascii'en-us'Frank's"; name*1=" Document" Rsus-ascii'en-us'Frank's Document( RR!RyR#R6RRRRaRR+(RRRR#((R ttest_rfc2231_tick_attackb s cCs8|i}d}ti|}||idddS(Ns:Content-Type: application/x-foo; name="Frank's Document" RsFrank's Document(RR+R,RR!RyR#R6(RR#RR,((R ttest_rfc2231_no_extended_valuesm s cCsa|i}d}ti|}|id\}}}||d||d||ddS(NsiContent-Type: application/x-foo; name*0*="us-ascii'en-us'My"; name*1=" Document"; name*2*=" For You" Rsus-asciisen-ussMy Document For You( RR+R,RR!RyR#R6R/RRc(RRR/RRcR#R,((R t,test_rfc2231_encoded_then_unencoded_segmentsv s   cCsa|i}d}ti|}|id\}}}||d||d||ddS(NsiContent-Type: application/x-foo; name*0="us-ascii'en-us'My"; name*1*=" Document"; name*2*=" For You" Rsus-asciisen-ussMy Document For You( RR+R,RR!RyR#R6R/RRc(RRR/RRcR#R,((R t,test_rfc2231_unencoded_then_encoded_segments s   (R&R'RRRRRRRRRRRRRRRRRRRRRRR(((R R|_ s.  %    cCsOtit}g}t|D]*}|ido|t||qq~S(NR( R\tmodulesR&tmodR@tdirRRvtgetattr(R@RR((R t _testclasses s cCs:ti}x'tD]}|iti|qW|S(N(tunittestt TestSuitetsuiteRt testclasstaddTestt makeSuite(RR((R R s   cCs"xtD]}t|q WdS(N(RRt run_unittest(R((R t test_main s t__main__t defaultTestR(QRR\R2RRRtwarningst cStringIORR!t email.CharsetR3t email.HeaderRRoRqt email.ParserRBR temail.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'R5RURcR|RRRtmain(=RQRyRRqRR3RRRRRRRR\RRR R RRR,RTRcRR(RRR R!RRRR RRoRR\R RRRR'R5RRdR|R RURRBRRRR&R|R2R RR0RRn((R t?s                         B"1+|g#;9;Ho58