From: Chuck Hagenbuch Date: Sun, 9 Nov 2008 04:29:29 +0000 (-0500) Subject: start moving mime lib to Horde 4 standards X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=515cf812c33872cad60b0f5af0d34233041130ba;p=horde.git start moving mime lib to Horde 4 standards --- diff --git a/framework/MIME/package.xml b/framework/MIME/package.xml index 1a78b5c47..9a1c944a3 100644 --- a/framework/MIME/package.xml +++ b/framework/MIME/package.xml @@ -3,10 +3,10 @@ http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> - Horde_MIME + Mime pear.horde.org - Horde Mime Library - The Horde_MIME:: class provides methods for dealing with MIME (RFC 2045) and related e-mail (RFC 822/2822/5322) standards. + Horde MIME Library + The Horde_Mime:: class provides methods for dealing with MIME (RFC 2045) and related e-mail (RFC 822/2822/5322) standards. Chuck Hagenbuch @@ -36,7 +36,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> - + @@ -50,7 +50,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> - + @@ -84,7 +84,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> - + @@ -95,8 +95,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> - - + + @@ -163,61 +163,61 @@ http://pear.php.net/dtd/package-2.0.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/MIME/tests/attachment.bin b/framework/MIME/tests/attachment.bin deleted file mode 100644 index a17f84e7d..000000000 --- a/framework/MIME/tests/attachment.bin +++ /dev/null @@ -1 +0,0 @@ -Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich. diff --git a/framework/MIME/tests/bug_325.phpt b/framework/MIME/tests/bug_325.phpt deleted file mode 100644 index 16fbaf6a1..000000000 --- a/framework/MIME/tests/bug_325.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -Bug #338 (fileinfo returning charset) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -text/plain diff --git a/framework/MIME/tests/bug_325.txt b/framework/MIME/tests/bug_325.txt deleted file mode 100644 index 0dc0fba09..000000000 --- a/framework/MIME/tests/bug_325.txt +++ /dev/null @@ -1,6 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod -tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, -quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo -consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse -cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non -proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/framework/MIME/tests/bug_4834.phpt b/framework/MIME/tests/bug_4834.phpt deleted file mode 100644 index 6230ff573..000000000 --- a/framework/MIME/tests/bug_4834.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #4834 Wrong encoding of email lists with groups. ---FILE-- -, Group: peter@example.com, jane@example.com;'); - -?> ---EXPECT-- -John Doe , Group: peter@example.com, jane@example.com; diff --git a/framework/MIME/tests/bug_6896.phpt b/framework/MIME/tests/bug_6896.phpt deleted file mode 100644 index ca2e0240b..000000000 --- a/framework/MIME/tests/bug_6896.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -Bug #6896 MIME::rfc822Explode parsing broken ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - string(17) "addr1@example.com" - [1]=> - string(18) " addr2@example.com" -} diff --git a/framework/MIME/tests/contents.phpt b/framework/MIME/tests/contents.phpt deleted file mode 100644 index 809f7748a..000000000 --- a/framework/MIME/tests/contents.phpt +++ /dev/null @@ -1,67 +0,0 @@ ---TEST-- -MIME_Contents tests. ---FILE-- -getDownloadAllList()); -echo "\n"; -var_export($contents->getAttachmentContents()); - -?> ---EXPECT-- -array ( - 0 => '2.0', -) -array ( - 0 => - array ( - 'name' => 'Weitergeleitete Nachricht: Small message', - 'data' => 'Return-Path: -Received: from neo.wg.de ([unix socket]) - by neo (Cyrus v2.2.13) with LMTPA; - Tue, 11 Mar 2008 17:26:11 +0100 -X-Sieve: CMU Sieve 2.2 -Received: from localhost (localhost [127.0.0.1]) - by neo.wg.de (Postfix) with ESMTP id 142BF32B032 - for ; Tue, 11 Mar 2008 17:26:11 +0100 (CET) -Received: from neo.wg.de ([127.0.0.1]) - by localhost (neo.wg.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP - id 02540-02 for ; Tue, 11 Mar 2008 17:26:02 +0100 (CET) -Received: from localhost (localhost [127.0.0.1]) - by neo.wg.de (Postfix) with ESMTP id 21E2532B037 - for ; Tue, 11 Mar 2008 17:26:02 +0100 (CET) -Received: from 192.168.60.101 ([192.168.60.101]) by neo.wg.de (Horde - Framework) with HTTP; Tue, 11 Mar 2008 17:26:02 +0100 -Message-ID: <20080311172602.12293hbhf6ddsza0@neo.wg.de> -X-Priority: 3 (Normal) -Date: Tue, 11 Mar 2008 17:26:02 +0100 -From: Jan Schneider -To: "jan@localhost" -Subject: Small message -MIME-Version: 1.0 -Content-Type: text/plain; - charset=ISO-8859-1; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit -User-Agent: Internet Messaging Program (IMP) H3 (5.0-cvs) -X-Virus-Scanned: amavisd-new at wg.de -X-Spam-Status: No, score=-4.351 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.048, - BAYES_00=-2.599] -X-Spam-Score: -4.351 -X-Spam-Level: - -Small message text. - - -', - ), -) diff --git a/framework/MIME/tests/mail_001.phpt b/framework/MIME/tests/mail_001.phpt deleted file mode 100644 index dfd7cfcd4..000000000 --- a/framework/MIME/tests/mail_001.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -MIME_Mail constructor test ---FILE-- -send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the body diff --git a/framework/MIME/tests/mail_002.phpt b/framework/MIME/tests/mail_002.phpt deleted file mode 100644 index 28d1d9da4..000000000 --- a/framework/MIME/tests/mail_002.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -MIME_Mail methods test ---FILE-- -addHeader('Subject', 'My Subject'); -$mail->setBody("This is\nthe body", 'iso-8859-15'); -$mail->addHeader('To', 'recipient@example.com'); -$mail->addHeader('Cc', 'null@example.com'); -$mail->addHeader('Bcc', 'invisible@example.com'); -$mail->addHeader('From', 'sender@example.com'); -$mail->removeHeader('Cc'); - -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the body diff --git a/framework/MIME/tests/mail_003.phpt b/framework/MIME/tests/mail_003.phpt deleted file mode 100644 index a0a3ef1a7..000000000 --- a/framework/MIME/tests/mail_003.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -MIME_Mail encoding test ---FILE-- -', - 'sender@example.com', 'iso-8859-1'); -$mail->addHeader('Cc', 'Der schöne Peter ', 'iso-8859-15'); -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: =?iso-8859-1?b?U2No9m5lcg==?= Betreff -To: =?iso-8859-1?b?RW1wZuRuZ2Vy?= -From: sender@example.com -Cc: Der =?iso-8859-15?b?c2No9m5l?= Peter -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-1; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: quoted-printable - -H=FCbsche Umlaute - und Leerzeichen. diff --git a/framework/MIME/tests/mail_004.phpt b/framework/MIME/tests/mail_004.phpt deleted file mode 100644 index 23fd74330..000000000 --- a/framework/MIME/tests/mail_004.phpt +++ /dev/null @@ -1,59 +0,0 @@ ---TEST-- -MIME_Mail::addPart() test ---FILE-- -addPart('text/plain', 'This is a plain text', 'iso-8859-1', 'inline'); -$mail->addPart('application/octet-stream', - file_get_contents(dirname(__FILE__) . '/attachment.bin'), - null, 'attachment'); - -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="=_%s" -Content-Transfer-Encoding: 7bit - -This message is in MIME format. - ---=_%s -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the body - ---=_%s -Content-Type: text/plain; - charset=iso-8859-1 -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is a plain text ---=_%s -Content-Type: application/octet-stream -Content-Disposition: attachment -Content-Transfer-Encoding: base64 - -WnfDtmxmIEJveGvDpG1wZmVyIGphZ2VuIFZpa3RvciBxdWVyIMO8YmVyIGRlbiBncm/Dn2VuIFN5 -bHRlciBEZWljaC4K - ---=_%s-- diff --git a/framework/MIME/tests/mail_005.phpt b/framework/MIME/tests/mail_005.phpt deleted file mode 100644 index 5683ec464..000000000 --- a/framework/MIME/tests/mail_005.phpt +++ /dev/null @@ -1,100 +0,0 @@ ---TEST-- -MIME_Mail HTML test ---FILE-- -setBody("This is\nthe plain text body."); -echo $mail->send('dummy'); - -echo "====================================================================\n"; - -$mail = new MIME_Mail('My Subject', null, 'recipient@example.com', - 'sender@example.com'); -$mail->setHTMLBody("

Header Title

\n

This is
the html text body.

", - 'iso-8859-1', false); -echo $mail->send('dummy'); - -echo "====================================================================\n"; - -$mail = new MIME_Mail('My Subject', null, 'recipient@example.com', - 'sender@example.com'); -$mail->setHTMLBody("

Header Title

\n

This is
the html text body.

"); -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-1; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the plain text body. -==================================================================== -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/html; - charset=iso-8859-1 -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -

Header Title

-

This is
the html text body.

-==================================================================== -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: multipart/alternative; - boundary="=_%s" -Content-Transfer-Encoding: 7bit - -This message is in MIME format. - ---=_%s -Content-Type: text/plain; - charset=iso-8859-1; - DelSp="Yes"; - format="flowed" -Content-Description: Plaintext Version of Message -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - - - -HEADER TITLE - -This is -the html text body. - ---=_%s -Content-Type: text/html; - charset=iso-8859-1 -Content-Description: HTML Version of Message -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -

Header Title

-

This is
the html text body.

---=_%s-- diff --git a/framework/MIME/tests/mail_006.phpt b/framework/MIME/tests/mail_006.phpt deleted file mode 100644 index 8bed4464e..000000000 --- a/framework/MIME/tests/mail_006.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -MIME_Mail::addAttachment() test ---FILE-- -addAttachment(dirname(__FILE__) . '/attachment.bin'); -$mail->addAttachment(dirname(__FILE__) . '/mail_dummy.inc', 'my_name.html', 'text/html', 'iso-8859-15'); - -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="=_%s" -Content-Transfer-Encoding: 7bit - -This message is in MIME format. - ---=_%s -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the body - ---=_%s -Content-Type: application/octet-stream; - name="attachment.bin" -Content-Disposition: attachment; - filename="attachment.bin" -Content-Transfer-Encoding: base64 - -WnfDtmxmIEJveGvDpG1wZmVyIGphZ2VuIFZpa3RvciBxdWVyIMO8YmVyIGRlbiBncm/Dn2VuIFN5 -bHRlciBEZWljaC4K - ---=_%s -Content-Type: text/html; - charset=iso-8859-15; - name="my_name.html" -Content-Disposition: attachment; - filename="my_name.html" -Content-Transfer-Encoding: 7bit - -send('dummy'); -$id = $mail->_headers->getValue('message-id'); - -echo "====================================================================\n"; - -$mail->addHeader('To', 'Änderung ', 'utf-8'); -echo $mail->send('dummy'); - -echo "====================================================================\n"; - -var_dump($id != $mail->_headers->getValue('message-id')); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -This is -the body -==================================================================== -Subject: My Subject -From: sender@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-15; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit -To: =?utf-8?b?w4RuZGVydW5n?= - -This is -the body - -==================================================================== -bool(true) - diff --git a/framework/MIME/tests/mail_008.phpt b/framework/MIME/tests/mail_008.phpt deleted file mode 100644 index a086b37f7..000000000 --- a/framework/MIME/tests/mail_008.phpt +++ /dev/null @@ -1,39 +0,0 @@ ---TEST-- -MIME_Mail flowed text test ---FILE-- -addHeader('Subject', 'My Subject'); -$mail->addHeader('To', 'recipient@example.com'); -$mail->setBody('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo -consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse -cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); - -echo $mail->send('dummy'); - -?> ---EXPECTF-- -Subject: My Subject -To: recipient@example.com -Message-ID: <%d.%s@mail.example.com> -User-Agent: Horde Application Framework 3.2 -Date: %s, %d %s %d %d:%d:%d %s%d -MIME-Version: 1.0 -Content-Type: text/plain; - charset=iso-8859-1; - DelSp="Yes"; - format="flowed" -Content-Disposition: inline -Content-Transfer-Encoding: 7bit - -Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do -eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad -minim veniam, quis nostrud exercitation ullamco laboris nisi ut -aliquip ex ea commodo -consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse -cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat -cupidatat non proident, sunt in culpa qui officia deserunt mollit anim -id est laborum. \ No newline at end of file diff --git a/framework/MIME/tests/mail_dummy.inc b/framework/MIME/tests/mail_dummy.inc deleted file mode 100644 index b32349931..000000000 --- a/framework/MIME/tests/mail_dummy.inc +++ /dev/null @@ -1,15 +0,0 @@ -_cleanHTML($data); -} - -?> ---EXPECT-- -link -link -link -link -link -link -link diff --git a/framework/MIME/tests/url1.html b/framework/MIME/tests/url1.html deleted file mode 100644 index 0c88c1490..000000000 --- a/framework/MIME/tests/url1.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url2.html b/framework/MIME/tests/url2.html deleted file mode 100644 index 94c45a2ca..000000000 --- a/framework/MIME/tests/url2.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url3.html b/framework/MIME/tests/url3.html deleted file mode 100644 index 4c7eafed9..000000000 --- a/framework/MIME/tests/url3.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url4.html b/framework/MIME/tests/url4.html deleted file mode 100644 index 935612578..000000000 --- a/framework/MIME/tests/url4.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url5.html b/framework/MIME/tests/url5.html deleted file mode 100644 index 89dfbc68d..000000000 --- a/framework/MIME/tests/url5.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url6.html b/framework/MIME/tests/url6.html deleted file mode 100644 index 73ad9fc17..000000000 --- a/framework/MIME/tests/url6.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/url7.html b/framework/MIME/tests/url7.html deleted file mode 100644 index cb5c80040..000000000 --- a/framework/MIME/tests/url7.html +++ /dev/null @@ -1 +0,0 @@ -link diff --git a/framework/MIME/tests/viewer_php.phpt b/framework/MIME/tests/viewer_php.phpt deleted file mode 100644 index cceaa9198..000000000 --- a/framework/MIME/tests/viewer_php.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -PHP source viewer ---FILE-- -lineNumber(str_replace('<?php ', '', highlight_string(' ---EXPECT-- -
    -
  1. highlight_file(__FILE__);
  2. -
\ No newline at end of file diff --git a/framework/Mime/test/Horde/Mime/AllTests.php b/framework/Mime/test/Horde/Mime/AllTests.php new file mode 100644 index 000000000..e69de29bb diff --git a/framework/Mime/test/Horde/Mime/attachment.bin b/framework/Mime/test/Horde/Mime/attachment.bin new file mode 100644 index 000000000..a17f84e7d --- /dev/null +++ b/framework/Mime/test/Horde/Mime/attachment.bin @@ -0,0 +1 @@ +Zwölf Boxkämpfer jagen Viktor quer über den großen Sylter Deich. diff --git a/framework/Mime/test/Horde/Mime/bug_325.phpt b/framework/Mime/test/Horde/Mime/bug_325.phpt new file mode 100644 index 000000000..16fbaf6a1 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/bug_325.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #338 (fileinfo returning charset) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +text/plain diff --git a/framework/Mime/test/Horde/Mime/bug_325.txt b/framework/Mime/test/Horde/Mime/bug_325.txt new file mode 100644 index 000000000..0dc0fba09 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/bug_325.txt @@ -0,0 +1,6 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum. diff --git a/framework/Mime/test/Horde/Mime/bug_4834.phpt b/framework/Mime/test/Horde/Mime/bug_4834.phpt new file mode 100644 index 000000000..6230ff573 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/bug_4834.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #4834 Wrong encoding of email lists with groups. +--FILE-- +, Group: peter@example.com, jane@example.com;'); + +?> +--EXPECT-- +John Doe , Group: peter@example.com, jane@example.com; diff --git a/framework/Mime/test/Horde/Mime/bug_6896.phpt b/framework/Mime/test/Horde/Mime/bug_6896.phpt new file mode 100644 index 000000000..ca2e0240b --- /dev/null +++ b/framework/Mime/test/Horde/Mime/bug_6896.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #6896 MIME::rfc822Explode parsing broken +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(17) "addr1@example.com" + [1]=> + string(18) " addr2@example.com" +} diff --git a/framework/Mime/test/Horde/Mime/contents.phpt b/framework/Mime/test/Horde/Mime/contents.phpt new file mode 100644 index 000000000..809f7748a --- /dev/null +++ b/framework/Mime/test/Horde/Mime/contents.phpt @@ -0,0 +1,67 @@ +--TEST-- +MIME_Contents tests. +--FILE-- +getDownloadAllList()); +echo "\n"; +var_export($contents->getAttachmentContents()); + +?> +--EXPECT-- +array ( + 0 => '2.0', +) +array ( + 0 => + array ( + 'name' => 'Weitergeleitete Nachricht: Small message', + 'data' => 'Return-Path: +Received: from neo.wg.de ([unix socket]) + by neo (Cyrus v2.2.13) with LMTPA; + Tue, 11 Mar 2008 17:26:11 +0100 +X-Sieve: CMU Sieve 2.2 +Received: from localhost (localhost [127.0.0.1]) + by neo.wg.de (Postfix) with ESMTP id 142BF32B032 + for ; Tue, 11 Mar 2008 17:26:11 +0100 (CET) +Received: from neo.wg.de ([127.0.0.1]) + by localhost (neo.wg.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP + id 02540-02 for ; Tue, 11 Mar 2008 17:26:02 +0100 (CET) +Received: from localhost (localhost [127.0.0.1]) + by neo.wg.de (Postfix) with ESMTP id 21E2532B037 + for ; Tue, 11 Mar 2008 17:26:02 +0100 (CET) +Received: from 192.168.60.101 ([192.168.60.101]) by neo.wg.de (Horde + Framework) with HTTP; Tue, 11 Mar 2008 17:26:02 +0100 +Message-ID: <20080311172602.12293hbhf6ddsza0@neo.wg.de> +X-Priority: 3 (Normal) +Date: Tue, 11 Mar 2008 17:26:02 +0100 +From: Jan Schneider +To: "jan@localhost" +Subject: Small message +MIME-Version: 1.0 +Content-Type: text/plain; + charset=ISO-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit +User-Agent: Internet Messaging Program (IMP) H3 (5.0-cvs) +X-Virus-Scanned: amavisd-new at wg.de +X-Spam-Status: No, score=-4.351 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.048, + BAYES_00=-2.599] +X-Spam-Score: -4.351 +X-Spam-Level: + +Small message text. + + +', + ), +) diff --git a/framework/Mime/test/Horde/Mime/mail_001.phpt b/framework/Mime/test/Horde/Mime/mail_001.phpt new file mode 100644 index 000000000..dfd7cfcd4 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_001.phpt @@ -0,0 +1,30 @@ +--TEST-- +MIME_Mail constructor test +--FILE-- +send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the body diff --git a/framework/Mime/test/Horde/Mime/mail_002.phpt b/framework/Mime/test/Horde/Mime/mail_002.phpt new file mode 100644 index 000000000..28d1d9da4 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_002.phpt @@ -0,0 +1,36 @@ +--TEST-- +MIME_Mail methods test +--FILE-- +addHeader('Subject', 'My Subject'); +$mail->setBody("This is\nthe body", 'iso-8859-15'); +$mail->addHeader('To', 'recipient@example.com'); +$mail->addHeader('Cc', 'null@example.com'); +$mail->addHeader('Bcc', 'invisible@example.com'); +$mail->addHeader('From', 'sender@example.com'); +$mail->removeHeader('Cc'); + +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the body diff --git a/framework/Mime/test/Horde/Mime/mail_003.phpt b/framework/Mime/test/Horde/Mime/mail_003.phpt new file mode 100644 index 000000000..a0a3ef1a7 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_003.phpt @@ -0,0 +1,33 @@ +--TEST-- +MIME_Mail encoding test +--FILE-- +', + 'sender@example.com', 'iso-8859-1'); +$mail->addHeader('Cc', 'Der schöne Peter ', 'iso-8859-15'); +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: =?iso-8859-1?b?U2No9m5lcg==?= Betreff +To: =?iso-8859-1?b?RW1wZuRuZ2Vy?= +From: sender@example.com +Cc: Der =?iso-8859-15?b?c2No9m5l?= Peter +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +H=FCbsche Umlaute + und Leerzeichen. diff --git a/framework/Mime/test/Horde/Mime/mail_004.phpt b/framework/Mime/test/Horde/Mime/mail_004.phpt new file mode 100644 index 000000000..23fd74330 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_004.phpt @@ -0,0 +1,59 @@ +--TEST-- +MIME_Mail::addPart() test +--FILE-- +addPart('text/plain', 'This is a plain text', 'iso-8859-1', 'inline'); +$mail->addPart('application/octet-stream', + file_get_contents(dirname(__FILE__) . '/attachment.bin'), + null, 'attachment'); + +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="=_%s" +Content-Transfer-Encoding: 7bit + +This message is in MIME format. + +--=_%s +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the body + +--=_%s +Content-Type: text/plain; + charset=iso-8859-1 +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is a plain text +--=_%s +Content-Type: application/octet-stream +Content-Disposition: attachment +Content-Transfer-Encoding: base64 + +WnfDtmxmIEJveGvDpG1wZmVyIGphZ2VuIFZpa3RvciBxdWVyIMO8YmVyIGRlbiBncm/Dn2VuIFN5 +bHRlciBEZWljaC4K + +--=_%s-- diff --git a/framework/Mime/test/Horde/Mime/mail_005.phpt b/framework/Mime/test/Horde/Mime/mail_005.phpt new file mode 100644 index 000000000..5683ec464 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_005.phpt @@ -0,0 +1,100 @@ +--TEST-- +MIME_Mail HTML test +--FILE-- +setBody("This is\nthe plain text body."); +echo $mail->send('dummy'); + +echo "====================================================================\n"; + +$mail = new MIME_Mail('My Subject', null, 'recipient@example.com', + 'sender@example.com'); +$mail->setHTMLBody("

Header Title

\n

This is
the html text body.

", + 'iso-8859-1', false); +echo $mail->send('dummy'); + +echo "====================================================================\n"; + +$mail = new MIME_Mail('My Subject', null, 'recipient@example.com', + 'sender@example.com'); +$mail->setHTMLBody("

Header Title

\n

This is
the html text body.

"); +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the plain text body. +==================================================================== +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/html; + charset=iso-8859-1 +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +

Header Title

+

This is
the html text body.

+==================================================================== +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="=_%s" +Content-Transfer-Encoding: 7bit + +This message is in MIME format. + +--=_%s +Content-Type: text/plain; + charset=iso-8859-1; + DelSp="Yes"; + format="flowed" +Content-Description: Plaintext Version of Message +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + + + +HEADER TITLE + +This is +the html text body. + +--=_%s +Content-Type: text/html; + charset=iso-8859-1 +Content-Description: HTML Version of Message +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +

Header Title

+

This is
the html text body.

+--=_%s-- diff --git a/framework/Mime/test/Horde/Mime/mail_006.phpt b/framework/Mime/test/Horde/Mime/mail_006.phpt new file mode 100644 index 000000000..8bed4464e --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_006.phpt @@ -0,0 +1,76 @@ +--TEST-- +MIME_Mail::addAttachment() test +--FILE-- +addAttachment(dirname(__FILE__) . '/attachment.bin'); +$mail->addAttachment(dirname(__FILE__) . '/mail_dummy.inc', 'my_name.html', 'text/html', 'iso-8859-15'); + +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="=_%s" +Content-Transfer-Encoding: 7bit + +This message is in MIME format. + +--=_%s +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the body + +--=_%s +Content-Type: application/octet-stream; + name="attachment.bin" +Content-Disposition: attachment; + filename="attachment.bin" +Content-Transfer-Encoding: base64 + +WnfDtmxmIEJveGvDpG1wZmVyIGphZ2VuIFZpa3RvciBxdWVyIMO8YmVyIGRlbiBncm/Dn2VuIFN5 +bHRlciBEZWljaC4K + +--=_%s +Content-Type: text/html; + charset=iso-8859-15; + name="my_name.html" +Content-Disposition: attachment; + filename="my_name.html" +Content-Transfer-Encoding: 7bit + +send('dummy'); +$id = $mail->_headers->getValue('message-id'); + +echo "====================================================================\n"; + +$mail->addHeader('To', 'Änderung ', 'utf-8'); +echo $mail->send('dummy'); + +echo "====================================================================\n"; + +var_dump($id != $mail->_headers->getValue('message-id')); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +This is +the body +==================================================================== +Subject: My Subject +From: sender@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-15; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit +To: =?utf-8?b?w4RuZGVydW5n?= + +This is +the body + +==================================================================== +bool(true) + diff --git a/framework/Mime/test/Horde/Mime/mail_008.phpt b/framework/Mime/test/Horde/Mime/mail_008.phpt new file mode 100644 index 000000000..a086b37f7 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_008.phpt @@ -0,0 +1,39 @@ +--TEST-- +MIME_Mail flowed text test +--FILE-- +addHeader('Subject', 'My Subject'); +$mail->addHeader('To', 'recipient@example.com'); +$mail->setBody('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); + +echo $mail->send('dummy'); + +?> +--EXPECTF-- +Subject: My Subject +To: recipient@example.com +Message-ID: <%d.%s@mail.example.com> +User-Agent: Horde Application Framework 3.2 +Date: %s, %d %s %d %d:%d:%d %s%d +MIME-Version: 1.0 +Content-Type: text/plain; + charset=iso-8859-1; + DelSp="Yes"; + format="flowed" +Content-Disposition: inline +Content-Transfer-Encoding: 7bit + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do +eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad +minim veniam, quis nostrud exercitation ullamco laboris nisi ut +aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat +cupidatat non proident, sunt in culpa qui officia deserunt mollit anim +id est laborum. \ No newline at end of file diff --git a/framework/Mime/test/Horde/Mime/mail_dummy.inc b/framework/Mime/test/Horde/Mime/mail_dummy.inc new file mode 100644 index 000000000..b32349931 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/mail_dummy.inc @@ -0,0 +1,15 @@ +_cleanHTML($data); +} + +?> +--EXPECT-- +link +link +link +link +link +link +link diff --git a/framework/Mime/test/Horde/Mime/url1.html b/framework/Mime/test/Horde/Mime/url1.html new file mode 100644 index 000000000..0c88c1490 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url1.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url2.html b/framework/Mime/test/Horde/Mime/url2.html new file mode 100644 index 000000000..94c45a2ca --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url2.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url3.html b/framework/Mime/test/Horde/Mime/url3.html new file mode 100644 index 000000000..4c7eafed9 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url3.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url4.html b/framework/Mime/test/Horde/Mime/url4.html new file mode 100644 index 000000000..935612578 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url4.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url5.html b/framework/Mime/test/Horde/Mime/url5.html new file mode 100644 index 000000000..89dfbc68d --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url5.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url6.html b/framework/Mime/test/Horde/Mime/url6.html new file mode 100644 index 000000000..73ad9fc17 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url6.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/url7.html b/framework/Mime/test/Horde/Mime/url7.html new file mode 100644 index 000000000..cb5c80040 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/url7.html @@ -0,0 +1 @@ +link diff --git a/framework/Mime/test/Horde/Mime/viewer_php.phpt b/framework/Mime/test/Horde/Mime/viewer_php.phpt new file mode 100644 index 000000000..cceaa9198 --- /dev/null +++ b/framework/Mime/test/Horde/Mime/viewer_php.phpt @@ -0,0 +1,21 @@ +--TEST-- +PHP source viewer +--FILE-- +lineNumber(str_replace('<?php ', '', highlight_string(' +--EXPECT-- +
    +
  1. highlight_file(__FILE__);
  2. +
\ No newline at end of file