Description
Currently the interface Mail is described as a wrapper around a MimeMessage with routing information. For various reasons it would be nice if the user could decide what mail API to use.
This could be accomplished by simply adding a method to retrieve the raw input stream of the message. The user can then use a mime4j parser or whatever API is best fitting to parse the input stream.
Implementing such a method in James shouldn't be too difficult since org.apache.james.core.MimeMessageSource already has a method to retrieve the raw input stream.
setMessage() would also have to be accompanied by a method to overwrite the raw content of the message. Preferably this method could return an output stream where the raw data can be written to.
Example code snippet of desired use case:
class MyMailet {
public void service(Mail mail)
}