]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/maildaemon.php
Take token field out of foreign_link
[quix0rs-gnu-social.git] / scripts / maildaemon.php
index a4003b6b26b5018748b51eab4ea8310410516114..91c257adb451fd468af1a5da305beee297580c27 100755 (executable)
@@ -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');
+}