diff --git a/README.md b/README.md index ffe1a31..ecce9d6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Laravel Mailbox 📬 -[![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/laravel-mailbox.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-mailbox) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/programic/laravel-mailbox.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-mailbox) [![Build Status](https://img.shields.io/travis/beyondcode/laravel-mailbox/master.svg?style=flat-square)](https://travis-ci.org/beyondcode/laravel-mailbox) [![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/laravel-mailbox.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/laravel-mailbox) -[![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-mailbox.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-mailbox) +[![Total Downloads](https://img.shields.io/packagist/dt/programic/laravel-mailbox.svg?style=flat-square)](https://packagist.org/packages/programic/laravel-mailbox) Handle incoming emails in your Laravel application. @@ -16,23 +16,14 @@ Mailbox::from('{username}@gmail.com', function (InboundEmail $email, $username) }); ``` -[![https://phppackagedevelopment.com](https://beyondco.de/courses/phppd.jpg)](https://phppackagedevelopment.com) - -If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming [PHP Package Development](https://phppackagedevelopment.com) video course. - - ## Installation You can install the package via composer: ```bash -composer require beyondcode/laravel-mailbox +composer require programic/laravel-mailbox ``` -## Usage - -Take a look at the [official documentation](https://docs.beyondco.de/laravel-mailbox). - ### Testing ``` bash @@ -47,10 +38,6 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen Please see [CONTRIBUTING](CONTRIBUTING.md) for details. -### Security - -If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker. - ## Credits - [Marcel Pociot](https://github.com/mpociot) diff --git a/composer.json b/composer.json index 46d849f..a29d36e 100644 --- a/composer.json +++ b/composer.json @@ -1,35 +1,35 @@ { - "name": "beyondcode/laravel-mailbox", + "name": "programic/laravel-mailbox", "description": "Handle incoming emails in your Laravel application.", "keywords": [ - "beyondcode", + "programic", "laravel-mailbox" ], - "homepage": "https://github.com/beyondcode/laravel-mailbox", + "homepage": "https://github.com/programic/laravel-mailbox", "license": "MIT", "authors": [ { "name": "Marcel Pociot", "email": "marcel@beyondco.de", - "homepage": "https://beyondcode.de/", + "homepage": "https://programic.com/", "role": "Developer" } ], "require": { "php": "^8.0", - "illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/log": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/log": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "willdurand/email-reply-parser": "^2.8", "zbateson/mail-mime-parser": "^1.1" }, "require-dev": { "laminas/laminas-mail": "^2.13", "mockery/mockery": "^1.2", - "orchestra/testbench": "^4.0|^5.0|^7.0|^8.0", - "phpunit/phpunit": "^7.0|^8.0|^9.3" + "orchestra/testbench": "^4.0|^5.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^7.0|^8.0|^9.3|^10.0|^11.0" }, "autoload": { "psr-4": { diff --git a/src/Http/Requests/SendGridRequest.php b/src/Http/Requests/SendGridRequest.php index 2660901..5187625 100644 --- a/src/Http/Requests/SendGridRequest.php +++ b/src/Http/Requests/SendGridRequest.php @@ -10,9 +10,7 @@ class SendGridRequest extends FormRequest { public function validator() { - return Validator::make($this->all(), [ - 'email' => 'required', - ]); + return Validator::make($this->all(), []); } public function email() diff --git a/src/InboundEmail.php b/src/InboundEmail.php index 089bb02..f95d3f9 100644 --- a/src/InboundEmail.php +++ b/src/InboundEmail.php @@ -34,10 +34,16 @@ protected static function boot() }); } + public static function fixEncoding(string $s): string + { + // removes xD800-xDFFF, x110000 and higher + return htmlspecialchars_decode(htmlspecialchars($s, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8'), ENT_NOQUOTES); + } + public static function fromMessage($message) { return new static([ - 'message' => $message, + 'message' => self::fixEncoding($message), ]); } diff --git a/src/Routing/Router.php b/src/Routing/Router.php index 390d839..664eb6f 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -83,7 +83,7 @@ protected function createRoute(string $subject, string $pattern, $action): Route public function callMailboxes(InboundEmail $email) { - if ($email->isValid()) { +// if ($email->isValid()) { $matchedRoutes = $this->routes->match($email)->map(function (Route $route) use ($email) { $route->run($email); }); @@ -101,7 +101,7 @@ public function callMailboxes(InboundEmail $email) if ($this->shouldStoreInboundEmails() && $this->shouldStoreAllInboundEmails($matchedRoutes)) { $this->storeEmail($email); } - } +// } } protected function shouldStoreInboundEmails(): bool