Since recently we started using the latest servicemix bundle for javax.activation with the intend to fix mailcap loading issue in an OSGi environment. Prior to that, we had used some jar embedding techniques in order to correctly fix various class/resource loading issues regarding all this mail/activation jar mess.
So far all was looking good - we no longer had embedded dependencies and all kinds of hacks, until we realized that for some of our legacy components we do still use custom CommandMaps instead of mailcap files, i.e:
public void setReceipt(MimeBodyPart receipt)
this.receipt = receipt;
this.receipt.getDataHandler().setCommandMap(new MDNCommandMap()); // Custom impl of a CommandMap
this.needsUpdate = true;
This custom ComandMap contains some pretty exotic mime parts that are not found in the original mailcap file from javamail.
It also contains some custom handlers for already known parts that are already found in the original mailcap file.
So seems that simply adding new mailcap files in these legacy components will not work for us because we will have duplicate pars which are handled by different handlers, depending on the component.