From ac6cdf2a846c1cd4beb69992438ed81546c345f3 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Sun, 29 Oct 2017 09:43:13 -0100 Subject: [PATCH] first commit --- .gitignore | 4 + CHANGELOG.md | 3 + LICENSE | 167 +++------ Makefile | 64 ++++ README.md | 48 ++- appinfo/app.php | 32 ++ appinfo/autoload.php | 34 ++ appinfo/info.xml | 35 ++ appinfo/routes.php | 33 ++ composer.json | 15 + composer.lock | 99 +++++ lib/AppInfo/Application.php | 43 +++ lib/Command/Addresses.php | 199 ++++++++++ lib/Controller/RemoteController.php | 83 +++++ .../AddressAlreadyExistException.php | 32 ++ lib/Exceptions/AddressInfoException.php | 32 ++ lib/Exceptions/FakeException.php | 32 ++ lib/Exceptions/InvalidAddressException.php | 32 ++ lib/Exceptions/MailHeadersException.php | 32 ++ lib/Exceptions/MissingArgumentException.php | 32 ++ lib/Exceptions/NotAFolderException.php | 32 ++ lib/Exceptions/UnknownAddressException.php | 32 ++ lib/NextcloudMailCatcher.php | 222 ++++++++++++ lib/Service/ConfigService.php | 117 ++++++ lib/Service/MailService.php | 342 ++++++++++++++++++ lib/Service/MiscService.php | 67 ++++ screenshots/v0.1.0.png | Bin 0 -> 36982 bytes 27 files changed, 1751 insertions(+), 112 deletions(-) create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 Makefile create mode 100644 appinfo/app.php create mode 100644 appinfo/autoload.php create mode 100644 appinfo/info.xml create mode 100644 appinfo/routes.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 lib/AppInfo/Application.php create mode 100644 lib/Command/Addresses.php create mode 100644 lib/Controller/RemoteController.php create mode 100644 lib/Exceptions/AddressAlreadyExistException.php create mode 100644 lib/Exceptions/AddressInfoException.php create mode 100644 lib/Exceptions/FakeException.php create mode 100644 lib/Exceptions/InvalidAddressException.php create mode 100644 lib/Exceptions/MailHeadersException.php create mode 100644 lib/Exceptions/MissingArgumentException.php create mode 100644 lib/Exceptions/NotAFolderException.php create mode 100644 lib/Exceptions/UnknownAddressException.php create mode 100644 lib/NextcloudMailCatcher.php create mode 100644 lib/Service/ConfigService.php create mode 100644 lib/Service/MailService.php create mode 100644 lib/Service/MiscService.php create mode 100644 screenshots/v0.1.0.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f6400d9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +\.idea/ + +vendor/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ad1d626 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog +All notable changes to this project will be documented in this file. + diff --git a/LICENSE b/LICENSE index 9cecc1d..4ec8c3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -619,56 +617,3 @@ Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0a92c37 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +app_name=files_frommail + +project_dir=$(CURDIR)/../$(app_name) +build_dir=$(CURDIR)/build/artifacts +appstore_dir=$(build_dir)/appstore +source_dir=$(build_dir)/source +sign_dir=$(build_dir)/sign +package_name=$(app_name) +cert_dir=$(HOME)/.nextcloud/certificates +codecov_token_dir=$(HOME)/.nextcloud/codecov_token +version+=0.1.0 + +all: appstore + +release: appstore create-tag + +create-tag: + git tag -s -a v$(version) -m "Tagging the $(version) release." + git push origin v$(version) + +clean: + rm -rf $(build_dir) + rm -rf node_modules + +composer: + composer install + +test: SHELL:=/bin/bash +test: composer + phpunit --coverage-clover=coverage.xml --configuration=tests/phpunit.xml tests + @if [ -f $(codecov_token_dir)/$(app_name) ]; then \ + bash <(curl -s https://codecov.io/bash) -t @$(codecov_token_dir)/$(app_name) ; \ + fi + + +appstore: composer clean + mkdir -p $(sign_dir) + rsync -a \ + --exclude=/build \ + --exclude=/docs \ + --exclude=/l10n/templates \ + --exclude=/l10n/.tx \ + --exclude=/tests \ + --exclude=/.git \ + --exclude=/.github \ + --exclude=/composer.json \ + --exclude=/composer.lock \ + --exclude=/l10n/l10n.pl \ + --exclude=/CONTRIBUTING.md \ + --exclude=/issue_template.md \ + --exclude=/README.md \ + --exclude=/.gitattributes \ + --exclude=.gitignore \ + --exclude=/.scrutinizer.yml \ + --exclude=/.travis.yml \ + --exclude=/Makefile \ + --exclude=/vendor/picocms/pico/index.php \ + $(project_dir)/ $(sign_dir)/$(app_name) + tar -czf $(build_dir)/$(app_name)-$(version).tar.gz \ + -C $(sign_dir) $(app_name) + @if [ -f $(cert_dir)/$(app_name).key ]; then \ + echo "Signing packageā€¦"; \ + openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(version).tar.gz | openssl base64; \ + fi diff --git a/README.md b/README.md index 0b54698..bd996ea 100644 --- a/README.md +++ b/README.md @@ -1 +1,47 @@ -# files_frommail \ No newline at end of file +### installation + +- need mailparse + +``` +pecl install mailparse +``` + +if fail: + +``` +pecl download mailparse +tar -zxvf mailparse-3.0.2.tgz +cd mailparse-3.0.2/ +phpize +edit mailparse.c +``` + +remove lines 34-37: +> #if !HAVE_MBSTRING +> #error The mailparse extension requires the mbstring extension! +> #endif + +``` +./configure --with-php-config=/usr/bin/php-config +make +make install + +echo "extension=mailparse.so" > /etc/php/7.0/mods-available/mailparse.ini + + cd /etc/php/7.0/apache2/conf.d/ +ln -s /etc/php/7.0/mods-available/mailparse.ini ./20-mailparse.ini +apachectl restart +``` + + + +### configuration MTA: + +new entry in /etc/aliases: + +> files-artificial: "|/usr/bin/php -f /path/to/NextcloudMailCatcher.php" + +- execute _newaliases_ + +- if virtual alias, create a new alias: files@artificial-owl.com -> files@hostname.example.net + diff --git a/appinfo/app.php b/appinfo/app.php new file mode 100644 index 0000000..f23c3ca --- /dev/null +++ b/appinfo/app.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\AppInfo; + +require_once __DIR__ . '/autoload.php'; + +new Application(); + diff --git a/appinfo/autoload.php b/appinfo/autoload.php new file mode 100644 index 0000000..87886c7 --- /dev/null +++ b/appinfo/autoload.php @@ -0,0 +1,34 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\AppInfo; + +$composerDir = __DIR__ . '/../vendor/'; + +if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) { + require_once $composerDir . 'autoload.php'; +} + diff --git a/appinfo/info.xml b/appinfo/info.xml new file mode 100644 index 0000000..25d5e48 --- /dev/null +++ b/appinfo/info.xml @@ -0,0 +1,35 @@ + + + files_frommail + Files From Mail + Recover your email attachments from your cloud + + + 0.1.0 + agpl + Maxence Lange + Files_FromMail + + https://github.com/daita/files_frommail/wiki + + tools + https://github.com/daita/files_frommail + https://github.com/daita/files_frommail/issues + https://github.com/daita/files_frommail.git + + + + + + + + + OCA\Files_FromMail\Command\Addresses + + + diff --git a/appinfo/routes.php b/appinfo/routes.php new file mode 100644 index 0000000..35ffd3a --- /dev/null +++ b/appinfo/routes.php @@ -0,0 +1,33 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +return [ + 'routes' => [ + ['name' => 'Remote#getContent', 'url' => '/remote/', 'verb' => 'PUT'] + ] +]; + + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cb43364 --- /dev/null +++ b/composer.json @@ -0,0 +1,15 @@ +{ + "name": "nextcloud/files_frommail", + "description": "Files From Mail", + "minimum-stability": "stable", + "license": "proprietary", + "authors": [ + { + "name": "Maxence Lange", + "email": "maxence@artificial-owl.com" + } + ], + "require": { + "php-mime-mail-parser/php-mime-mail-parser": "2.9.2" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..e233a0b --- /dev/null +++ b/composer.lock @@ -0,0 +1,99 @@ +{ + "_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", + "This file is @generated automatically" + ], + "hash": "4f2c7dbe166d16f4fd62b38788e91db7", + "content-hash": "3063322984d481b8e479615f0c5d3e0c", + "packages": [ + { + "name": "php-mime-mail-parser/php-mime-mail-parser", + "version": "2.9.2", + "source": { + "type": "git", + "url": "https://github.com/php-mime-mail-parser/php-mime-mail-parser.git", + "reference": "a3d5b16a4282e4afa5e4dd3bde7ce3213f929b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mime-mail-parser/php-mime-mail-parser/zipball/a3d5b16a4282e4afa5e4dd3bde7ce3213f929b9d", + "reference": "a3d5b16a4282e4afa5e4dd3bde7ce3213f929b9d", + "shasum": "" + }, + "require": { + "ext-mailparse": "*", + "php": "^5.4.0 || ^7.0" + }, + "replace": { + "exorus/php-mime-mail-parser": "*", + "messaged/php-mime-mail-parser": "*" + }, + "require-dev": { + "phpunit/php-token-stream": "^1.3.0", + "phpunit/phpunit": "^4.0 || ^5.0", + "satooshi/php-coveralls": "0.*", + "squizlabs/php_codesniffer": "2.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpMimeMailParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "bucabay", + "email": "gabe@fijiwebdesign.com", + "homepage": "http://www.fijiwebdesign.com", + "role": "Developer" + }, + { + "name": "eXorus", + "email": "exorus.spam@gmail.com", + "homepage": "https://github.com/eXorus/", + "role": "Developer" + }, + { + "name": "M.Valinskis", + "email": "M.Valins@gmail.com", + "homepage": "https://code.google.com/p/php-mime-mail-parser", + "role": "Developer" + }, + { + "name": "eugene.emmett.wood", + "email": "gene_w@cementhorizon.com", + "homepage": "https://code.google.com/p/php-mime-mail-parser", + "role": "Developer" + }, + { + "name": "alknetso", + "email": "alkne@gmail.com", + "homepage": "https://code.google.com/p/php-mime-mail-parser", + "role": "Developer" + } + ], + "description": "Fully Tested Mailparse Extension Wrapper for PHP 5.4+", + "homepage": "https://github.com/php-mime-mail-parser/php-mime-mail-parser", + "keywords": [ + "MimeMailParser", + "mail", + "mailparse", + "mime" + ], + "time": "2017-09-30 15:15:40" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php new file mode 100644 index 0000000..79dd5f0 --- /dev/null +++ b/lib/AppInfo/Application.php @@ -0,0 +1,43 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\AppInfo; + +use OCP\AppFramework\App; + +class Application extends App { + + const APP_NAME = 'files_frommail'; + + /** + * @param array $params + */ + public function __construct(array $params = array()) { + parent::__construct(self::APP_NAME, $params); + } + +} + diff --git a/lib/Command/Addresses.php b/lib/Command/Addresses.php new file mode 100644 index 0000000..b84f8f5 --- /dev/null +++ b/lib/Command/Addresses.php @@ -0,0 +1,199 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Command; + +use Exception; +use OC\Core\Command\Base; +use OCA\Files_FromMail\Exceptions\FakeException; +use OCA\Files_FromMail\Exceptions\MissingArgumentException; +use OCA\Files_FromMail\Service\MailService; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; + +class Addresses extends Base { + + + /** @var MailService */ + private $mailService; + + /** + * Addresses constructor. + * + * @param MailService $mailService + */ + public function __construct(MailService $mailService) { + parent::__construct(); + + $this->mailService = $mailService; + } + + + protected function configure() { + parent::configure(); + $this->setName('files_frommail:address') + ->setDescription('manage the linked groups') + ->addOption('add', 'a', InputOption::VALUE_NONE, 'add a new mail address') + ->addOption('list', 'l', InputOption::VALUE_NONE, 'list all mail addresses') + ->addOption('remove', 'r', InputOption::VALUE_NONE, 'remove a mail address') + ->addOption( + 'password', 'p', InputOption::VALUE_NONE, 'add a password to protect a mail address' + ) + ->addArgument('address', InputArgument::OPTIONAL, 'email address') + ->addArgument('password', InputArgument::OPTIONAL, 'password'); + } + + + protected function execute(InputInterface $input, OutputInterface $output) { + + try { + $this->listMailAddresses($input, $output); + $this->addMailAddress($input); + $this->removeMailAddress($input); + $this->setMailAddressPassword($input, $output); + + $output->writeln('please specify an action or use --help'); + } catch (FakeException $e) { + } catch (Exception $e) { + throw $e; + } + } + + + /** + * @param InputInterface $input + * @param OutputInterface $output + * + * @throws FakeException + */ + private function listMailAddresses(InputInterface $input, OutputInterface $output) { + if ($input->getOption('list') !== true) { + return; + } + + $addresses = $this->mailService->getMailAddresses(); + + if (sizeof($addresses) === 0) { + $output->writeln('no mail address'); + throw new FakeException(); + } + + foreach ($addresses as $entry) { + $output->writeln($this->formatMailAddress($entry)); + } + + throw new FakeException(); + } + + + /** + * @param InputInterface $input + * + * @throws FakeException + */ + private function addMailAddress(InputInterface $input) { + if ($input->getOption('add') !== true) { + return; + } + + $mail = $this->checkMailAddress($input); + $this->mailService->addMailAddress($mail); + + throw new FakeException(); + } + + + /** + * @param InputInterface $input + * + * @throws FakeException + */ + private function removeMailAddress(InputInterface $input) { + if ($input->getOption('remove') !== true) { + return; + } + + $mail = $this->checkMailAddress($input); + $this->mailService->removeMailAddress($mail); + + throw new FakeException(); + } + + + /** + * @param InputInterface $input + * @param OutputInterface $output + * + * @throws FakeException + */ + private function setMailAddressPassword(InputInterface $input, OutputInterface $output) { + if ($input->getOption('password') !== true) { + return; + } + + $mail = $this->checkMailAddress($input); + $password = $input->getArgument('password'); + $this->mailService->setMailPassword($mail, $password); + + if ($password === null) { + $output->writeln('Password for ' . $mail . ' is now UNSET'); + throw new FakeException(); + } + + $output->writeln('Password for ' . $mail . ' is now SET to ' . $password); + throw new FakeException(); + } + + + private function checkMailAddress(InputInterface $input) { + $mail = $input->getArgument('address'); + if ($mail === null) { + throw new MissingArgumentException('missing email address'); + } + + return $mail; + + } + + + /** + * @param array $entry + * + * @return string + */ + private function formatMailAddress($entry) { + $line = '- ' . $entry['address']; + if (array_key_exists('password', $entry) && $entry['password'] !== '') { + $line .= ' [:' . $entry['password'] . ']'; + } + + return $line; + } + +} + diff --git a/lib/Controller/RemoteController.php b/lib/Controller/RemoteController.php new file mode 100644 index 0000000..e2049b7 --- /dev/null +++ b/lib/Controller/RemoteController.php @@ -0,0 +1,83 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Controller; + +use OCA\Files_FromMail\AppInfo\Application; +use OCA\Files_FromMail\Service\MailService; +use OCA\Files_FromMail\Service\MiscService; +use OCP\AppFramework\Controller; +use OCP\AppFramework\Http; +use OCP\AppFramework\Http\DataResponse; +use OCP\IRequest; + +class RemoteController extends Controller { + + /** @var string */ + private $userId; + + /** @var MailService */ + private $mailService; + + /** @var MiscService */ + private $miscService; + + + /** + * NavigationController constructor. + * + * @param IRequest $request + * @param string $userId + * @param MailService $mailService + * @param MiscService $miscService + */ + function __construct(IRequest $request, $userId, MailService $mailService, MiscService $miscService + ) { + parent::__construct(Application::APP_NAME, $request); + $this->userId = $userId; + + $this->mailService = $mailService; + $this->miscService = $miscService; + } + + + /** + * @NoAdminRequired + * @NoCSRFRequired + * + * @param $content + * + * @return DataResponse + */ + public function getContent($content) { + $content = base64_decode(rawurldecode($content)); + $this->mailService->parseMail($content, $this->userId); + + return new DataResponse(['ok'], Http::STATUS_CREATED); + } + + +} \ No newline at end of file diff --git a/lib/Exceptions/AddressAlreadyExistException.php b/lib/Exceptions/AddressAlreadyExistException.php new file mode 100644 index 0000000..c088eb8 --- /dev/null +++ b/lib/Exceptions/AddressAlreadyExistException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class AddressAlreadyExistException extends \Exception { + +} + diff --git a/lib/Exceptions/AddressInfoException.php b/lib/Exceptions/AddressInfoException.php new file mode 100644 index 0000000..5e0c412 --- /dev/null +++ b/lib/Exceptions/AddressInfoException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class AddressInfoException extends \Exception { + +} + diff --git a/lib/Exceptions/FakeException.php b/lib/Exceptions/FakeException.php new file mode 100644 index 0000000..99ec60f --- /dev/null +++ b/lib/Exceptions/FakeException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class FakeException extends \Exception { + +} + diff --git a/lib/Exceptions/InvalidAddressException.php b/lib/Exceptions/InvalidAddressException.php new file mode 100644 index 0000000..3a946a3 --- /dev/null +++ b/lib/Exceptions/InvalidAddressException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class InvalidAddressException extends \Exception { + +} + diff --git a/lib/Exceptions/MailHeadersException.php b/lib/Exceptions/MailHeadersException.php new file mode 100644 index 0000000..b95badd --- /dev/null +++ b/lib/Exceptions/MailHeadersException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class MailHeadersException extends \Exception { + +} + diff --git a/lib/Exceptions/MissingArgumentException.php b/lib/Exceptions/MissingArgumentException.php new file mode 100644 index 0000000..bff2e6f --- /dev/null +++ b/lib/Exceptions/MissingArgumentException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class MissingArgumentException extends \Exception { + +} + diff --git a/lib/Exceptions/NotAFolderException.php b/lib/Exceptions/NotAFolderException.php new file mode 100644 index 0000000..85d5a63 --- /dev/null +++ b/lib/Exceptions/NotAFolderException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class NotAFolderException extends \Exception { + +} + diff --git a/lib/Exceptions/UnknownAddressException.php b/lib/Exceptions/UnknownAddressException.php new file mode 100644 index 0000000..3a0e161 --- /dev/null +++ b/lib/Exceptions/UnknownAddressException.php @@ -0,0 +1,32 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Exceptions; + +class UnknownAddressException extends \Exception { + +} + diff --git a/lib/NextcloudMailCatcher.php b/lib/NextcloudMailCatcher.php new file mode 100644 index 0000000..902b8ce --- /dev/null +++ b/lib/NextcloudMailCatcher.php @@ -0,0 +1,222 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +$config = [ + 'nextcloud' => 'https://test.artificial-owl.com/', + 'username' => 'frommail', + 'password' => 'Ledxc-jRFiR-wBMXD-jyyjt-Y87CZ', + 'debug' => false +]; + + +// --- do not edit below this line --- + +class NextcloudMailCatcher { + + /** @var string */ + private $content; + + /** @var array */ + private $config; + + + /** + * RemoteMailCatcher constructor. + * + * @param array $config + */ + public function __construct($config) { + + $nextcloud = $config['nextcloud']; + if (substr($nextcloud, -1) === '/') { + $config['nextcloud'] = substr($nextcloud, 0, -1); + } + + + $this->config = $config; + $this->debug('Catching a new mail'); + } + + + /** + * @param $content + * + * @return $this + */ + public function setContent($content) { + $this->content = $content; + + return $this; + } + + + /** + * @return string + */ + public function getContent() { + return $this->content; + } + + + /** + * + */ + public function sendToNextcloud() { + + $content = rawurlencode(base64_encode($this->getContent())); + + $curl = $this->generateAuthedCurl( + $this->config['nextcloud'] . '/index.php/apps/files_frommail/remote/' + ); + $this->fillCurlWithContent($curl, 'content=' . $content); + + $result = curl_exec($curl); + + $this->debugCurl($curl, $result); + } + + + /** + * @param resource $curl + * @param string|array $result + */ + private function debugCurl($curl, $result) { + if ($result === false) { + $this->debug('Mail NOT forwarded: ' . curl_error($curl)); + + return; + } + + try { + $this->debugCurlResponseCode($curl); + } catch (Exception $e) { + $this->debug('Mail NOT forwarded: ' . $e->getMessage()); + + return; + } + + $this->debug('Mail forwarded, result was ' . $result); + } + + + private function debugCurlResponseCode($curl) { + + $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); + if ($code === 201) { + return; + } + + if ($code === 401 || $code === 500) { + throw new Exception('Unauthorized access'); + } + + if ($code === 404) { + throw new Exception('404 Not Found'); + } + + if ($code === 503 || $code === 302) { + throw new Exception('The \'files_frommail\' app does not seems enabled'); + } + + throw new Exception('Request returned code ' . $code); + } + + + /** + * @param $url + * + * @return resource + */ + private function generateAuthedCurl($url) { + + $curl = curl_init($url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + curl_setopt( + $curl, CURLOPT_USERPWD, + $this->config['username'] . ':' . $this->config['password'] + ); + + $this->debug( + 'Generate curl request to ' . $url . ' with username \'' . $this->config['username'] . '\'' + ); + + return $curl; + } + + + /** + * @param resource $curl + * @param string $put + */ + private function fillCurlWithContent(&$curl, $put) { + + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($curl, CURLOPT_POSTFIELDS, $put); + + $length = strlen($put); + curl_setopt( + $curl, CURLOPT_HTTPHEADER, + [ + 'Content-type: application/x-www-form-urlencoded', + 'OCS-APIRequest: true', + 'Content-Length: ' . $length + ] + ); + + $this->debug('Content-Length: ' . $length . ' (' . round($length / 1024 / 1024, 1) . 'MB)'); + } + + + /** + * @param string $string + */ + private function debug($string) { + if (!array_key_exists('debug', $this->config) || $this->config['debug'] !== true) { + return; + } + + $log = '/tmp/' . basename(__FILE__, '.php') . '.log'; + file_put_contents($log, date('Y-m-d H:i:s') . ' ' . $string . "\n", FILE_APPEND); + } + +} + + +$content = ''; +$fd = fopen('php://stdin', 'r'); +while (!feof($fd)) { + $content .= fread($fd, 1024); +} + +$mailCatcher = new NextcloudMailCatcher($config); +$mailCatcher->setContent($content); +$mailCatcher->sendToNextcloud(); + + + + diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php new file mode 100644 index 0000000..0817693 --- /dev/null +++ b/lib/Service/ConfigService.php @@ -0,0 +1,117 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Service; + +use OCP\IConfig; +use OCP\IRequest; + +class ConfigService { + + const FROMMAIL_ADDRESSES = 'frommail_addresses'; + + private $defaults = [ + self::FROMMAIL_ADDRESSES => '' + ]; + + /** @var string */ + private $appName; + + /** @var IConfig */ + private $config; + + /** @var string */ + private $userId; + + /** @var IRequest */ + private $request; + + /** @var MiscService */ + private $miscService; + + /** + * ConfigService constructor. + * + * @param string $appName + * @param IConfig $config + * @param IRequest $request + * @param string $userId + * @param MiscService $miscService + */ + public function __construct( + $appName, IConfig $config, IRequest $request, $userId, MiscService $miscService + ) { + $this->appName = $appName; + $this->config = $config; + $this->request = $request; + $this->userId = $userId; + $this->miscService = $miscService; + } + + + /** + * Get a value by key + * + * @param string $key + * + * @return string + */ + public function getAppValue($key) { + $defaultValue = null; + + if (array_key_exists($key, $this->defaults)) { + $defaultValue = $this->defaults[$key]; + } + + return $this->config->getAppValue($this->appName, $key, $defaultValue); + } + + + /** + * Set a value by key + * + * @param string $key + * @param string $value + * + * @return void + */ + public function setAppValue($key, $value) { + $this->config->setAppValue($this->appName, $key, $value); + } + + + /** + * remove a key + * + * @param string $key + * + * @return string + */ + public function deleteAppValue($key) { + return $this->config->deleteAppValue($this->appName, $key); + } + +} diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php new file mode 100644 index 0000000..d92f6cb --- /dev/null +++ b/lib/Service/MailService.php @@ -0,0 +1,342 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Service; + + +use Exception; +use OCA\Files_FromMail\Exceptions\AddressAlreadyExistException; +use OCA\Files_FromMail\Exceptions\AddressInfoException; +use OCA\Files_FromMail\Exceptions\InvalidAddressException; +use OCA\Files_FromMail\Exceptions\NotAFolderException; +use OCA\Files_FromMail\Exceptions\UnknownAddressException; +use OCP\Files\FileInfo; +use OCP\Files\Folder; +use PhpMimeMailParser\Attachment; +use PhpMimeMailParser\Parser; + +class MailService { + + + /** @var ConfigService */ + private $configService; + + /** @var MiscService */ + private $miscService; + + /** @var int */ + private $count = 0; + + /** + * MailService constructor. + * + * @param ConfigService $configService + * @param MiscService $miscService + */ + function __construct(ConfigService $configService, MiscService $miscService) { + $this->configService = $configService; + $this->miscService = $miscService; + } + + + /** + * @param string $content + * @param string $userId + */ + public function parseMail($content, $userId) { + $mail = new Parser(); + $mail->setText($content); + + $data = $this->parseMailHeaders($mail); + $data['date'] = date('Y-m-d H:i:s'); + $data['userId'] = $userId; + + $toAddresses = array_merge( + $mail->getAddresses('to'), + $mail->getAddresses('cc'), + $mail->getAddresses('bcc') + ); + + foreach ($toAddresses as $toAddress) { + try { + $this->generateLocalContentFromMail($mail, $toAddress['address'], $data); + } catch (Exception $e) { + // we check next address + } + } + } + + + /** + * @param Parser $mail + * @param string $to + * @param array $data + */ + private function generateLocalContentFromMail(Parser $mail, $to, $data) { + + $toInfo = $this->getMailAddressInfo($to); + $text = $data['text']; + $subject = $data['subject']; + $from = $data['from']; + $userId = $data['userId']; + $date = $data['date']; + + $this->verifyInfoAndPassword($text, $toInfo); + + $folder = $this->getMailFolder($userId, $to, $from); + $this->createLocalFile($folder, $date, 'mail-' . $subject . '.txt', $text); + $this->createLocalFileFromAttachments($date, $folder, $mail->getAttachments()); + } + + + /** + * @param $content + * @param $toInfo + * + * @throws AddressInfoException + */ + private function verifyInfoAndPassword($content, $toInfo) { + + if ($toInfo === null) { + throw new AddressInfoException('address is not known'); + } + + if (!array_key_exists('password', $toInfo) || $toInfo['password'] === '') { + return; + } + + if (strpos($content, ':' . $toInfo['password']) !== false) { + return; + } + + throw new AddressInfoException('password is set but not used in mail'); + } + + + /** + * @param string $userId + * @param string $to + * @param string $from + * + * @return Folder + * @throws NotAFolderException + */ + private function getMailFolder($userId, $to, $from) { + + $node = \OC::$server->getUserFolder($userId); + $folderPath = 'Mails sent to ' . $to . '/From ' . $from . '/'; + + if (!$node->nodeExists($folderPath)) { + $node->newFolder($folderPath); + } + + $folder = $node->get($folderPath); + if ($folder->getType() !== FileInfo::TYPE_FOLDER) { + throw new NotAFolderException($folderPath . ' is not a folder'); + } + + /** @var Folder $folder */ + return $folder; + } + + + /** + * @param Parser $mail + * + * @return array + */ + private function parseMailHeaders(Parser $mail) { + $from = $mail->getAddresses('from')[0]['address']; + $subject = $mail->getHeader('subject'); + $text = $mail->getHeadersRaw() . $mail->getMessageBody('text'); + + //TODO: check that data are enough + return [ + 'from' => $from, + 'subject' => $subject, + 'text' => $text + ]; + } + + + /** + * @param string $id + * @param Folder $folder + * @param Attachment[] $attachments + */ + private function createLocalFileFromAttachments($id, $folder, $attachments) { + foreach ($attachments as $attachment) { + $this->createLocalFile( + $folder, $id, 'attachment-' . $attachment->getFilename(), + $attachment->getContent() + ); + } + + } + + + /** + * @param Folder $folder + * @param string $id + * @param string $filename + * @param string $content + */ + private function createLocalFile($folder, $id, $filename, $content) { + $new = $folder->newFile($id . '-' . $this->count . '_' . $filename); + $new->putContent($content); + + $this->count++; + } + + + /** + * @param $address + * @param $password + * + * @throws UnknownAddressException + */ + public function setMailPassword($address, $password) { + if (!$this->mailAddressExist($address)) { + throw new UnknownAddressException('address is not known'); + } + if ($password === null) { + $password = ''; + } + + $addresses = $this->getMailAddresses(); + $new = []; + foreach ($addresses as $entry) { + if ($entry['address'] === $address) { + $entry['password'] = $password; + } + $new[] = $entry; + } + + $this->saveMailAddresses($new); + } + + + /** + * @param $address + * + * @throws UnknownAddressException + */ + public function removeMailAddress($address) { + $addresses = $this->getMailAddresses(); + if (!$this->mailAddressExist($address)) { + throw new UnknownAddressException('address is not known'); + } + + $new = []; + foreach ($addresses as $entry) { + if ($entry['address'] !== $address) { + $new[] = $entry; + } + } + + $this->saveMailAddresses($new); + } + + + /** + * @param $address + * + * @throws AddressAlreadyExistException + */ + public function addMailAddress($address) { + $this->hasToBeAValidMailAddress($address); + if ($this->mailAddressExist($address)) { + throw new AddressAlreadyExistException('address already exist'); + } + + $addresses = $this->getMailAddresses(); + array_push($addresses, ['address' => $address]); + $this->saveMailAddresses($addresses); + } + + + /** + * @param $address + * + * @return bool + */ + private function mailAddressExist($address) { + return ($this->getMailAddressInfo($address) !== null); + } + + + /** + * @param $address + * + * @return array|null + */ + private function getMailAddressInfo($address) { + $addresses = $this->getMailAddresses(); + foreach ($addresses as $entry) { + if ($entry['address'] === $address) { + return $entry; + } + } + + return null; + } + + + /** + * @param $address + * + * @throws InvalidAddressException + */ + private function hasToBeAValidMailAddress($address) { + if (filter_var($address, FILTER_VALIDATE_EMAIL)) { + return; + } + + throw new InvalidAddressException('this mail address is not valid'); + } + + + /** + * @return array + */ + public function getMailAddresses() { + $curr = json_decode($this->configService->getAppValue(ConfigService::FROMMAIL_ADDRESSES), true); + if ($curr === null) { + return []; + } + + return $curr; + } + + /** + * @param $addresses + */ + private function saveMailAddresses($addresses) { + $this->configService->setAppValue(ConfigService::FROMMAIL_ADDRESSES, json_encode($addresses)); + } + + +} \ No newline at end of file diff --git a/lib/Service/MiscService.php b/lib/Service/MiscService.php new file mode 100644 index 0000000..82338d4 --- /dev/null +++ b/lib/Service/MiscService.php @@ -0,0 +1,67 @@ + + * @copyright 2017 + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Files_FromMail\Service; + +use OCA\Files_FromMail\AppInfo\Application; +use OCP\ILogger; + +class MiscService { + + /** @var ILogger */ + private $logger; + + public function __construct(ILogger $logger) { + $this->logger = $logger; + } + + public function log($message, $level = 2) { + $data = array( + 'app' => Application::APP_NAME, + 'level' => $level + ); + + $this->logger->log($level, $message, $data); + } + + /** + * @param $arr + * @param $k + * + * @param string $default + * + * @return array|string|integer + */ + public static function get($arr, $k, $default = '') { + if (!key_exists($k, $arr)) { + return $default; + } + + return $arr[$k]; + } + +} + diff --git a/screenshots/v0.1.0.png b/screenshots/v0.1.0.png new file mode 100644 index 0000000000000000000000000000000000000000..9b4e979238cf9947db6fbddea03aef010cdc2f1b GIT binary patch literal 36982 zcmcG$WmsE57cERnmEsgA#o9ojxVsey6nEF+6bl}lwiLJG4#nLiKyZq?Yj7#<67(MW z-uFKD-sk&q|9ts#NHUqT=giF7Yp=bBKn1za7-(;O_eD~xhPQUMywTrHg_Ak2; zbDOvRrQ8X932ba@QBiDWI)9ly1112kXVcg!kN*7?$@RZq-npVay!~GnEOgi3pZh;D zsr+ljUpD{DyfFm6!?yb2C>^)sBSd^{_NsWkvYJ;EaUM0HBZ`OluQ&d8I?oLG4<_V$ zRU$^6zr#rfC$o68j`l~;)*ufJJ{|9~xc=^{sWVzr3bz@AEWJ&=zxj;la3lF=UTyQ4 znGmGoW2sLw#*Wu66)4tD=yHyEol@w(-#Zni!T5)b;=9iZiY4{GZt*%_lwi+oguMst z^=vo2{%6FJp6tTW>W5%zWJh>hmCUl0Y@M0q)S5o4PBknwij-=;@m<#H+Y(Op_1N)k z#z~^uXCOl&XvfEcONAchi*wzU#RL{9eS@!rMKcC%6D$-fUD8@mq9Flo_^q+i{><$4 zbxQz3rzms)>v9G;9gyzugQ)yVH?^5Xm`=T4A3k8i{@1~4SGN5UIHBK1Uh?M(4pl1? zo?_u9*pP^cp^tP%jC!(cyNPgzu_A9yMv?G zm;3!Zt^I^1^FAIHVTZU)N5%?$-itRmH%g79>h!>!=Hbazu6?Kin0K5-I}ws95lZ4~ z=Qo=|xDkfY>hNjL>U2ruOn3^1v;&6hwuh08WU-B%#!e@sZd{b7C;Y&n!g@cxgwLB! z+*MbDD(%kT$aCf%yt~2Lrp;}h6!qNg)X@Pj?c2r@j$Rwjdzl>?FESg61>nZE`X3;j z2&cJu7TqqJRQt$9RqafRMfpM_@v5P9ecc9Y2)1YT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