Ubuntu javamail Exception

If you get:

java.lang.NullPointerException
        at java.lang.String.concat(String.java:1827)
        at com.sun.activation.registries.MailcapFile.parseLine(MailcapFile.java:254)
        at com.sun.activation.registries.MailcapFile.parse(MailcapFile.java:216)
        at com.sun.activation.registries.MailcapFile.createMailcapHash(MailcapFile.java:176)
        at com.sun.activation.registries.MailcapFile.<init>(MailcapFile.java:50)
        at javax.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:189)
        at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:139)
        at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:55)
        at javax.activation.DataHandler.getCommandMap(DataHandler.java:146)
        at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:578)
        at javax.activation.DataHandler.writeTo(DataHandler.java:304)
        at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:230)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1065)
        at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1923)
        at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1904)
        at javax.mail.Transport.send(Transport.java:79)

It can be fixed modifying the $HOME/.mailcap file. Try commenting out the line that contains “-e” or removing the file.