Skip to content
This repository was archived by the owner on Apr 27, 2019. It is now read-only.

JavaMail error preventing Maildrop from working with any "multipart/*" mime types #12

Open
charlescapps opened this issue Apr 7, 2015 · 0 comments

Comments

@charlescapps
Copy link

I ran into this error:

no object DCH for MIME type multipart/mixed;

when MailDropMessageHandler called "saveMessage()".

There are discussions about this problem throughout the Internet, e.g. Stack overflow discussion.

In case it matters, I built the smtp module with these very simple steps:


cd smtp
activator assembly
cp target/scala-2.10/smtp-assembly-2.0.jar .
# Use a custom application.conf, which just modified the number of emails per inbox.
java -jar smtp-assembly-2.0.jar -Dconfig.file=application.conf  

I'm using Java 8 (the error still happens with Java 7) and Scala 2.10.

I'd be grateful if the developer could:

  • Investigate why this happens, see if you can reproduce (should be easy to reproduce by sending any multipart email)
  • Fix at the code level, if necessary, or provide documentation on how to fix your environment

I ended up adding this code to fix the issue at the top of MailDropMessageHandler:


        val mc = CommandMap.getDefaultCommandMap.asInstanceOf[MailcapCommandMap]
        mc.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html")
        mc.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml")
        mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain")
        mc.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed")
        mc.addMailcap("message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822")
        CommandMap.setDefaultCommandMap(mc)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant