diff --git a/hphp/test/ext/test_ext.h b/hphp/test/ext/test_ext.h index 64d7d8eb0..0c3ec59cd 100644 --- a/hphp/test/ext/test_ext.h +++ b/hphp/test/ext/test_ext.h @@ -35,7 +35,6 @@ #include "hphp/facebook/extensions/tao/test_ext_tao.h" #include "hphp/facebook/extensions/urlextraction/test_ext_urlextraction.h" #include "hphp/test/ext/test_ext_curl.h" -#include "hphp/test/ext/test_ext_mailparse.h" #include "hphp/test/ext/test_ext_mcrypt.h" #include "hphp/test/ext/test_ext_memcached.h" #include "hphp/test/ext/test_ext_mysql.h" diff --git a/hphp/test/ext/test_ext_mailparse.cpp b/hphp/test/ext/test_ext_mailparse.cpp deleted file mode 100644 index 6943a6804..000000000 --- a/hphp/test/ext/test_ext_mailparse.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "hphp/test/ext/test_ext_mailparse.h" -#include "hphp/runtime/ext/ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtMailparse::RunTests(const std::string &which) { - bool ret = true; - - RUN_TEST(test_mail); - RUN_TEST(test_ezmlm_hash); - RUN_TEST(test_mailparse_msg_create); - RUN_TEST(test_mailparse_msg_free); - RUN_TEST(test_mailparse_msg_parse_file); - RUN_TEST(test_mailparse_msg_parse); - RUN_TEST(test_mailparse_msg_extract_part_file); - RUN_TEST(test_mailparse_msg_extract_whole_part_file); - RUN_TEST(test_mailparse_msg_extract_part); - RUN_TEST(test_mailparse_msg_get_part_data); - RUN_TEST(test_mailparse_msg_get_part); - RUN_TEST(test_mailparse_msg_get_structure); - RUN_TEST(test_mailparse_rfc822_parse_addresses); - RUN_TEST(test_mailparse_stream_encode); - RUN_TEST(test_mailparse_uudecode_all); - RUN_TEST(test_mailparse_determine_best_xfer_encoding); - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtMailparse::test_mail() { - //VCB(" "); - f_var_dump(iter.second()); - } - } - } - String output = f_ob_get_contents(); - - Variant expect = f_file_get_contents(expname.c_str()); - VS(output, expect); - f_ob_end_clean(); - } - - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_free() { - f_mailparse_msg_free(uninit_null()); - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_parse_file() { - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_parse() { - static const StaticString - s_headers("headers"), - s_to("to"); - String text = - "To: fred@bloggs.com\n" - "To: wez@thebrainroom.com\n" - "\n" - "hello, this is some text=hello."; - - Variant mime = f_mailparse_msg_create(); - f_mailparse_msg_parse(mime, text); - Variant data = f_mailparse_msg_get_part_data(mime); - VS(data[s_headers][s_to], "fred@bloggs.com, wez@thebrainroom.com"); - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_extract_part_file() { - // tested in test_mailparse_msg_extract_part() - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_extract_whole_part_file() { - // tested in test_mailparse_msg_extract_part() - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_extract_part() { - String text = - "To: fred@bloggs.com\n" - "Mime-Version: 1.0\n" - "Content-Type: text/plain\n" - "Subject: A simple MIME message\n" - "\n" - "hello, this is some text hello.\n" - "blah blah blah.\n"; - - Variant fp = f_tmpfile(); - f_fwrite(fp, text); - f_rewind(fp); - - f_ob_start(); - - Variant mime = f_mailparse_msg_create(); - f_mailparse_msg_parse(mime, text); - - echo("Extract to output\n"); - f_mailparse_msg_extract_part_file(mime, fp); - - echo("Extract and return as string\n"); - Variant result = f_mailparse_msg_extract_part_file(mime, fp, uninit_null()); - echo("-->\n"); - echo(result); - - echo("\nExtract to open file\n"); - Variant fpdest = f_tmpfile(); - f_mailparse_msg_extract_part_file(mime, fp, fpdest); - echo("\nrewinding\n"); - f_rewind(fpdest); - f_fpassthru(fpdest); - - echo("\nExtract via user function\n"); - f_mailparse_msg_extract_part_file(mime, fp); - - echo("\nExtract whole part to output\n"); - f_mailparse_msg_extract_whole_part_file(mime, fp); - - echo("\nExtract part from string to output\n"); - f_mailparse_msg_extract_part(mime, text); - f_fclose(fpdest); - f_fclose(fp); - - String output = f_ob_get_contents(); - f_ob_end_clean(); - - VS(output, - "Extract to output\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "Extract and return as string\n" - "-->\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "\n" - "Extract to open file\n" - "\n" - "rewinding\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "\n" - "Extract via user function\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "\n" - "Extract whole part to output\n" - "To: fred@bloggs.com\n" - "Mime-Version: 1.0\n" - "Content-Type: text/plain\n" - "Subject: A simple MIME message\n" - "\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "\n" - "Extract part from string to output\n" - "hello, this is some text hello.\n" - "blah blah blah.\n"); - - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_get_part_data() { - // tested in test_mailparse_msg_parse() - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_get_part() { - String msg = - "Received: from mail pickup service by hotmail.com with Microsoft\n" - "SMTPSVC;\n" - "Sat, 18 Feb 2006 22:58:14 -0800\n" - "Received: from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV;\n" - "Sun, 19 Feb 2006 06:58:13 +0000\n" - "\n" - "test"; - - Variant mail = f_mailparse_msg_create(); - f_mailparse_msg_parse(mail, msg); - Array arr = f_mailparse_msg_get_structure(mail); - for (ArrayIter iter(arr); iter; ++iter) { - Variant section = f_mailparse_msg_get_part(mail, iter.second()); - Variant info = f_mailparse_msg_get_part_data(section); - Array received = - CREATE_VECTOR2("from mail pickup service by hotmail.com with Microsoft", - "from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV;"); - VS(info, - Array(ArrayInit(11). - set(String("headers"), CREATE_MAP1("received", received)). - set(String("starting-pos"), 0). - set(String("starting-pos-body"), 200). - set(String("ending-pos"), 200). - set(String("ending-pos-body"), 200). - set(String("line-count"), 6). - set(String("body-line-count"), 0). - set(String("charset"), "us-ascii"). - set(String("transfer-encoding"), "8bit"). - set(String("content-type"), "text/plain"). - set(String("content-base"), "/"). - create())); - } - - return Count(true); -} - -bool TestExtMailparse::test_mailparse_msg_get_structure() { - // tested in test_mailparse_msg_create() - return Count(true); -} - -bool TestExtMailparse::test_mailparse_rfc822_parse_addresses() { - static const StaticString - s_display("display"), - s_address("address"), - s_is_group("is_group"); - Array addresses = - CREATE_VECTOR2("\":sysmail\"@ Some-Group. Some-Org, Muhammed." - "(I am the greatest) Ali @(the)Vegas.WBA", - "\"strange\":\":sysmail\"@ Some-Group. Some-Org, Muhammed." - "(I am the greatest) Ali @(the)Vegas.WBA;"); - - f_ob_start(); - - for (ArrayIter iter(addresses); iter; ++iter) { - Variant parsed = f_mailparse_rfc822_parse_addresses(iter.second()); - for (ArrayIter iter2(parsed); iter2; ++iter2) { - Variant pair = iter2.second(); - echo(pair[s_display]); echo("\n"); - echo(pair[s_address]); echo("\n"); - if (pair[s_is_group].toBoolean()) { - Variant sub = f_mailparse_rfc822_parse_addresses - (f_substr(pair[s_address], 1, f_strlen(pair[s_address]) - 2)); - for (ArrayIter iter3(sub); iter3; ++iter3) { - echo(" "); echo(iter3.second()[s_address]); echo("\n"); - } - } - } - echo("...\n"); - } - - String output = f_ob_get_contents(); - f_ob_end_clean(); - VS(output, - ":sysmail@Some-Group.Some-Org\n" - "\":sysmail\"@Some-Group.Some-Org\n" - "I am the greatest the\n" - "Muhammed.Ali@Vegas.WBA\n" - "...\n" - "strange\n" - ":\":sysmail\"@Some-Group.Some-Org,Muhammed.Ali@Vegas.WBA;\n" - " \":sysmail\"@Some-Group.Some-Org\n" - " Muhammed.Ali@Vegas.WBA\n" - "...\n"); - - return Count(true); -} - -bool TestExtMailparse::test_mailparse_stream_encode() { - { - String text = "hello, this is some text=hello."; - Variant fp = f_tmpfile(); - f_fwrite(fp, text); f_rewind(fp); - Variant dest = f_tmpfile(); - f_mailparse_stream_encode(fp, dest, "quoted-printable"); - f_rewind(dest); - Variant data = f_fread(dest, 2048); - VS(data, "hello, this is some text=3Dhello."); - } - { - String text = - "To: fred@bloggs.com\n" - "\n" - "blah blah blah From blah $ \" & £ blah blah blah blah blah\n" - "From the first of the month, things will be different!\n" - "blah blah blah From blah\n" - "Frome is a town in Somerset."; - - f_ob_start(); - - Variant fp = f_tmpfile(); - f_fwrite(fp, text); - f_rewind(fp); - - Variant fpdest = f_tmpfile(); - f_mailparse_stream_encode(fp, fpdest, "quoted-printable"); - f_rewind(fpdest); - f_fpassthru(fpdest); - - f_fclose(fp); - f_fclose(fpdest); - - String output = f_ob_get_contents(); - f_ob_end_clean(); - VS(output, - "To: fred@bloggs.com\r\n" - "\r\n" - "blah blah blah From blah $ \" & =C2=A3 blah blah blah blah blah\r\n" - "=46rom the first of the month, things will be different!\r\n" - "blah blah blah From blah\r\n" - "Frome is a town in Somerset."); - } - - return Count(true); -} - -bool TestExtMailparse::test_mailparse_uudecode_all() { - static const StaticString s_filename("filename"); - String text = - "To: fred@bloggs.com\n" - "\n" - "hello, this is some text hello.\n" - "blah blah blah.\n" - "\n" - "begin 644 test.txt\n" - "/=&AI>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtMailparse : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); - - bool test_mail(); - bool test_ezmlm_hash(); - bool test_mailparse_msg_create(); - bool test_mailparse_msg_free(); - bool test_mailparse_msg_parse_file(); - bool test_mailparse_msg_parse(); - bool test_mailparse_msg_extract_part_file(); - bool test_mailparse_msg_extract_whole_part_file(); - bool test_mailparse_msg_extract_part(); - bool test_mailparse_msg_get_part_data(); - bool test_mailparse_msg_get_part(); - bool test_mailparse_msg_get_structure(); - bool test_mailparse_rfc822_parse_addresses(); - bool test_mailparse_stream_encode(); - bool test_mailparse_uudecode_all(); - bool test_mailparse_determine_best_xfer_encoding(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_MAILPARSE_H_ diff --git a/hphp/test/ext/test_ext_mailparse.mime.exp b/hphp/test/ext/test_ext_mailparse.mime.exp deleted file mode 100644 index ac7d399f7..000000000 --- a/hphp/test/ext/test_ext_mailparse.mime.exp +++ /dev/null @@ -1,39 +0,0 @@ -Message: mime - -Part 1 -body-line-count => int(27) -charset => string(8) "us-ascii" -content-base => string(1) "/" -content-boundary => string(41) "----=_NextPart_000_0007_01C2566B.DA7C64F0" -content-type => string(15) "multipart/mixed" -ending-pos => int(1488) -line-count => int(47) -starting-pos => int(0) -starting-pos-body => int(856) -transfer-encoding => string(4) "8bit" - - Part 1.1 - body-line-count => int(1) - charset => string(8) "us-ascii" - content-base => string(1) "/" - content-charset => string(8) "us-ascii" - content-type => string(10) "text/plain" - ending-pos => int(1081) - line-count => int(5) - starting-pos => int(949) - starting-pos-body => int(1032) - transfer-encoding => string(4) "7bit" - - Part 1.2 - body-line-count => int(7) - charset => string(8) "us-ascii" - content-base => string(1) "/" - content-disposition => string(10) "attachment" - content-name => string(6) "README" - content-type => string(24) "application/octet-stream" - disposition-filename => string(6) "README" - ending-pos => int(1435) - line-count => int(13) - starting-pos => int(1128) - starting-pos-body => int(1286) - transfer-encoding => string(16) "quoted-printable" diff --git a/hphp/test/ext/test_ext_mailparse.phpcvs1.exp b/hphp/test/ext/test_ext_mailparse.phpcvs1.exp deleted file mode 100644 index 81f8ac377..000000000 --- a/hphp/test/ext/test_ext_mailparse.phpcvs1.exp +++ /dev/null @@ -1,26 +0,0 @@ -Message: phpcvs1 - -Part 1 -body-line-count => int(105) -charset => string(8) "us-ascii" -content-base => string(1) "/" -content-boundary => string(37) "=====================_71195359==_.ALT" -content-type => string(21) "multipart/alternative" -ending-pos => int(5425) -line-count => int(141) -starting-pos => int(0) -starting-pos-body => int(1976) -transfer-encoding => string(4) "8bit" - - Part 1.1 - body-line-count => int(98) - charset => string(10) "iso-8859-1" - content-base => string(1) "/" - content-charset => string(10) "iso-8859-1" - content-format => string(6) "flowed" - content-type => string(10) "text/plain" - ending-pos => int(5378) - line-count => int(101) - starting-pos => int(2017) - starting-pos-body => int(2127) - transfer-encoding => string(16) "quoted-printable" diff --git a/hphp/test/ext/test_ext_mailparse.qp.exp b/hphp/test/ext/test_ext_mailparse.qp.exp deleted file mode 100644 index 802d6565e..000000000 --- a/hphp/test/ext/test_ext_mailparse.qp.exp +++ /dev/null @@ -1,39 +0,0 @@ -Message: qp - -Part 1 -body-line-count => int(27) -charset => string(8) "us-ascii" -content-base => string(1) "/" -content-boundary => string(41) "----=_NextPart_000_0003_01C2566B.C7AC6A50" -content-type => string(15) "multipart/mixed" -ending-pos => int(1485) -line-count => int(47) -starting-pos => int(0) -starting-pos-body => int(859) -transfer-encoding => string(4) "8bit" - - Part 1.1 - body-line-count => int(1) - charset => string(8) "us-ascii" - content-base => string(1) "/" - content-charset => string(8) "us-ascii" - content-type => string(10) "text/plain" - ending-pos => int(1076) - line-count => int(5) - starting-pos => int(952) - starting-pos-body => int(1035) - transfer-encoding => string(4) "7bit" - - Part 1.2 - body-line-count => int(7) - charset => string(8) "us-ascii" - content-base => string(1) "/" - content-disposition => string(10) "attachment" - content-name => string(6) "README" - content-type => string(24) "application/octet-stream" - disposition-filename => string(6) "README" - ending-pos => int(1432) - line-count => int(13) - starting-pos => int(1123) - starting-pos-body => int(1281) - transfer-encoding => string(16) "quoted-printable" diff --git a/hphp/test/ext/test_ext_mailparse.uue.exp b/hphp/test/ext/test_ext_mailparse.uue.exp deleted file mode 100644 index 4c7329a00..000000000 --- a/hphp/test/ext/test_ext_mailparse.uue.exp +++ /dev/null @@ -1,12 +0,0 @@ -Message: uue - -Part 1 -body-line-count => int(10) -charset => string(8) "us-ascii" -content-base => string(1) "/" -content-type => string(10) "text/plain" -ending-pos => int(972) -line-count => int(27) -starting-pos => int(0) -starting-pos-body => int(760) -transfer-encoding => string(4) "8bit" diff --git a/hphp/test/slow/ext_mailparse/ext_mailparse.php b/hphp/test/slow/ext_mailparse/ext_mailparse.php new file mode 100644 index 000000000..95de69e07 --- /dev/null +++ b/hphp/test/slow/ext_mailparse/ext_mailparse.php @@ -0,0 +1,308 @@ + $partname) { + $depth = count(explode(".", $partname)) - 1; + $indent = str_repeat(" ", $depth * 2); + + $subpart = mailparse_msg_get_part($mime, $partname); + if (!$subpart) { + var_dump($partname); echo("\n"); + var_dump($arr); + break; + } + + $data = mailparse_msg_get_part_data($subpart); + echo "\n"; echo $indent; echo "Part "; echo $partname; echo "\n"; + ksort($data); + foreach ($data as $key => $second) { + if ($key != "headers" && $key != "ending-pos-body") { + echo $indent; echo $key; echo " => "; + var_dump($second); + } + } + } +} + +////////////////////////////////////////////////////////////////////// + +$text = + "To: fred@bloggs.com\n". + "To: wez@thebrainroom.com\n". + "\n". + "hello, this is some text=hello."; + +$mime = mailparse_msg_create(); +mailparse_msg_parse($mime, $text); +$data = mailparse_msg_get_part_data($mime); +VS($data['headers']['to'], "fred@bloggs.com, wez@thebrainroom.com"); + +////////////////////////////////////////////////////////////////////// + +$text = + "To: fred@bloggs.com\n". + "Mime-Version: 1.0\n". + "Content-Type: text/plain\n". + "Subject: A simple MIME message\n". + "\n". + "hello, this is some text hello.\n". + "blah blah blah.\n"; + +$fp = tmpfile(); +fwrite($fp, $text); +rewind($fp); + +ob_start(); + +$mime = mailparse_msg_create(); +mailparse_msg_parse($mime, $text); + +echo("Extract to output\n"); +mailparse_msg_extract_part_file($mime, $fp); + +echo("Extract and return as string\n"); +$result = mailparse_msg_extract_part_file($mime, $fp, null); +echo("-->\n"); +echo($result); + +echo("\nExtract to open file\n"); +$fpdest = tmpfile(); +mailparse_msg_extract_part_file($mime, $fp, $fpdest); +echo("\nrewinding\n"); +rewind($fpdest); +fpassthru($fpdest); + +echo("\nExtract via user function\n"); +mailparse_msg_extract_part_file($mime, $fp); + +echo("\nExtract whole part to output\n"); +mailparse_msg_extract_whole_part_file($mime, $fp); + +echo("\nExtract part from string to output\n"); +mailparse_msg_extract_part($mime, $text); +fclose($fpdest); +fclose($fp); + +$output = ob_get_contents(); +ob_end_clean(); + +VS($output, + "Extract to output\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "Extract and return as string\n". + "-->\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "\n". + "Extract to open file\n". + "\n". + "rewinding\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "\n". + "Extract via user function\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "\n". + "Extract whole part to output\n". + "To: fred@bloggs.com\n". + "Mime-Version: 1.0\n". + "Content-Type: text/plain\n". + "Subject: A simple MIME message\n". + "\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "\n". + "Extract part from string to output\n". + "hello, this is some text hello.\n". + "blah blah blah.\n"); + +////////////////////////////////////////////////////////////////////// + +$msg = + "Received: from mail pickup service by hotmail.com with Microsoft\n". + "SMTPSVC;\n". + "Sat, 18 Feb 2006 22:58:14 -0800\n". + "Received: from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV;\n". + "Sun, 19 Feb 2006 06:58:13 +0000\n". + "\n". + "test"; + +$mail = mailparse_msg_create(); +mailparse_msg_parse($mail, $msg); +$arr = mailparse_msg_get_structure($mail); +foreach ($arr as $first => $second) { + $section = mailparse_msg_get_part($mail, $second); + $info = mailparse_msg_get_part_data($section); + $received = + array("from mail pickup service by hotmail.com with Microsoft", + "from 66.178.40.49 by BAY116-DAV8.phx.gbl with DAV;"); + VS($info, + array( + "headers" => array("received" => $received), + "starting-pos" => 0, + "starting-pos-body" => 200, + "ending-pos" => 200, + "ending-pos-body" => 200, + "line-count" => 6, + "body-line-count" => 0, + "charset" => "us-ascii", + "transfer-encoding" => "8bit", + "content-type" => "text/plain", + "content-base" => "/" + ) + ); +} + +////////////////////////////////////////////////////////////////////// + +$addresses = + array("\":sysmail\"@ Some-Group. Some-Org, Muhammed.". + "(I am the greatest) Ali @(the)Vegas.WBA", + "\"strange\":\":sysmail\"@ Some-Group. Some-Org, Muhammed.". + "(I am the greatest) Ali @(the)Vegas.WBA;"); + +ob_start(); + +foreach ($addresses as $first => $second) { + $parsed = mailparse_rfc822_parse_addresses($second); + foreach ($parsed as $pfirst => $psecond) { + $pair = $psecond; + echo($pair['display']); echo("\n"); + echo($pair['address']); echo("\n"); + if ($pair['is_group']) { + $sub = mailparse_rfc822_parse_addresses + (substr($pair['address'], 1, strlen($pair['address']) - 2)); + foreach ($sub as $blah) { + echo(" "); echo($blah['address']); echo("\n"); + } + } + } + echo("...\n"); +} + +$output = ob_get_contents(); +ob_end_clean(); +VS($output, + ":sysmail@Some-Group.Some-Org\n". + "\":sysmail\"@Some-Group.Some-Org\n". + "I am the greatest the\n". + "Muhammed.Ali@Vegas.WBA\n". + "...\n". + "strange\n". + ":\":sysmail\"@Some-Group.Some-Org,Muhammed.Ali@Vegas.WBA;\n". + " \":sysmail\"@Some-Group.Some-Org\n". + " Muhammed.Ali@Vegas.WBA\n". + "...\n"); + +////////////////////////////////////////////////////////////////////// + + $text = "hello, this is some text=hello."; + $fp = tmpfile(); + fwrite($fp, $text); rewind($fp); + $dest = tmpfile(); + mailparse_stream_encode($fp, $dest, "quoted-printable"); + rewind($dest); + $data = fread($dest, 2048); + VS($data, "hello, this is some text=3Dhello."); + + $text = + "To: fred@bloggs.com\n". + "\n". + "blah blah blah From blah $ \" & £ blah blah blah blah blah\n". + "From the first of the month, things will be different!\n". + "blah blah blah From blah\n". + "Frome is a town in Somerset."; + + ob_start(); + + $fp = tmpfile(); + fwrite($fp, $text); + rewind($fp); + + $fpdest = tmpfile(); + mailparse_stream_encode($fp, $fpdest, "quoted-printable"); + rewind($fpdest); + fpassthru($fpdest); + + fclose($fp); + fclose($fpdest); + + $output = ob_get_contents(); + ob_end_clean(); + VS($output, + "To: fred@bloggs.com\r\n". + "\r\n". + "blah blah blah From blah $ \" & =C2=A3 blah blah blah blah blah\r\n". + "=46rom the first of the month, things will be different!\r\n". + "blah blah blah From blah\r\n". + "Frome is a town in Somerset."); + +////////////////////////////////////////////////////////////////////// + +$text = + "To: fred@bloggs.com\n". + "\n". + "hello, this is some text hello.\n". + "blah blah blah.\n". + "\n". + "begin 644 test.txt\n". + "/=&AI int(27) +charset => string(8) "us-ascii" +content-base => string(1) "/" +content-boundary => string(41) "----=_NextPart_000_0007_01C2566B.DA7C64F0" +content-type => string(15) "multipart/mixed" +ending-pos => int(1488) +line-count => int(47) +starting-pos => int(0) +starting-pos-body => int(856) +transfer-encoding => string(4) "8bit" + + Part 1.1 + body-line-count => int(1) + charset => string(8) "us-ascii" + content-base => string(1) "/" + content-charset => string(8) "us-ascii" + content-type => string(10) "text/plain" + ending-pos => int(1081) + line-count => int(5) + starting-pos => int(949) + starting-pos-body => int(1032) + transfer-encoding => string(4) "7bit" + + Part 1.2 + body-line-count => int(7) + charset => string(8) "us-ascii" + content-base => string(1) "/" + content-disposition => string(10) "attachment" + content-name => string(6) "README" + content-type => string(24) "application/octet-stream" + disposition-filename => string(6) "README" + ending-pos => int(1435) + line-count => int(13) + starting-pos => int(1128) + starting-pos-body => int(1286) + transfer-encoding => string(16) "quoted-printable" +Message: phpcvs1 + +Part 1 +body-line-count => int(105) +charset => string(8) "us-ascii" +content-base => string(1) "/" +content-boundary => string(37) "=====================_71195359==_.ALT" +content-type => string(21) "multipart/alternative" +ending-pos => int(5425) +line-count => int(141) +starting-pos => int(0) +starting-pos-body => int(1976) +transfer-encoding => string(4) "8bit" + + Part 1.1 + body-line-count => int(98) + charset => string(10) "iso-8859-1" + content-base => string(1) "/" + content-charset => string(10) "iso-8859-1" + content-format => string(6) "flowed" + content-type => string(10) "text/plain" + ending-pos => int(5378) + line-count => int(101) + starting-pos => int(2017) + starting-pos-body => int(2127) + transfer-encoding => string(16) "quoted-printable" +Message: qp + +Part 1 +body-line-count => int(27) +charset => string(8) "us-ascii" +content-base => string(1) "/" +content-boundary => string(41) "----=_NextPart_000_0003_01C2566B.C7AC6A50" +content-type => string(15) "multipart/mixed" +ending-pos => int(1485) +line-count => int(47) +starting-pos => int(0) +starting-pos-body => int(859) +transfer-encoding => string(4) "8bit" + + Part 1.1 + body-line-count => int(1) + charset => string(8) "us-ascii" + content-base => string(1) "/" + content-charset => string(8) "us-ascii" + content-type => string(10) "text/plain" + ending-pos => int(1076) + line-count => int(5) + starting-pos => int(952) + starting-pos-body => int(1035) + transfer-encoding => string(4) "7bit" + + Part 1.2 + body-line-count => int(7) + charset => string(8) "us-ascii" + content-base => string(1) "/" + content-disposition => string(10) "attachment" + content-name => string(6) "README" + content-type => string(24) "application/octet-stream" + disposition-filename => string(6) "README" + ending-pos => int(1432) + line-count => int(13) + starting-pos => int(1123) + starting-pos-body => int(1281) + transfer-encoding => string(16) "quoted-printable" +Message: uue + +Part 1 +body-line-count => int(10) +charset => string(8) "us-ascii" +content-base => string(1) "/" +content-type => string(10) "text/plain" +ending-pos => int(972) +line-count => int(27) +starting-pos => int(0) +starting-pos-body => int(760) +transfer-encoding => string(4) "8bit" +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) diff --git a/hphp/test/ext/test_ext_mailparse.mime.txt b/hphp/test/slow/ext_mailparse/test_ext_mailparse.mime.txt similarity index 100% rename from hphp/test/ext/test_ext_mailparse.mime.txt rename to hphp/test/slow/ext_mailparse/test_ext_mailparse.mime.txt diff --git a/hphp/test/ext/test_ext_mailparse.phpcvs1.txt b/hphp/test/slow/ext_mailparse/test_ext_mailparse.phpcvs1.txt similarity index 100% rename from hphp/test/ext/test_ext_mailparse.phpcvs1.txt rename to hphp/test/slow/ext_mailparse/test_ext_mailparse.phpcvs1.txt diff --git a/hphp/test/ext/test_ext_mailparse.qp.txt b/hphp/test/slow/ext_mailparse/test_ext_mailparse.qp.txt similarity index 100% rename from hphp/test/ext/test_ext_mailparse.qp.txt rename to hphp/test/slow/ext_mailparse/test_ext_mailparse.qp.txt diff --git a/hphp/test/ext/test_ext_mailparse.uue.txt b/hphp/test/slow/ext_mailparse/test_ext_mailparse.uue.txt similarity index 83% rename from hphp/test/ext/test_ext_mailparse.uue.txt rename to hphp/test/slow/ext_mailparse/test_ext_mailparse.uue.txt index b45c05105..c4b5dd54e 100644 --- a/hphp/test/ext/test_ext_mailparse.uue.txt +++ b/hphp/test/slow/ext_mailparse/test_ext_mailparse.uue.txt @@ -1,10 +1,11 @@ Return-Path: Received: from TITAN (titan.brainnet.i [192.168.2.7]) - by zaneeb.brainnet.i (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) with ESMTP id g87Be5721229 - for ; Sat, 7 Sep 2002 12:40:05 +0100 + by zaneeb.brainnet.i (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) with ESMTP id g87Be5721229 + for ; Sat, 7 Sep 2002 12:40:05 +0100 X-Authentication-Warning: zaneeb.brainnet.i: Host titan.brainnet.i [192.168.2.7] claimed to be TITAN From: "Wez Furlong" To: + Subject: UUEncoded attachments Date: Sat, 7 Sep 2002 12:39:55 +0100 Message-ID: <000001c25663$4cd5b460$0702a8c0@TITAN> @@ -25,3 +26,5 @@ K86EL<&%R