make MIME more tolerant of content-types without slashes
[org.ibex.mail.git] / src / org / ibex / mail / MIME.java
index 8251a94..e47b056 100644 (file)
@@ -88,7 +88,10 @@ public class MIME {
             this.transferEncoding = transferEncoding;
             if (header == null) { type="text"; subtype="plain"; charset="us-ascii"; alternative=false; composite=false; return; }
             header = header.trim();
-            if (header.indexOf('/') == -1) throw new MailException.Malformed("content-type lacks a forward slash: \""+header+"\"");
+            if (header.indexOf('/') == -1) {
+                Log.warn(this, "content-type lacks a forward slash: \""+header+"\"");
+                header = "text/plain";
+            }
             type = header.substring(0, header.indexOf('/')).toLowerCase();
             header = header.substring(header.indexOf('/') + 1);
             subtype = (header.indexOf(';') == -1) ? header.toLowerCase() : header.substring(0, header.indexOf(';')).toLowerCase();