diff --git a/modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php b/modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
index 03deb50..78c1751 100644
--- a/modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
+++ b/modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
@@ -306,12 +306,12 @@ class MailhandlerPhpImapRetrieve extends MailhandlerRetrieve {
    * Retrieve MIME type of the message structure.
    */
   function get_mime_type(&$structure) {
-    static $primary_mime_type = array('TEXT', 'MULTIPART', 'MESSAGE', 'APPLICATION', 'AUDIO', 'IMAGE', 'VIDEO', 'OTHER');
+    static $primary_mime_type = array('text', 'multipart', 'message', 'application', 'audio', 'image', 'video', 'other');
     $type_id = (int) $structure->type;
     if (isset($primary_mime_type[$type_id]) && !empty($structure->subtype)) {
-      return $primary_mime_type[$type_id] . '/' . $structure->subtype;
+      return $primary_mime_type[$type_id] . '/' . drupal_strtolower($structure->subtype);
     }
-    return 'TEXT/PLAIN';
+    return 'text/plain';
   }
 
   /**
@@ -363,8 +363,8 @@ class MailhandlerPhpImapRetrieve extends MailhandlerRetrieve {
     if (!isset($header->subject)) {
       $header->subject = '';
     }
-    $body_text = $this->get_part($result, $msg_number, 'TEXT/PLAIN', FALSE, FALSE, $encoding);
-    $body_html = $this->get_part($result, $msg_number, 'TEXT/HTML', FALSE, FALSE, $encoding);
+    $body_text = $this->get_part($result, $msg_number, 'text/plain', FALSE, FALSE, $encoding);
+    $body_html = $this->get_part($result, $msg_number, 'text/html', FALSE, FALSE, $encoding);
     if (!$body_text && $body_html) {
       $body_text = $body_html;
     }
