Problem with identical MIME header types in mailcap file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, July 19, 2001 09:24 AM

Hello, I have a really wired problem. I write a application, which could handle both cryptographical standards PGP and S/MIME. For PGP I use Cryptix and for S/MIME the IAIK smime package. Now I have to edit the mailcap file for the content handlers from IAIK and for my own classes for RFC2015 compliant PGP messages. But with signed messages there are the same content multipart/signed MIME type. So JavaMail mix up this entries, so I get classCast exceptions. My mailcap looks like this: # Default mailcap file for the JavaMail System # # for IAIK content-handlers and PGP RFC2015 # text/plain;; x-java-content-handler=com.sun.mai   More>>

Hello,

I have a really wired problem. I write a application, which could handle
both cryptographical standards PGP and S/MIME.
For PGP I use Cryptix and for S/MIME the IAIK smime package.
Now I have to edit the mailcap file for the content handlers from IAIK and for my
own classes for RFC2015 compliant PGP messages. But with signed messages there are the same
content multipart/signed MIME type. So JavaMail mix up this entries, so I get classCast exceptions.

My mailcap looks like this:

			
# Default mailcap file for the JavaMail System
#
# for IAIK content-handlers and PGP RFC2015
#
text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain
multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed
message/*;; x-java-content-handler=com.sun.mail.handlers.message_rfc822
#
# PGP RFC2015
#
multipart/signed;; x-java-content-handler=com.frontsite.mail.PGPMultipart
multipart/encrypted;; x-java-content-handler=com.frontsite.mail.PGPMultipart
application/pgp-signature;; x-java-content-handler=com.frontsite.mail.PGPDataSource
application/pgp-encrypted;; x-java-content-handler=com.frontsite.mail.PGPDataSource
#
# IAIK 'mailcap' file
#
multipart/signed;; x-java-content-handler=iaik.security.smime.signed_content
application/x-pkcs7-signature;; x-java-content-handler=iaik.security.smime.signed_content
application/x-pkcs7-mime;; x-java-content-handler=iaik.security.smime.encrypted_content
application/pkcs7-signature;; x-java-content-handler=iaik.security.smime.signed_content
application/pkcs7-mime;; x-java-content-handler=iaik.security.smime.encrypted_content


The error switch from one protocol to the other if I permute the two entries.
So everyone know how to handle the same MIME content type for two
different classes? Is there a way around that?
There have to be a solution or the JavaMail API is not
ready for mail-clients with both cryptographical standards.

thanks in advance    <<Less

Re: Problem with identical MIME header types in mailcap file

Posted By:   Anonymous  
Posted On:   Sunday, July 22, 2001 06:17 AM

I solved that problem with programaticaly adding the mailcap entries. So the activation package do not overwrite my mailcap entries from the mailcap file in the JAR Archive any more.
example code:

MailcapCommandMap mc = new MailcapCommandMap();
mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
....
// set that stuff as default
CommandMap.setDefaultCommandMap(mc);

So this works fine


Alex
About | Sitemap | Contact