From b5aa418fc823759665f64441e486c2942d6f9877 Mon Sep 17 00:00:00 2001 From: Zaahid Bateson Date: Mon, 23 Aug 2021 09:46:57 -0700 Subject: [PATCH] Update to mail-mime-parser 2.0 --- composer.json | 2 +- composer.lock | 456 ++++++++++++++++++---- src/App/Actions/EmailAttachmentAction.php | 3 +- src/App/Actions/EmailDownloadAction.php | 2 +- src/App/Actions/EmailListRestAction.php | 2 +- src/App/Actions/EmailRestAction.php | 6 +- src/Domain/EmailFolderGateway.php | 23 +- web/emails.html | 6 +- 8 files changed, 394 insertions(+), 106 deletions(-) diff --git a/composer.json b/composer.json index 67c8375..8adf532 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "monolog/monolog": "~1.0", "aura/view": "~2.1.0", "aura/html": "~2.4.0", - "zbateson/mail-mime-parser": "~1.1.3", + "zbateson/mail-mime-parser": "~2.0.0", "jamesmoss/flywheel": "^0.5.2" }, "autoload": { diff --git a/composer.lock b/composer.lock index b9f8d89..5cb3077 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7ebc4f121092a5550d9a525dec62a9ee", + "content-hash": "b06444a59a407cc0b00e43fbca819e6c", "packages": [ { "name": "aura/di", @@ -53,6 +53,10 @@ "di", "di container" ], + "support": { + "issues": "https://github.com/auraphp/Aura.Di/issues", + "source": "https://github.com/auraphp/Aura.Di/tree/2.x" + }, "time": "2018-12-24T14:20:59+00:00" }, { @@ -100,6 +104,10 @@ "dispatcher", "factory" ], + "support": { + "issues": "https://github.com/auraphp/Aura.Dispatcher/issues", + "source": "https://github.com/auraphp/Aura.Dispatcher/tree/2.x" + }, "time": "2016-10-03T19:45:52+00:00" }, { @@ -163,20 +171,24 @@ "html", "input" ], + "support": { + "issues": "https://github.com/auraphp/Aura.Html/issues", + "source": "https://github.com/auraphp/Aura.Html/tree/develop-2" + }, "time": "2015-03-27T17:31:31+00:00" }, { "name": "aura/project-kernel", - "version": "2.1.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/auraphp/Aura.Project_Kernel.git", - "reference": "644475dbb4859c24aeeb309fd76a9c3e644ba9be" + "reference": "d51e2bc9c799271223ad8d7b5f0c9bcb8ee3287d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/auraphp/Aura.Project_Kernel/zipball/644475dbb4859c24aeeb309fd76a9c3e644ba9be", - "reference": "644475dbb4859c24aeeb309fd76a9c3e644ba9be", + "url": "https://api.github.com/repos/auraphp/Aura.Project_Kernel/zipball/d51e2bc9c799271223ad8d7b5f0c9bcb8ee3287d", + "reference": "d51e2bc9c799271223ad8d7b5f0c9bcb8ee3287d", "shasum": "" }, "require": { @@ -218,7 +230,11 @@ "kernel", "project" ], - "time": "2015-03-27T22:29:48+00:00" + "support": { + "issues": "https://github.com/auraphp/Aura.Project_Kernel/issues", + "source": "https://github.com/auraphp/Aura.Project_Kernel/tree/2.2.0" + }, + "time": "2021-08-01T16:41:50+00:00" }, { "name": "aura/router", @@ -272,6 +288,10 @@ "router", "routing" ], + "support": { + "issues": "https://github.com/auraphp/Aura.Router/issues", + "source": "https://github.com/auraphp/Aura.Router/tree/2.x" + }, "time": "2016-10-03T20:00:15+00:00" }, { @@ -335,27 +355,32 @@ "twostep view", "view" ], + "support": { + "issues": "https://github.com/auraphp/Aura.View/issues", + "source": "https://github.com/auraphp/Aura.View/tree/develop-2" + }, "time": "2015-03-27T18:49:40+00:00" }, { "name": "aura/web", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/auraphp/Aura.Web.git", - "reference": "6aa9f316e8d6f7f6e29577aa3c7bf4493a89bdd6" + "reference": "1f491f70336a54eb114a0eb169f79c4d70cebfcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/auraphp/Aura.Web/zipball/6aa9f316e8d6f7f6e29577aa3c7bf4493a89bdd6", - "reference": "6aa9f316e8d6f7f6e29577aa3c7bf4493a89bdd6", + "url": "https://api.github.com/repos/auraphp/Aura.Web/zipball/1f491f70336a54eb114a0eb169f79c4d70cebfcb", + "reference": "1f491f70336a54eb114a0eb169f79c4d70cebfcb", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "aura/di": "~2.0" + "aura/di": "~2.0", + "phpunit/phpunit": "~5.7 || ~4.8" }, "type": "library", "extra": { @@ -388,7 +413,11 @@ "request", "response" ], - "time": "2017-02-09T17:05:11+00:00" + "support": { + "issues": "https://github.com/auraphp/Aura.Web/issues", + "source": "https://github.com/auraphp/Aura.Web/tree/2.1.1" + }, + "time": "2021-02-05T02:48:58+00:00" }, { "name": "aura/web-kernel", @@ -443,50 +472,54 @@ "kernel", "web" ], + "support": { + "issues": "https://github.com/auraphp/Aura.Web_Kernel/issues", + "source": "https://github.com/auraphp/Aura.Web_Kernel/tree/2.x" + }, "time": "2016-10-03T21:38:39+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1dc8d9cba3897165e16d12bb13d813afb1eb3fe7", + "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -501,6 +534,11 @@ { "name": "Tobias Schultze", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -514,7 +552,11 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.0.0" + }, + "time": "2021-06-30T20:03:07+00:00" }, { "name": "jamesmoss/flywheel", @@ -570,20 +612,24 @@ "file", "flat" ], + "support": { + "issues": "https://github.com/jamesmoss/flywheel/issues", + "source": "https://github.com/jamesmoss/flywheel/tree/0.5.3" + }, "time": "2019-11-29T09:55:48+00:00" }, { "name": "monolog/monolog", - "version": "1.25.4", + "version": "1.26.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "3022efff205e2448b560c833c6fbbf91c3139168" + "reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/3022efff205e2448b560c833c6fbbf91c3139168", - "reference": "3022efff205e2448b560c833c6fbbf91c3139168", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c6b00f05152ae2c9b04a448f99c7590beb6042f5", + "reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5", "shasum": "" }, "require": { @@ -599,7 +645,7 @@ "graylog2/gelf-php": "~1.0", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", - "php-parallel-lint/php-parallel-lint": "^1.0", + "phpstan/phpstan": "^0.12.59", "phpunit/phpunit": "~4.5", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", @@ -619,11 +665,6 @@ "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Monolog\\": "src/Monolog" @@ -647,7 +688,177 @@ "logging", "psr-3" ], - "time": "2020-05-22T07:31:27+00:00" + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.26.1" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2021-05-28T08:32:12+00:00" + }, + { + "name": "pimple/pimple", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "86406047271859ffc13424a048541f4531f53601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/86406047271859ffc13424a048541f4531f53601", + "reference": "86406047271859ffc13424a048541f4531f53601", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "https://pimple.symfony.com", + "keywords": [ + "container", + "dependency injection" + ], + "support": { + "source": "https://github.com/silexphp/Pimple/tree/v3.4.0" + }, + "time": "2021-03-06T08:28:00+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" }, { "name": "psr/http-message", @@ -697,20 +908,23 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -734,7 +948,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -744,7 +958,10 @@ "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -784,24 +1001,28 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.17.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035" + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ba6c9c18db36235b859cc29b8372d1c01298c035", - "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/63b5bb7db83e5673936d6e3b8b3e022ff6474933", + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-iconv": "For best performance" @@ -809,7 +1030,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -847,24 +1068,41 @@ "portable", "shim" ], - "time": "2020-06-06T08:46:27+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -872,7 +1110,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -910,34 +1148,49 @@ "portable", "shim" ], - "time": "2020-06-06T08:46:27+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" }, { "name": "zbateson/mail-mime-parser", - "version": "1.1.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/zbateson/mail-mime-parser.git", - "reference": "05e7579f3f37a4fd67933f1d059fefd78db88835" + "reference": "da7b5913052d7b84fe789608761c4915281d0801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/05e7579f3f37a4fd67933f1d059fefd78db88835", - "reference": "05e7579f3f37a4fd67933f1d059fefd78db88835", + "url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/da7b5913052d7b84fe789608761c4915281d0801", + "reference": "da7b5913052d7b84fe789608761c4915281d0801", "shasum": "" }, "require": { - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^1.7.0|^2.0", "php": ">=5.4", - "zbateson/mb-wrapper": "^1.0", - "zbateson/stream-decorators": "^1.0.2" + "pimple/pimple": "^3.0", + "zbateson/mb-wrapper": "^1.0.1", + "zbateson/stream-decorators": "^1.0.6" }, "require-dev": { - "jms/serializer": "^1.1", "mikey179/vfsstream": "^1.6.0", - "phing/phing": "^2.15.0", - "phpdocumentor/phpdocumentor": "^2.9.0", - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5" + "sanmai/phpunit-legacy-adapter": "^6.3 || ^8.2" }, "suggest": { "ext-iconv": "For best support/performance", @@ -974,20 +1227,31 @@ "parser", "php-imap" ], - "time": "2019-11-20T00:05:22+00:00" + "support": { + "docs": "https://mail-mime-parser.org/#usage-guide", + "issues": "https://github.com/zbateson/mail-mime-parser/issues", + "source": "https://github.com/zbateson/mail-mime-parser" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2021-08-23T02:13:55+00:00" }, { "name": "zbateson/mb-wrapper", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/zbateson/mb-wrapper.git", - "reference": "723f25a1ab0e4e662efa8d89f38da751c799134a" + "reference": "721b3dfbf7ab75fee5ac60a542d7923ffe59ef6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/723f25a1ab0e4e662efa8d89f38da751c799134a", - "reference": "723f25a1ab0e4e662efa8d89f38da751c799134a", + "url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/721b3dfbf7ab75fee5ac60a542d7923ffe59ef6d", + "reference": "721b3dfbf7ab75fee5ac60a542d7923ffe59ef6d", "shasum": "" }, "require": { @@ -1018,7 +1282,6 @@ } ], "description": "Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation", - "homepage": "https://github.com/zbateson/StreamDecorators", "keywords": [ "charset", "encoding", @@ -1032,29 +1295,39 @@ "multibyte", "string" ], - "time": "2018-09-28T17:43:01+00:00" + "support": { + "issues": "https://github.com/zbateson/mb-wrapper/issues", + "source": "https://github.com/zbateson/mb-wrapper/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2020-10-21T22:14:27+00:00" }, { "name": "zbateson/stream-decorators", - "version": "1.0.3", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/zbateson/stream-decorators.git", - "reference": "a1873c22d2d6189931dd145d766157c6f75cc8d7" + "reference": "3403c4323bd1cd15fe54348b031b26b064c706af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/a1873c22d2d6189931dd145d766157c6f75cc8d7", - "reference": "a1873c22d2d6189931dd145d766157c6f75cc8d7", + "url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/3403c4323bd1cd15fe54348b031b26b064c706af", + "reference": "3403c4323bd1cd15fe54348b031b26b064c706af", "shasum": "" }, "require": { - "guzzlehttp/psr7": "^1.0.0", + "guzzlehttp/psr7": "^1.7.0|^2.0", "php": ">=5.4", "zbateson/mb-wrapper": "^1.0.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5" + "sanmai/phpunit-legacy-adapter": "^6.3 || ^8" }, "type": "library", "autoload": { @@ -1083,7 +1356,17 @@ "stream", "uuencode" ], - "time": "2020-02-10T00:22:40+00:00" + "support": { + "issues": "https://github.com/zbateson/stream-decorators/issues", + "source": "https://github.com/zbateson/stream-decorators/tree/1.0.6" + }, + "funding": [ + { + "url": "https://github.com/zbateson", + "type": "github" + } + ], + "time": "2021-07-08T19:01:59+00:00" } ], "packages-dev": [], @@ -1093,5 +1376,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.0.0" } diff --git a/src/App/Actions/EmailAttachmentAction.php b/src/App/Actions/EmailAttachmentAction.php index 68249ea..1096c1a 100644 --- a/src/App/Actions/EmailAttachmentAction.php +++ b/src/App/Actions/EmailAttachmentAction.php @@ -28,7 +28,8 @@ public function __invoke($emailId, $id, $name) { $message = $this->emailFolderGateway->fetchMessageById($emailId); if (!$message || !$message->getAttachmentPart(intval($id))) { - $response->status->set('404', 'Not Found'); + var_dump('here'); + //$response->status->set('404', 'Not Found'); return; } $part = $message->getAttachmentPart(intval($id)); diff --git a/src/App/Actions/EmailDownloadAction.php b/src/App/Actions/EmailDownloadAction.php index 0ef8bd3..d5e6df1 100644 --- a/src/App/Actions/EmailDownloadAction.php +++ b/src/App/Actions/EmailDownloadAction.php @@ -32,7 +32,7 @@ public function __invoke($id) return; } - $this->response->headers->set('Content-Disposition', 'attachment; filename="' . $id . '.mime"'); + $this->response->headers->set('Content-Disposition', 'attachment; filename="' . $id . '.eml"'); $this->response->content->setType('message/rfc822'); $this->response->content->set($message); } diff --git a/src/App/Actions/EmailListRestAction.php b/src/App/Actions/EmailListRestAction.php index 7742f98..6d6eafe 100644 --- a/src/App/Actions/EmailListRestAction.php +++ b/src/App/Actions/EmailListRestAction.php @@ -30,7 +30,7 @@ private function getArrayFromResult($res) } $returnFetchAllFields = [ 'subject', 'date', 'from', 'to', 'cc', 'bcc', - 'attachmentCount', 'preview' + 'hasAttachments', 'preview' ]; $ret = []; diff --git a/src/App/Actions/EmailRestAction.php b/src/App/Actions/EmailRestAction.php index 5460363..92b1c87 100644 --- a/src/App/Actions/EmailRestAction.php +++ b/src/App/Actions/EmailRestAction.php @@ -4,7 +4,7 @@ use Aura\Web\Request; use Aura\Web\Response; use ZBateson\MailboxFolder\Domain\EmailFolderGateway; -use ZBateson\MailMimeParser\Message; +use ZBateson\MailMimeParser\IMessage; use DOMDocument; use DOMNode; use DOMElement; @@ -33,7 +33,7 @@ public function __construct( $this->basepath = $basepath; } - private function replaceHtmlContentId(Message $message, $emailId) + private function replaceHtmlContentId(IMessage $message, $emailId) { return preg_replace_callback( [ @@ -99,7 +99,7 @@ private function sanitizeHtml($html) return $dom->saveHTML(); } - private function prepareHtml(Message $message, $emailId) + private function prepareHtml(IMessage $message, $emailId) { $html = $message->getHtmlContent(); if (!empty($html)) { diff --git a/src/Domain/EmailFolderGateway.php b/src/Domain/EmailFolderGateway.php index d12d7f5..d60032f 100644 --- a/src/Domain/EmailFolderGateway.php +++ b/src/Domain/EmailFolderGateway.php @@ -2,7 +2,7 @@ namespace ZBateson\MailboxFolder\Domain; use ZBateson\MailMimeParser\MailMimeParser; -use ZBateson\MailMimeParser\Message; +use ZBateson\MailMimeParser\IMessage; use JamesMoss\Flywheel\Repository; use JamesMoss\Flywheel\Document; use JamesMoss\Flywheel\Query; @@ -30,7 +30,7 @@ public function __construct(MailMimeParser $parser, Repository $repository, $pat $this->rescan(); } - public function getEmailArrayFromMessageHeader($header, Message $message) + public function getEmailArrayFromMessageHeader($header, IMessage $message) { $h = $message->getHeader($header); if ($h === null) { @@ -57,9 +57,7 @@ private function rescan() continue; } - $handle = fopen($fi->getPathname(), 'r'); - $message = $this->parser->parse($handle); - fclose($handle); + $message = $this->parser->parse(fopen($fi->getPathname(), 'r'), true); if ($message->getHeader('from') === null) { $this->logger->notice('Unable to parse email ' . $fi->getPathname() . '.'); @@ -89,7 +87,7 @@ private function rescan() 'to' => $this->getEmailArrayFromMessageHeader('to', $message), 'cc' => $this->getEmailArrayFromMessageHeader('cc', $message), 'bcc' => $this->getEmailArrayFromMessageHeader('bcc', $message), - 'attachmentCount' => $message->getAttachmentCount(), + 'hasAttachments' => ($message->getAttachmentPart(0) !== null), 'preview' => $preview ]); $email->setId($id); @@ -134,7 +132,14 @@ private function documentHasText($doc, $text) private function applyFilter(Query $query, array $filter) { - $query = $query->where('attachmentCount', '>', ($filter['attachments']) ? 0 : -1); + + $query = $query->where(function ($query) use ($filter) { + $query->where('hasAttachments', '==', $filter['attachments']); + if (!$filter['attachments']) { + $query->orWhere('hasAttachments', '!=', $filter['attachments']); + } + }); + if (!empty($filter['newerThan'])) { $query = $query->andWhere('date', '>', $filter['newerThan']); } @@ -214,9 +219,7 @@ public function fetchMessageById($id) } $filepath = $doc->file; - $handle = fopen($filepath, 'r'); - $message = $this->parser->parse($handle); - fclose($handle); + $message = $this->parser->parse(fopen($filepath, 'r'), true); $ctime = DateTime::createFromFormat('U', filectime($filepath)); $message->setRawHeader( diff --git a/web/emails.html b/web/emails.html index 34e0639..1f8eca5 100644 --- a/web/emails.html +++ b/web/emails.html @@ -52,9 +52,9 @@

Mailbox Folder Outbox

- attachment - markunread - + attachment + markunread +

To: