X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fmaildaemon.php;h=91c257adb451fd468af1a5da305beee297580c27;hb=ec83890bc242650b169a524c373f488bb652265c;hp=a4003b6b26b5018748b51eab4ea8310410516114;hpb=fbb0df9f5436e956c43ace372f625f08628c000f;p=quix0rs-gnu-social.git diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index a4003b6b26..91c257adb4 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -317,6 +317,9 @@ class MailerDaemon } else if ($parsed->ctype_primary == 'text' && $parsed->ctype_secondary=='plain') { $msg = $parsed->body; + if(strtolower($parsed->ctype_parameters['charset']) != "utf-8"){ + $msg = utf8_encode($msg); + } }else if(!empty($parsed->body)){ if(common_config('attachments', 'uploads')){ //only save attachments if uploads are enabled @@ -382,5 +385,7 @@ class MailerDaemon } } -$md = new MailerDaemon(); -$md->handle_message('php://stdin'); +if (common_config('emailpost', 'enabled')) { + $md = new MailerDaemon(); + $md->handle_message('php://stdin'); +}