kWc@sNddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl Z ddl mZddlmZmZmZddlmZmZddlmZmZddlmZdd lmZdd lmZdd lm Z dd l!m"Z"dd l#m$Z$ddl%m&Z&ddl m'Z'ddl m(Z(ddl m)Z)ddl m*Z*ddl m+Z+ddl m,Z,ddl-m.Z.m/Z/ddl0m1Z2dZ3dZ4dZ5ddZ6dej7fdYZ8de8fdYZ9d ej7fd!YZ:d"e8fd#YZ;d$ej7fd%YZ<d&ej7fd'YZ=d(ej7fd)YZ>d*ej7fd+YZ?d,e8fd-YZ@d.e8fd/YZAd0ej7fd1YZBd2e8fd3YZCd4e8fd5YZDd6e8fd7YZEd8e8fd9YZFd:e8fd;YZGd<e8fd=YZHd>ej7fd?YZId@ej7fdAYZJdBej7fdCYZKdDe8fdEYZLdFe8fdGYZMdHe8fdIYZNdJZOdKZPdLZQeRdMkrJejSdNdOndS(PiN(tStringIO(tchoice(tCharset(tHeadert decode_headert make_header(tParsert HeaderParser(t GeneratortDecodedGenerator(tMessage(t MIMEAudio(tMIMEText(t MIMEImage(tMIMEBase(t MIMEMessage(t MIMEMultipart(tUtils(tErrors(tEncoders(t Iterators(t base64MIME(t quopriMIME(tfindfilet run_unittest(t__file__s tt trcCs1tjjtjjtd|}t||S(Ntdata(tostpathtjointdirnametlandmarktopen(tfilenametmodeR((s+/usr/lib/python2.7/email/test/test_email.pytopenfile.s$t TestEmailBasecBseZdZdZRS(cCs}||kryt|}t|}tj|j|j}t}|tItj|IJ|j|jndS(s6Like assertEqual except use ndiff for readable output.N( tstrtdifflibtndifft splitlinesRtNLR tfailureExceptiontgetvalue(tselftfirsttsecondtsfirsttssecondtdifftfp((s+/usr/lib/python2.7/email/test/test_email.pytndiffAssertEqual6s    cCs7tt|}ztj|}Wd|jX|S(N(R&Rtemailtmessage_from_filetclose(R/R$R5tmsg((s+/usr/lib/python2.7/email/test/test_email.pyt_msgobj@s  (t__name__t __module__R6R;(((s+/usr/lib/python2.7/email/test/test_email.pyR'5s tTestMessageAPIcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!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.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;RS(:cCsT|j}|jd}||jddddg||jddddS(Ns msg_20.txttccs ccc@zzz.orgs ddd@zzz.orgs eee@zzz.orgtxxsn/a(t assertEqualR;tget_all(R/teqR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_get_allLs cCsL|j}t}||jdtd}|j|||dd||jd||dd||jdd||dd ||jjd|jd||jd||ddt}d |d s    cCs0t}d|d<|j|jdddS(Ns>Content-Type: Multipart/mixed; boundary = "CPIMSSMTPC06p5f3tG"s Content-TypetboundarytCPIMSSMTPC06p5f3tG(R RARJ(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_param_liberalNs  cCs|j}tjd}||jdddd||jdddd||jddtjd}||jdddd ||jdddd ||jd ddddS( Ns&X-Header: foo=one; bar=two; baz=three RRcsx-headerRtquuzs"X-Header: foo; bar="one"; baz=two RvRRR(RAR7RRJRG(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_paramSs   cCs5|jd}|j|jdjdddS(Ns msg_22.txtitnames wibble.JPG(R;RARTRJ(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt'test_get_param_funky_continuation_linesdscCsKtjd}|j|jdd|j|jddtddS(Ns4Content-Type: image/pjpeg; name="Jim&&Jill" RsJim&&Jilltunquotes"Jim&&Jill"(R7RRARJRl(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt#test_get_param_with_semis_in_quoteshs  cCsTtjd}|j|jddtjd}|j|jdddS(Ns5Content-Type: foo; bar*0="baz\"foobar"; bar*1="\"baz"Rsbaz"foobar"baz(R7RRARJ(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_param_with_quotesos   cCsktjd}|j|jd|j|jd|j|jd|j|jddS(NsHeader: existsRcRtHEADERtheaderi(R7RRthas_keyt assertFalse(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt test_has_keyws cCs|j}t}|jdd||jdd|jdd||jdd||jddtd||jd ddg||jdtdddg|jdd d d ||jdd d d dS(NREs iso-2022-jpt importances high valueRs "high value"s text/plainRs "iso-2022-jp"s iso-9999-xxRcsX-Jimmy(s text/plainR(scharsets iso-2022-jp(Rs high value(s text/plainR(scharsets "iso-2022-jp"(Rs "high value"(RAR t set_paramRJRlR(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_set_param~s    cCs|j}|jd}||jdd d g|jd}|jd||jd d g|jd|||jd 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(RAR;RRJt del_paramR(R/RCR:told_val((s+/usr/lib/python2.7/email/test/test_email.pyttest_del_params       cCsGt}|jdddd|jdd|j|dddS(NsContent-Dispositiont attachmentR$sbud.gifscontent-disposition(R t add_headerRRA(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_del_param_on_other_headers cCs|j}t}|jt|jd|jd||dd|jdd||dd|jd||dddS( NR~s text/plains content-typeREsus-asciistext/plain; charset="us-ascii"s text/htmlstext/html; charset="us-ascii"(RAR Rat ValueErrortset_typeR(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_set_types    cCs;t}d|d<|jdd|j|dddS(Ns text/plainsX-Content-Typesapplication/octet-streamsx-content-type(R RRA(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_set_type_on_other_headers  cCs#t}|j|jddS(Ns text/plain(R RARI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_content_type_missings cCs0t}|jd|j|jddS(Nsmessage/rfc822(R tset_default_typeRARI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt/test_get_content_type_missing_with_default_types  cCs2|jd}|j|jdjddS(Ns msg_30.txtismessage/rfc822(R;RARTRI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt+test_get_content_type_from_message_implicitscCs2|jd}|j|jdjddS(Ns msg_28.txtismessage/rfc822(R;RARTRI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt+test_get_content_type_from_message_explicitscCs)|jd}|j|jddS(Ns msg_03.txts text/plain(R;RARI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt6test_get_content_type_from_message_text_plain_implicitscCs)|jd}|j|jddS(Ns msg_01.txts text/plain(R;RARI(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt6test_get_content_type_from_message_text_plain_explicitscCs#t}|j|jddS(NR~(R RAtget_content_maintype(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt!test_get_content_maintype_missings cCs0t}|jd|j|jddS(Nsmessage/rfc822tmessage(R RRAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt3test_get_content_maintype_missing_with_default_types  cCs2|jd}|j|jdjddS(Ns msg_30.txtiR(R;RARTR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt/test_get_content_maintype_from_message_implicitscCs2|jd}|j|jdjddS(Ns msg_28.txtiR(R;RARTR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt/test_get_content_maintype_from_message_explicitscCs)|jd}|j|jddS(Ns msg_03.txtR~(R;RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt:test_get_content_maintype_from_message_text_plain_implicitscCs)|jd}|j|jddS(Ns msg_01.txtR~(R;RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt:test_get_content_maintype_from_message_text_plain_explicitscCs#t}|j|jddS(Ntplain(R RAtget_content_subtype(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt test_get_content_subtype_missings cCs0t}|jd|j|jddS(Nsmessage/rfc822trfc822(R RRAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt2test_get_content_subtype_missing_with_default_types  cCs2|jd}|j|jdjddS(Ns msg_30.txtiR(R;RARTR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt.test_get_content_subtype_from_message_implicitscCs2|jd}|j|jdjddS(Ns msg_28.txtiR(R;RARTR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt.test_get_content_subtype_from_message_explicitscCs)|jd}|j|jddS(Ns msg_03.txtR(R;RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt9test_get_content_subtype_from_message_text_plain_implicitscCs)|jd}|j|jddS(Ns msg_01.txtR(R;RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt9test_get_content_subtype_from_message_text_plain_explicitscCs-t}d|d<|j|jddS(Nsno-slash-in-this-strings Content-TypeR~(R RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_content_maintype_errors  cCs-t}d|d<|j|jddS(Nsno-slash-in-this-strings Content-TypeR(R RAR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_get_content_subtype_error s  cCs=|j}t}|jdd|jdd|jdd||jdddg||jdddg|jdd||jdddg||jdddg|jdd|jdd ||jddddg||jd dddg|jt|jd d dS( NtFirsttOnetSecondtTwotThirdtThreetTwentytElevens One HundredtFourthtMissing(RAR Rtkeystvaluestreplace_headerRatKeyError(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_replace_headers  cCsPd}t}d|dKst                                                t TestEncoderscBs#eZdZdZdZRS(cCs4|j}t}|jd||dddS(Nsus-asciiscontent-transfer-encodingt7bit(RAR RH(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_encode_empty_payload=s   cCsj|j}td}||ddtd}||ddtddd}||dddS( Ns hello worldscontent-transfer-encodingRs hello worldt8bitt_charsets iso-8859-1squoted-printable(RAR (R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_default_cteCs   cCs6|j}tjjddd}||dddS(NsʸRseuc-jpscontent-transfer-encodingR(RAR7R (R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_encode7or8bitOs (R<R=RRR(((s+/usr/lib/python2.7/email/test/test_email.pyR<s  tTestLongHeaderscBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZRS(cCsQ|j}tjd}t}t|}|j|||jddS(NsSubject: bug demonstration 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 more text test sSubject: bug demonstration 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 more text test (R6R7RRRRkR.(R/RCR:R|R((s+/usr/lib/python2.7/email/test/test_email.pyttest_split_long_continuationZs      cCsW|j}d}t|dd}||jdt|}||jddS(Nsbug demonstration 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 more texttcontinuation_wss sbug demonstration 12345678911234567892123456789312345678941234567895123456789612345678971234567898112345678911234567892123456789112345678911234567892123456789 more text(R6Rtencode(R/RCthstrth((s+/usr/lib/python2.7/email/test/test_email.pyt,test_another_long_almost_unsplittable_headerns    c Cs|j}td}td}td}d}d}djd}t||dd}|j|||j||t} || 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( R6R tSPACER trangeRNRRRkR.(R/RCR:tiR|R((s+/usr/lib/python2.7/email/test/test_email.pyttest_no_semis_header_splitters   0     cCs@|j}ddd}t|dd}||jddS(Ns References: RiPRs s\References: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(R6RR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_no_split_long_headers   cCs8|j}d}t|dd}||jddS(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)(R6RR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyt"test_splitting_multiple_long_liness   cCsD|j}d}t|dddddd}||jddS( 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(R6RR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyt&test_splitting_first_line_only_is_longs    cCsU|j}t}tdddd}|jd||d<||jddS(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?= (R6R RRRf(R/RCR:R((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_8bit_headers       cCs3|j}t}d|d<||jddS(NsfBritische Regierung gibt grnes Licht fr Offshore-Windkraftprojekte sReply-TosrReply-To: Britische Regierung gibt grnes Licht fr Offshore-Windkraftprojekte (R6R Rf(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_long_8bit_header_no_charsets     cCs<|j}d}t}||d<||jdddS(Ns"Someone Test #A" ,,"Someone Test #B" , "Someone Test #C" , "Someone Test #D" RisTo: "Someone Test #A" , , "Someone Test #B" , "Someone Test #C" , "Someone Test #D" (R6R Rf(R/RCRR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_to_header$s    cCs?|j}d}t|}|jd||jddS(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.(R6RRR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_line_after_append1s     cCs?|j}d}t|}|jd||jddS(NsThis is a shorter line.s!Add another sentence. (Surprise?)s9This is a shorter line. Add another sentence. (Surprise?)(R6RRR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_shorter_line_with_append:s     cCsA|j}d}d}t|dd|}||jddS(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_?=(R6RR(R/RCtfntgsR((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_field_nameBs   cCsId}t}t|dd|d<||d<|j|jddS(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 (R RRARf(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_received_headerNs   cCsOd}t}t|dddd|d<||d<|j|jddS(Ns<15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100")RRRs sReceived: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") Received: <15975.17901.207240.414604@sgigritzmann1.mathematik.tu-muenchen.de> (David Bremner's message of "Thu, 6 Mar 2003 13:58:21 +0100") (R RR6Rf(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_string_headerinst_eq]s   cCsO|j}t}d}||d, tListRsQList: List-Unsubscribe: , List: List-Unsubscribe: , (R6R RRf(R/RCRR:((s+/usr/lib/python2.7/email/test/test_email.pyt%test_long_lines_with_different_headers    (R<R=RRRRRRR R R RRRRRRRRRRRR (((s+/usr/lib/python2.7/email/test/test_email.pyRYs*   +          tTestFromManglingcBs,eZdZdZdZdZRS(cCs-t|_d|jd<|jjddS(Ns aaa@bbb.orgRs(From the desk of A.A.A.: Blah blah blah (R R:RN(R/((s+/usr/lib/python2.7/email/test/test_email.pytsetUps   cCsEt}t|dt}|j|j|j|jddS(Nt mangle_from_s<From: aaa@bbb.org >From the desk of A.A.A.: Blah blah blah (RRRjRkR:RAR.(R/RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_mangled_froms  cCsEt}t|dt}|j|j|j|jddS(NR#s;From: aaa@bbb.org From the desk of A.A.A.: Blah blah blah (RRRlRkR:RAR.(R/RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_dont_mangle_froms  cCst}t|dt}tjtjd}|j||jt g|j j dD]}|j dr_d^q_ddS(NR#s) From: foo@bar.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=XXX From somewhere unknown --XXX Content-Type: text/plain foo --XXX-- From somewhere unknowable s s>From ii( RRRjR7RttextwraptdedentRkRAtlenR.RR(R/RRR:R((s+/usr/lib/python2.7/email/test/test_email.pyt'test_mangle_from_in_preamble_and_epilogs    %(R<R=R"R$R%R)(((s+/usr/lib/python2.7/email/test/test_email.pyR!s  t TestMIMEAudiocBs5eZdZdZdZdZdZRS(cCsstjjtjjtdd}ttd|d}z|j|_Wd|j Xt |j|_ dS(NRRs audiotest.autrb( RRR R!R"R#RRht _audiodataR9R t_au(R/tdatadirR5((s+/usr/lib/python2.7/email/test/test_email.pyR"s $ cCs|j|jjddS(Ns audio/basic(RAR-RI(R/((s+/usr/lib/python2.7/email/test/test_email.pyttest_guess_minor_typescCs/|jj}|jtj||jdS(N(R-RTRARt decodestringR,(R/tpayload((s+/usr/lib/python2.7/email/test/test_email.pyt test_encodingscCs,t|jd}|j|jddS(Ntfishs audio/fish(R R,RARI(R/tau((s+/usr/lib/python2.7/email/test/test_email.pyttest_checkSetMinorscCs |j}|jjdddd||jdd||jjddd d g||jjddddg}||jjdddd|j|jjd d |dd||j|jjd |||j|jjd|dd |dS(NsContent-DispositionRR$s audiotest.auscontent-dispositions#attachment; filename="audiotest.au"RcRRvtfailobjtfoobar(s attachmentR(R$s audiotest.au(RAR-RRRJtassertIs(R/RCtmissing((s+/usr/lib/python2.7/email/test/test_email.pyttest_add_headers     (R<R=R"R/R2R5R:(((s+/usr/lib/python2.7/email/test/test_email.pyR*s     t TestMIMEImagecBs5eZdZdZdZdZdZRS(cCsCtd}z|j|_Wd|jXt|j|_dS(NsPyBanner048.gif(R&Rht_imgdataR9R t_im(R/R5((s+/usr/lib/python2.7/email/test/test_email.pyR"s   cCs|j|jjddS(Ns image/gif(RAR=RI(R/((s+/usr/lib/python2.7/email/test/test_email.pyR/ scCs/|jj}|jtj||jdS(N(R=RTRARR0R<(R/R1((s+/usr/lib/python2.7/email/test/test_email.pyR2scCs,t|jd}|j|jddS(NR3s image/fish(R R<RARI(R/tim((s+/usr/lib/python2.7/email/test/test_email.pyR5scCs |j}|jjdddd||jdd||jjddd d g||jjddddg}||jjdddd|j|jjd d |dd||j|jjd |||j|jjd|dd |dS(NsContent-DispositionRR$sdingusfish.gifscontent-dispositions%attachment; filename="dingusfish.gif"RcRRvR6R7(s attachmentR(R$sdingusfish.gif(RAR=RRRJR8(R/RCR9((s+/usr/lib/python2.7/email/test/test_email.pyR:s     (R<R=R"R/R2R5R:(((s+/usr/lib/python2.7/email/test/test_email.pyR;s     t TestMIMETextcBsPeZdZdZdZdZdZdZdZdZ RS(cCstd|_dS(Ns hello there(R t_msg(R/((s+/usr/lib/python2.7/email/test/test_email.pyR"-scCs|j}||jjd||jjddg}|j|jjd|||j|jjd|dd|dS(Ns text/plainREsus-asciiR7Rc(RAR@RIRJR8(R/RCR9((s+/usr/lib/python2.7/email/test/test_email.pyt test_types0s cCs3|j|jjd|j|jjdS(Ns hello there(RAR@RTRt is_multipart(R/((s+/usr/lib/python2.7/email/test/test_email.pyt test_payload9scCsF|j}tddd}||jjd||dddS(Ns hello thereRsus-asciis content-typestext/plain; charset="us-ascii"(RAR RFRK(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_charset=s cCsF|j}tddd}||jjd||dddS(Nu hello thereRsus-asciis content-typestext/plain; charset="us-ascii"(RAR RFRK(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_7bit_unicode_inputCs cCsS|j}td}||jd||dd|jd|jdS(Nu hello theresus-asciis content-typestext/plain; charset="us-ascii"s hello there(RAR RFRRf(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt"test_7bit_unicode_input_no_charsetIs   cCsnd}|j}t|dd}||jjd||dd||jdt|jddS(NuкирилицаRsutf-8s content-typestext/plain; charset="utf-8"Rr(RAR RFtoutput_charsetRTRjR(R/tteststrRCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_8bit_unicode_inputPs  cCsd}|jtt|dS(Nuкирилица(RatUnicodeEncodeErrorR (R/RH((s+/usr/lib/python2.7/email/test/test_email.pyt"test_8bit_unicode_input_no_charsetXs( R<R=R"RARCRDRERFRIRK(((s+/usr/lib/python2.7/email/test/test_email.pyR?,s      t TestMultipartcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZRS(c CsVtd}z|j}Wd|jXtdddd}t|dd}|jdd d dtd }|j||j|d |d Rs)Dingus Lovers RsHere is your dingus fishRg4FcpAiit-t+s %s%04di$s%a, %d %b %Y %H:%M:%StDate(R&RhR9RR RR tattachttimet localtimettimezonetaltzonetstrftimeR@R=t_txt( R/R5Rt containertimagetintrotnowt timetuplettzsecstsignttzoffset((s+/usr/lib/python2.7/email/test/test_email.pyR"`s<              cCs|j}|j}|j}|j|j||jd|t|jd|t|jd|jd}|jd}|j ||j |j ||j ||j||g|j |j|j |jdS(Nsmultipart/mixediii( RARaR@RRBRIR(RTt IndexErrorR8RXR=R(R/RCtraisesRtm0tm1((s+/usr/lib/python2.7/email/test/test_email.pyttest_hierarchys   cCs2d}tj|}|j||jdS(NsContent-Type: multipart/mixed; boundary="BOUNDARY" MIME-Version: 1.0 Subject: A subject To: aperson@dom.ain From: bperson@dom.ain --BOUNDARY --BOUNDARY-- (RRiR6Rf(R/R~R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_empty_multipart_idempotents cCsTtdd}d|d ----961284236552522269-- (R;RARf(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_boundary_in_non_multiparts cCs[|j}tjd}|j|j||jd|t|jddS(NsMIME-Version: 1.0 Content-Type: multipart/mixed; boundary=" XXXX" -- XXXX Content-Type: text/plain -- XXXX Content-Type: text/plain -- XXXX-- s XXXXi(RAR7RRRBR\R(RT(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_boundary_with_leading_spaces   cCs5tjd}|j|jdjddS(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==(RRiRART(R/R((s+/usr/lib/python2.7/email/test/test_email.pyt&test_boundary_without_trailing_newlines (R<R=R"ReRfRhRkRlRmRnRoRpRqRtRuRwRxRyRzR{(((s+/usr/lib/python2.7/email/test/test_email.pyRL_s$ (               tTestNonConformantcBsYeZdZdZdZdZdZdZdZdZ dZ RS( cCsU|j}|jd}||jd||jd||jddS(Ns msg_14.txts text/plainR~R(RAR;RIRR(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_parse_missing_minor_types  cCsk|jd}|jd}|jt|d|jt|jd|j|jdtj dS(Ns msg_15.txtitdefectsi( R;RTRthasattrRAR(R~tassertIsInstanceRtStartBoundaryNotFoundDefect(R/R:tinner((s+/usr/lib/python2.7/email/test/test_email.pyttest_same_boundary_inner_outers cCsv|jd}|j|jt|jt|jd|j|jdtj|j|jdtj dS(Ns msg_25.txtiii( R;RRTR(RAR(R~RtNoBoundaryInMultipartDefectt!MultipartInvariantViolationDefect(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_multipart_no_boundarys cCs|j}|j}t}d|d<||jd||jd||jd|d=d|d<||jd||jd||jdt}t|}|j|||j ddS(NR~s Content-TypeRs text/plains content-typeRvsContent-Type: foo ( RAR6R RRRIRRRkR.(R/RCtneqR:RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_invalid_content_types         cCs/|j}|jd}||jddS(Ns msg_31.txtsm--BOUNDARY Content-Type: text/plain message 1 --BOUNDARY Content-Type: text/plain message 2 --BOUNDARY-- (R6R;RT(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_no_start_boundary s  cCs/|j}|jd}||jddS(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 (R6R;Rf(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_no_separating_blank_lines  cCsv|jd}|jt|d|jt|jd|j|jdtj|j|jdtj dS(Ns msg_41.txtR~iii( R;RRRAR(R~RRRR(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_lying_multipart)s cCs^|jd}|jdjd}|jt|jd|j|jdtjdS(Ns msg_42.txtii(R;RTRAR(R~RRR(R/Rgtbad((s+/usr/lib/python2.7/email/test/test_email.pyttest_missing_start_boundary2s  cCs|j}d}tj|}||jg||jd|t|jd|j|jdtj ||jdj ddS(Ns Line 1 Line 2 Line 3s Line 2 Line 3iis Line 1 ( RAR7RRRTR(R~RRt#FirstHeaderLineIsContinuationDefecttline(R/RCRR:((s+/usr/lib/python2.7/email/test/test_email.pyt&test_first_line_is_continuation_headerAs  ( R<R=R}RRRRRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR|s    t TestRFC2047cBsGeZdZdZdZdZdZdZdZRS(cCsQ|j}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(RARRGR(R(R/RCRtdh((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2047_multilineQs   cCsZ|j}d}t|}||ddgtt|jd}||ddS( Ns0=?ISO-8859-1?Q?Andr=E9?= Pirard sAndrs iso-8859-1sPirard slatin-1sAndr Pirard (sAndrs iso-8859-1(sPirard N(RARRGtunicodeRR(R/RCRRthu((s+/usr/lib/python2.7/email/test/test_email.pyttest_whitespace_eater_unicode_s   cCsW|j}d}t|}||dd d d gt|j}||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(RN(squick brown foxs iso-8859-1(sjumped over theN(slazy dogs iso-8859-1(RARRGRt __unicode__(R/RCRRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_whitespace_eater_unicode_2gs    cCs/d}t|}|j||dfgdS(Ns3Sm=?ISO-8859-1?B?9g==?=rg=?ISO-8859-1?B?5Q==?=sbord(RRARG(R/RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2047_without_whitespaceps cCs5d}t|}|j|dd d d d gdS( Ns7Sm =?ISO-8859-1?B?9g==?= rg =?ISO-8859-1?B?5Q==?= sbordtSmss iso-8859-1trgstsbord(RN(ss iso-8859-1(RN(ss iso-8859-1(RN(RRARG(R/RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2047_with_whitespaceus  cCs_d}d d d d dg}x=|D]5\}}t||}|j||d fgq"WdS(Ns=?iso-8859-1?B?%s?=sdm==tvsdm=tdmsdmk=tvitdmks iso-8859-1(sdm==R(sdm=R(RR(sdmk=R(RR(RRA(R/RRtqtaR((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2047_B_bad_padding|s   cCs#d}|jt|dgdS(Ns=?iso-8659-1?Q?andr=e9=zz?=sandr=zzs iso-8659-1(sandr=zzs iso-8659-1(RAR(R/R((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2047_Q_invalid_digitss( R<R=RRRRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyRPs     tTestMIMEMessagecBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(cCs1td}z|j|_Wd|jXdS(Ns msg_11.txt(R&Rht_textR9(R/R5((s+/usr/lib/python2.7/email/test/test_email.pyR"s cCs|jttddS(Nsa plain string(Rat TypeErrorR(R/((s+/usr/lib/python2.7/email/test/test_email.pyttest_type_errorscCs|j}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.edutdnsRcs reporting-mtaRtnsdtactiontfailedsoriginal-recipientRsjangel1@cougar.noc.ucla.edusfinal-recipientsmessage/rfc822s message-ids(<002001c144a6$8752e060$56104586@oxy.edu>(srfc822R(sjangel1@cougar.noc.ucla.eduR( RAR;RIRRBR(RTRR RJRGRR(R/RCR:RXtdsn1tdsn2R1Rs((s+/usr/lib/python2.7/email/test/test_email.pyttest_dsnsB      c Cs|j}td}z|j}Wd|jXt}d|dR(RR(RARt parseaddrt formataddr(R/((s+/usr/lib/python2.7/email/test/test_email.pyttest_parseaddr_emptyscCs|jtjdddS(NsA Silly Personsperson@dom.ainsA Silly Person (sA Silly Personsperson@dom.ain(RARR(R/((s+/usr/lib/python2.7/email/test/test_email.pyttest_noquote_dump s cCsW|jtjddd}d}|jtjtj||f||fdS(NsA (Very) Silly Personsperson@dom.ains*"A \(Very\) Silly Person" sA \(Special\) Person(sA (Very) Silly Personsperson@dom.ain(RARRR(R/Rtb((s+/usr/lib/python2.7/email/test/test_email.pyttest_escape_dump s  cCsW|jtjddd}d}|jtjtj||f||fdS(NsArthur \Backslash\ Foobarsperson@dom.ains."Arthur \\Backslash\\ Foobar" (sArthur \Backslash\ Foobarsperson@dom.ain(RARRR(R/RR((s+/usr/lib/python2.7/email/test/test_email.pyttest_escape_backslashes s  cCsyd}d}d\}}|jtj|||f|jtj|||f|jtj||f|dS(NsJohn X. Doe s"John X. Doe" s John X. Doesjxd@example.com(s John X. Doesjxd@example.com(RARRR(R/RtyRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_name_with_dot s  cCsO|j}|tjdd|tjdd|tjdddS(Ns""example" example"@example.comRs!"\"example\" example"@example.coms#"\\"example\\" example"@example.com(Rs""example" example"@example.com(Rs!"\"example\" example"@example.com(Rs#"\\"example\\" example"@example.com(RARR(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyt2test_parseaddr_preserves_quoted_pairs_in_addresses s cCs#d}|jtj|ddS(NsFoo Bar sFoo Barsfoo@example.com(sFoo Barsfoo@example.com(RARR(R/R((s+/usr/lib/python2.7/email/test/test_email.pyttest_multiline_from_comment1 scCs|jtjdddS(NsA Silly; Personsperson@dom.ains""A Silly; Person" (sA Silly; Personsperson@dom.ain(RARR(R/((s+/usr/lib/python2.7/email/test/test_email.pyttest_quote_dump7 s cCs{|j}|tjdd|tjdd|tjdd|tjdd|tjdddS(Nthelloshello shello shello shello s hello (RARtfix_eols(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyt test_fix_eols< s  cCs|j}|j}t}t}||d||d||d|d||d||d|||d||d||d|d||d||d|||||||dS(Nsus-asciisUS-ASCIIsUs-AsCiItusasciitUSASCIItUsAsCiI(RAtassertNotEqualR(R/RCtnetcset1tcset2((s+/usr/lib/python2.7/email/test/test_email.pyttest_charset_richcomparisonsD s$                 cCs/|j}|tjddgddgdS( 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(RARt getaddresses(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyttest_getaddressesX s    cCsm|j}|tjdgdg|tjdgd d d g|tjddgd 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(RARR*(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyttest_getaddresses_nasty_ s     cCs4|j}tjdg}||ddddS(s(Test proper handling of a nested comments%User ((nested comment)) iis foo@bar.comN(RARR*(R/RCtaddrs((s+/usr/lib/python2.7/email/test/test_email.pyt"test_getaddresses_embedded_commenti s cCs?|j}t}|jdddd||jddS(Nscontent-dispositionRR$sfoo\wacky"name(RAR RRU(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_utils_quote_unquoteo s   cCs&td}|j|jddS(Ns not a charsetR(RRAtget_body_encoding(R/RE((s+/usr/lib/python2.7/email/test/test_email.pyt)test_get_body_encoding_with_bogus_charsetv s cCst|j}t}d|d<||dd|j}|t|d||ddt|d}||jd|jdd |||jd ||jd td||d dt}d |d<|j}|t|d||ddt|d}||jt j |jdd |||jd||d ddS(Nstext/plain; charset=UTF-8s Content-Types content-typeiisutf-8Rs hello worldREsaGVsbG8gd29ybGQ= Rrscontent-transfer-encodingstext/plain; charset="US-ASCII"sus-asciiR( RAR RQR(RR0RNRTRjRtencode_7or8bit(R/RCR:RRRE((s+/usr/lib/python2.7/email/test/test_email.pyt-test_get_body_encoding_with_uppercase_charsetz s.       cCs8td}td}|j|j|jdS(Nsus-asciisUS-ASCII(RRAR0(R/tlctuc((s+/usr/lib/python2.7/email/test/test_email.pyttest_charsets_case_insensitive s  cCsH|j}|jd}t}tj||||jddS(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 (R6R;RRRvR.(R/RCR:R|((s+/usr/lib/python2.7/email/test/test_email.pyt1test_partial_falls_inside_message_delivery_status s    (#R<R=RRRRRRRRRRR R RRRRRRRRRRRR!R)R+R,R.R/R1R3R6R7(((s+/usr/lib/python2.7/email/test/test_email.pyR_sB                           t TestIteratorscBs5eZdZdZdZdZdZRS(cCs|j}|j}|jd}tj|}t|}|t|d|tj||j |jd}tj|}t|}|t|dt d}z |tj||j Wd|j XdS(Ns msg_01.txtis msg_02.txti+s msg_19.txt( RAR6R;Rtbody_line_iteratorRR(t EMPTYSTRINGR RTR&RhR9(R/RCRR:titRR5((s+/usr/lib/python2.7/email/test/test_email.pyttest_body_line_iterator s      cCs|j}|jd}tj|d}g}d}x+|D]#}|d7}|j|jq=W||d|tj|ddS(Ns msg_04.txtR~iiis`a simple kind of mirror to reflect upon our own a simple kind of mirror to reflect upon our own (RAR;Rttyped_subpart_iteratorRRTR:R (R/RCR:R;RtsubpartsRX((s+/usr/lib/python2.7/email/test/test_email.pyttest_typed_subpart_iterator s    cCs|j}|jd}tj|dd}g}d}x+|D]#}|d7}|j|jq@W||d|tj|ddS(Ns msg_03.txtR~Riis% Hi, Do you like this message? -Me (RAR;RR=RRTR:R (R/RCR:R;RR>RX((s+/usr/lib/python2.7/email/test/test_email.pyt(test_typed_subpart_iterator_default_type s    c Csddddddddg}d d lm}m}|}g}d}xu|D]m\}}|j|||7}d} x1t|j|D]} |j| | d7} qW|j|| qPW|jt|||jdj g|D]\}}|^qdj |dS(sFeedParser BufferedSubFile.push() assumed it received complete line endings. A CR ending one push() followed by a LF starting the next push() added an empty line. sa iRisc iRsd se s fs i(tBufferedSubFilet NeedMoreDataN(sa i(Ri(sc i(Ri(sd i(se i(s fi(s i( temail.feedparserRARBtpushtitertreadlineRRAR(R ( R/timtRARBtbsftomtnttiltntn1tol((s+/usr/lib/python2.7/email/test/test_email.pyttest_pushCR_LF s,     c sddlm}m}d}d}ddjfdt|Dd}|jt}|}g}xWtd t||D]=} || | |!} |j| |j t |j |qW|j ||dS( Ni(RARBi'isabcd Rc3s|]}tVqdS(N(R(t.0R (tchars(s+/usr/lib/python2.7/email/test/test_email.pys $ ss i( RCRARBR R R+RjR(RDtextendRERFRA( R/RARBRLt chunksizeRttargetRHRR tchunk((RQs+/usr/lib/python2.7/email/test/test_email.pyttest_push_random s)  (R<R=R<R?R@RORV(((s+/usr/lib/python2.7/email/test/test_email.pyR8 s     tTestFeedParserscBs#eZdZdZdZRS(cCsAddlm}|}x|D]}|j|q W|jS(Ni(t FeedParser(RCRXtfeedR9(R/tchunksRXt feedparserRU((s+/usr/lib/python2.7/email/test/test_email.pytparse2 s   cCs|jdg}|j|jddddg|jdg}|j|jddddg|jddg}|j|jdd g|jd d g}|j|jddg|jd d g}|j|jddgdS( Ns a: b: c: d: RRtctds a: b: c: d:sa: bsc: tbcsa: sb: s b: (R\RAR(R/R((s+/usr/lib/python2.7/email/test/test_email.pyt test_newlines9 s""cCsd \}}|jdgd|g|}|j|jd g|j|jd|||jdgd|g|}|j|jd g|j|jd|||jdd gd|g|}|j|jddd||fgdS(Nii Nsa:b RRRsa:b sa: sb: R(ii N(RR(RR(RR(R\RAR_RT(R/tMtNR((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_linesE s !!$(R<R=R\R`Rc(((s+/usr/lib/python2.7/email/test/test_email.pyRW0 s  t TestParserscBskeZdZdZdZdZdZdZdZdZ dZ d Z d Z RS( cCs|j}td}ztj|}Wd|jX||dd||dd||jd|j|j|j|j t dS(Ns msg_02.txtRsppp-request@zzz.orgRs ppp@zzz.orgsmultipart/mixed( RAR&RR\R9RIRRBRRTR((R/RCR5R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_parserS s   cCsQ|j}tjd}||dd||dd||jddS(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 Rs!the next line has a space on it s message-idtspamsHere's the message body (RAR7RRT(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_whitespace_continuationa s   cCsQ|j}tjd}||dd||dd||jddS(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 Rs!the next line has a space on it s message-idRfsHere's the message body (RAR7RRT(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt(test_whitespace_continuation_last_headers s   cCs|j}tddd}ztj|}Wd|jX|t|jd|jd}||jd||jd|jd}||jd dS( Ns msg_26.txtR%R+iis text/plains!Simple email with attachment. isapplication/riscos(RAR&RR\R9R(RTRI(R/RCR5R:tpart1tpart2((s+/usr/lib/python2.7/email/test/test_email.pyttest_crlf_separation s  c Cs|j}|j}td}ztj|}Wd|jX||jd|t|jd|jd}||j d||jd|t|jd|jd}||jd||j d||jd|jd}||j d||jd|t|jd|jd}||jd||j d||jddS( Ns msg_28.txtiiismessage/rfc822s text/plains message 1 s message 2 ( RAR6R&R7R8R9RBR(RTRI( R/RCRR5R:Ritpart1aRjtpart2a((s+/usr/lib/python2.7/email/test/test_email.pyt-test_multipart_digest_with_extra_mime_headers s0    cCs?dddg}tjtj|}|j|dddS(Ns$From: Andrew Person From: foo From: bar !"#QUX;~: zoo bodyis!"#QUX;~s>FromRtbody(RAR7RR(RRRT(R/RCRR:R((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2822_header_syntax s   cCs;|j}d}tj|}|t|jddS(Ns<>From foo@example.com 11:25:53 From: bar !"#QUX;~: zoo bodyi(RAR7RR(R(R/RCRR:((s+/usr/lib/python2.7/email/test/test_email.pyt(test_rfc2822_space_not_allowed_in_header s cCsa|j}d}tj|}|j}|j||dddg||jddS(Ns7A: first header B: second header CC: third header bodytAtBtCCRu(RAR7RRRRT(R/RCRR:theaders((s+/usr/lib/python2.7/email/test/test_email.pyt!test_rfc2822_one_character_header s   cCs>d}tj|}|j|jdjjddS(NsFrom: foo@bar.com To: baz Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=BOUNDARY --BOUNDARY Content-Type: text/plain body ending with CRLF newline --BOUNDARY-- is (R7RRRTtendswith(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_CRLFLF_at_end_of_part s ( R<R=ReRgRhRkRnRpRtRvRwR|R~(((s+/usr/lib/python2.7/email/test/test_email.pyRdR s     "   t TestBase64cBs,eZdZdZdZdZRS(cCs|j}|tjdttjdddxtdD]}|dkr\d}nZ|dkrqd}nE|dkrd }n0|d krd }n|d krd }nd }|tjd||qAWdS(NRteolRiiiiiii i iiR(RARt base64_lenR(RR (R/RCtsizetbsize((s+/usr/lib/python2.7/email/test/test_email.pyttest_len s       cCsk|j}|tjdd|tjdd|tjddd|tjddddS(NRsaGVsbG8=RtXsaGVsbG8NCndvcmxk t helloXworld(RARRr(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyt test_decode s  cCs|j}|tjdd|tjdd|tjdd|tjddd|tjdd d d d |tjdd d d d dddS(NRRs aGVsbG8= shello s aGVsbG8K is aGVsbG8NCg== sxxxx iRi(seHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IA== Rs seHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IHh4eHggeHh4eCB4eHh4IHh4eHgg eHh4eCB4eHh4IA== (RARR(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyt test_encode s cCs|j}tj}||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?=REs 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?=Rs 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?=(RARt header_encodeRj(R/RCthe((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_encode s  (R<R=RRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR s  t TestQuopricBsYeZdZdZdZdZdZdZdZdZ dZ RS( cCsgttdtddD]}t|^q gttdtddD]}t|^qUgttdtddD]}t|^qdd d d d d g|_gtdD]'}t||jkrt|^q|_t|jt|jdks"tgttd tddD]}t|^qBdg|_|jjdgtdD]'}t||jkrt|^q|_ t|jt|j dkstdS(NRtziRxtZt0t9t!t*RPROt/Rit~s t=( R tordtchrthlitthnonR(tAssertionErrortblittremovetbnon(R/R((s+/usr/lib/python2.7/email/test/test_email.pyR"> s=(B=cCsXx'|jD]}|jtj|q Wx'|jD]}|jtj|q4WdS(N(RRRtheader_quopri_checkRR(R/R]((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_quopri_checkJ scCsXx'|jD]}|jtj|q Wx'|jD]}|jtj|q4WdS(N(RRRtbody_quopri_checkRR(R/R]((s+/usr/lib/python2.7/email/test/test_email.pyttest_body_quopri_checkP sc Cs|j}tj}tj}x=d D]5}|||t||dddddq"Wx$|jD]}|||dqeWx$|jD]}|||dqWdS( NRs h@e@l@l@o@RERRiii(shellos h@e@l@l@o@(RARtheader_quopri_lenRR(RR(R/RCthqltencRR]((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_quopri_lenV s    3cCsd|j}tj}x$|jD]}|||dqWx$|jD]}|||dqCWdS(Nii(RARtbody_quopri_lenRR(R/RCtbqlR]((s+/usr/lib/python2.7/email/test/test_email.pyttest_body_quopri_lenb s   cCsIxBtdD]4}t|}|jtjtj||q WdS(Ni(R RRARRtquote(R/RR]((s+/usr/lib/python2.7/email/test/test_email.pyttest_quote_unquote_idempotentj s cCs|j}tj}||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?=REs iso-8859-2s=?iso-8859-2?q?hello?=Rs=?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_?=Rs 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_?=(RARRRj(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyRo s  cCsk|j}|tjdd|tjdd|tjddd|tjddddS(NRRRs hello worldR(RARRr(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyR s  cCs|j}|tjdd|tjdd|tjdd|tjddd|tjdddd d |tjdddd d d d |tjdddS(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=20Rs 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(RARR(R/RC((s+/usr/lib/python2.7/email/test/test_email.pyR s  ( R<R=R"RRRRRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR= s      t TestCharsetcBs5eZdZdZdZdZdZRS(cCs6ddlm}y|jd=Wntk r1nXdS(Ni(Rtfake(R7RtCHARSETSR(R/t CharsetModule((s+/usr/lib/python2.7/email/test/test_email.pyttearDown s  cCso|j}td}d}|j|}|||j|d}|j|}|||j|dS(Nsus-asciis Hello World!s (RARt to_splittabletfrom_splittable(R/RCR]Rtsp((s+/usr/lib/python2.7/email/test/test_email.pyttest_idempotent s  cCs|j}td}|d|jdtd}|d|jdtd}|d|jdtd}y3|d |jd |d |jd tWntk rnXd d lm}|jd |jdtd }|d|jddS(Ns iso-8859-1s hello w=F6rlds hello wrldsutf-8saGVsbG8gd29ybGQ= s hello worldsus-asciiseuc-jps$B5FCO;~IW(Bsϻi(RR( RARt body_encodeRlt LookupErrorR7t add_charsettQPRG(R/RCR]R((s+/usr/lib/python2.7/email/test/test_email.pyttest_body_encode s&       cCs<td}|jt|d|jtjtddS(Nuus-asciisus-asciisascii(RRAR(RaRt CharsetError(R/RE((s+/usr/lib/python2.7/email/test/test_email.pyttest_unicode_charset_name s cCs&td}|jt|ddS(NRsutf-8(RRAR((R/RE((s+/usr/lib/python2.7/email/test/test_email.pyttest_codecs_aliases_accepted s (R<R=RRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR s    t TestHeadercBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZRS(cCsL|j}td}||jd|jd||jddS(Ns Hello World!s Goodbye World!sHello World! Goodbye World!(R6RRR(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyt test_simple s    cCsL|j}td}||jd|jd||jddS(Ns Hello World!sGoodbye World!sHello World! Goodbye World!(R6RRR(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyttest_simple_surprise s    cCs)d}|jt||dfgdS(Nsno decoding needed(RARRG(R/R((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_needs_no_decoding scCsRtddd}x9|jddjdD]}|jt|dq.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 (RRRtassertLessEqualR((R/Rtl((s+/usr/lib/python2.7/email/test/test_email.pyt test_long s  "c Cs|j}td}td}td}d}d}djd}t||}|j|||j|||j} || d|t| |df|df|dfgt|} || jddtt| } || | 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.」と言っています。(R6RRRRRRR( R/RCRRRRRRRRtustrtnewh((s+/usr/lib/python2.7/email/test/test_email.pyttest_multilingual s*        cCsF|j}t}||d|jdtd||ddS(NRRvs iso-8859-1s=?iso-8859-1?q?foo?=(R6RRR(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyttest_header_ctor_default_args3 s    cCs|j}d}t|}||jdt|dd}||jdt|dddd}||j|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(R6RR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_explicit_maxlinelen: s    cCsN|j}d}t|}||dgt|}|||jdS(NR(shelloN(RARRGRR(R/RCRRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_us_ascii_headerH s    cCs3|j}t}|jdd||ddS(NRs iso-8859-1s=?iso-8859-1?q?hello?=(RARR(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyttest_string_charsetP s  cCsQ|j}tdd}||jdtdd}||jddS(Nupöstalsutf-8s=?utf-8?q?p=C3=B6stal?=u 菊地時夫s=?utf-8?b?6I+K5Zyw5pmC5aSr?=(RARR(R/RCR((s+/usr/lib/python2.7/email/test/test_email.pyttest_utf8_shortest_ s  cCs|j}|j}d}|tt|t}|t|j||tt|dd||j|dd|t||dS(Ns0Ynwp4dUEbay Auction Semiar- No Charge Earn BigRR(RaRAt UnicodeErrorRRR((R/RbRCRR((s+/usr/lib/python2.7/email/test/test_email.pyttest_bad_8bit_headerf s   cCsq|j}t}|jdd|jd|j}||dtt|}||j|dS(NRs iso-8859-1tworlds=?iso-8859-1?q?hello?= world(RARRRRR(R/RCRR((s+/usr/lib/python2.7/email/test/test_email.pyt test_encoded_adjacent_nonencodedq s     cCsT|j}d}t|}||ddd gt|}||jddS( 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(RARRGRR(R/RCRtpartsthdr((s+/usr/lib/python2.7/email/test/test_email.pyttest_whitespace_eater{ s    cCs&|j}d}|tjt|dS(NsXSubject: =?EUC-KR?B?CSixpLDtKSC/7Liuvsax4iC6uLmwMcijIKHaILzSwd/H0SC8+LCjwLsgv7W/+Mj3I ?=(RaRRbR(R/RbR((s+/usr/lib/python2.7/email/test/test_email.pyttest_broken_base64_header s cCs7t}|jdddd|jd|ddS(NsContent-DispositionRR$sbud.gifsattachment; filename="bud.gif"(R RRA(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyttest_ascii_add_header s   cCs7t}|jdddd|jd|ddS( NsContent-DispositionRR$s iso-8859-1Rs Fuballer.ppts3attachment; filename*="iso-8859-1''Fu%DFballer.ppt"(s iso-8859-1Rs Fuballer.ppt(R RRA(R/R:((s+/usr/lib/python2.7/email/test/test_email.pyt#test_nonascii_add_header_via_triple s  cCs9tddj}|j|d|j|tdS(Ntabcs iso-8859-2s=?iso-8859-2?q?abc?=(RRRARR((R/tres((s+/usr/lib/python2.7/email/test/test_email.pyttest_encode_unaliased_charset s(R<R=RRRRRRRRRRRRRRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR s"     1        t TestRFC2231cBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZRS(cCsN|j}|jd}||jdd||jddtd dS( Ns msg_29.txtttitlesus-asciitens%This is even more ***fun*** isn't it!Rs'"This is even more ***fun*** isn't it!"(sus-asciiRs%This is even more ***fun*** isn't it!(sus-asciiRs'"This is even more ***fun*** isn't it!"(RAR;RJRl(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyR s  cCs|j}t}|jdddd||jdd |jdddddd||jdd |jd}|jdddddd|j|jd dS( NRs%This is even more ***fun*** isn't it!REsus-asciiRtlanguageRs 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!(RAR RRJR;R6Rf(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyR s    cCsz|j}|jd}|jdddddd|jdd dddd|jdd d ||jd dS( Ns msg_01.txtRvRREsus-asciiRRRs%This is even more ***fun*** isn't it!Rcs 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 (R6R;RRRf(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyR s   cCs/|j}|jd}||jddS(Ns msg_32.txtsus-ascii(RAR;R(R/RCR:((s+/usr/lib/python2.7/email/test/test_email.pyt test_rfc2231_get_content_charset s cCsHd}tj|}|jd}|j|t|j|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(R7RRJtassertNotIsInstancettupleRA(R/RR:tparam((s+/usr/lib/python2.7/email/test/test_email.pyt#test_rfc2231_no_language_or_charset scCs/d}tj|}|j|jddS(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(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt/test_rfc2231_no_language_or_charset_in_filename scCs/d}tj|}|j|jddS(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(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt7test_rfc2231_no_language_or_charset_in_filename_encoded scCs/d}tj|}|j|jddS(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(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2231_partly_encoded s  cCs/d}tj|}|j|jddS(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(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2231_partly_nonencoded% s  cCs/d}tj|}|j|jddS(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(R7RRAR\(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt/test_rfc2231_no_language_or_charset_in_boundary2 scCs/d}tj|}|j|jddS(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(R7RRAR(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt.test_rfc2231_no_language_or_charset_in_charset> scCs/d}tj|}|j|jddS(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(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt%test_rfc2231_bad_encoding_in_filenameK scCs/d}tj|}|j|jddS(Ns:Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D (R7RRARRG(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt$test_rfc2231_bad_encoding_in_charsetW scCs/d}tj|}|j|jddS(Ns:Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D (R7RRARRG(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt%test_rfc2231_bad_character_in_charseta scCs/d}tj|}|j|jddS(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�(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyt&test_rfc2231_bad_character_in_filenamek scCs/d}tj|}|j|jddS(Ns^Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt s myfile.txt(R7RRARU(R/RR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2231_unknown_encodingw scCsa|j}d}tj|}|jd\}}}||d||d||ddS(NsJContent-Type: application/x-foo; name*0*="Frank's"; name*1*=" Document" RsFrank's Document(RAR7RRJRG(R/RCRR:RERR((s+/usr/lib/python2.7/email/test/test_email.pyt-test_rfc2231_single_tick_in_filename_extended s   cCsHd}tj|}|jd}|j|t|j|ddS(NsGContent-Type: application/x-foo; name*0="Frank's"; name*1=" Document" RsFrank's Document(R7RRJRRRA(R/RR:R((s+/usr/lib/python2.7/email/test/test_email.pyt$test_rfc2231_single_tick_in_filename s cCsa|j}d}tj|}|jd\}}}||d||d||ddS(NsYContent-Type: application/x-foo; name*0*="us-ascii'en-us'Frank's"; name*1*=" Document" Rsus-asciisen-ussFrank's Document(RAR7RRJ(R/RCRR:RERR((s+/usr/lib/python2.7/email/test/test_email.pyt!test_rfc2231_tick_attack_extended s   cCsHd}tj|}|jd}|j|t|j|ddS(NsWContent-Type: application/x-foo; name*0="us-ascii'en-us'Frank's"; name*1=" Document" Rsus-ascii'en-us'Frank's Document(R7RRJRRRA(R/RR:R((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2231_tick_attack s cCs8|j}d}tj|}||jdddS(Ns:Content-Type: application/x-foo; name="Frank's Document" RsFrank's Document(RAR7RRJ(R/RCRR:((s+/usr/lib/python2.7/email/test/test_email.pyttest_rfc2231_no_extended_values s cCsa|j}d}tj|}|jd\}}}||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(RAR7RRJ(R/RCRR:RERR((s+/usr/lib/python2.7/email/test/test_email.pyt,test_rfc2231_encoded_then_unencoded_segments s   cCsa|j}d}tj|}|jd\}}}||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(RAR7RRJ(R/RCRR:RERR((s+/usr/lib/python2.7/email/test/test_email.pyt,test_rfc2231_unencoded_then_encoded_segments s   (R<R=RRRRRRRRRRRRRRRRRRRRRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR s.  %    t TestSignedcBs,eZdZdZdZdZRS(cCsItt|}z|j}tj|}Wd|jX||fS(N(R&RRhR7RR9(R/R$R5toriginalR:((s+/usr/lib/python2.7/email/test/test_email.pyt _msg_and_obj s   cCslddl}|jd|j|jB}|j|jd}|j|jd}|j||dS(Nis^--([^\n]+)\n(.*?)\n--\1$i(tretcompiletSRatsearchtgroupRA(R/RtresultRtreparttinparttoutpart((s+/usr/lib/python2.7/email/test/test_email.pyt_signed_parts_eq s  cCs5|jd\}}|j}|j||dS(Ns msg_45.txt(RRfR(R/RR:R((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_headers_as_string s cCsQ|jd\}}t}t|j||j}|j||dS(Ns msg_45.txt(RRRRkR.R(R/RR:R5R((s+/usr/lib/python2.7/email/test/test_email.pyttest_long_headers_flatten s   (R<R=RRRR(((s+/usr/lib/python2.7/email/test/test_email.pyR s  cCsBtjt}gt|D]$}|jdrt||^qS(NR(RytmodulesR<tdirRtgetattr(tmodR((s+/usr/lib/python2.7/email/test/test_email.pyt _testclasses s cCs:tj}x'tD]}|jtj|qW|S(N(tunittestt TestSuiteR taddTestt makeSuite(tsuitet testclass((s+/usr/lib/python2.7/email/test/test_email.pyRs cCs"xtD]}t|q WdS(N(R R(R((s+/usr/lib/python2.7/email/test/test_email.pyt test_mainst__main__t defaultTestR(TRRyRSRR)R twarningsR&t cStringIORtrandomRR7t email.CharsetRt email.HeaderRRRt email.ParserRRtemail.GeneratorRR t email.MessageR temail.MIMEAudioR temail.MIMETextR temail.MIMEImageR temail.MIMEBaseRtemail.MIMEMessageRtemail.MIMEMultipartRRRRRRRttest.test_supportRRt email.testRR"R,R:RR&tTestCaseR'R>RRR!R*R;R?RLR|RRRRR8RWRdRRRRRRR RRR<tmain(((s+/usr/lib/python2.7/email/test/test_email.pyts          B80*3r>;hj"Ho=;!