diff --git a/README.md b/README.md index 1b2d51d..790470d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Note: ## B. For NextCloud admins to setup ### Requirements -This app requires php-curl, php-imap and some sort of imap server (e.g. Postfix with Courier). +This app requires php-curl, php-mbstring ,php-imap and some sort of imap server (e.g. Postfix with Courier). ### NC new user Create a new user from User Management on your NC server, which will have to function as a bot. We chose to call him *deckbot*, but you can call it however you want.
__Note__: that you have to assign *deckbot* on each board you want to add new cards from email. diff --git a/config.php b/config.php index 51bb118..9c230ae 100644 --- a/config.php +++ b/config.php @@ -6,4 +6,5 @@ define("MAIL_SERVER", ""); // server.domain define("MAIL_SERVER_FLAGS", "/no-validate-cert"); // flags needed to connect to server. Refer to https://www.php.net/manual/en/function.imap-open.php for a list of valid flags. define("MAIL_USER", "incoming"); define("MAIL_PASSWORD", ""); +define("DECODE_SPECIAL_CHARACTERS", true); //requires mbstring, if false special characters (like öäüß) won't be displayed correctly ?> diff --git a/index.php b/index.php index 238e825..9d10a3b 100644 --- a/index.php +++ b/index.php @@ -80,8 +80,8 @@ if ($emails) $message = imap_fetchbody($inbox, $emails[$j], 1); } $mailData = new stdClass(); - $mailData->mailSubject = $overview->subject; - $mailData->mailMessage = $message; + $mailData->mailSubject = DECODE_SPECIAL_CHARACTERS ? mb_decode_mimeheader($overview->subject) : $overview->subject; + $mailData->mailMessage = DECODE_SPECIAL_CHARACTERS ? quoted_printable_decode($message) : $message; $mailData->from = $overview->from[0]->mailbox . '@' . $overview->from[0]->host; $newcard = new DeckClass();