Uploaded image for project: 'James Mailet'
  1. James Mailet
  2. MAILET-17

Add support for other mail parsing APIs such as mime4j

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4
    • 3.0
    • Core API
    • None

    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)

      { org.apache.james.mime4j.message.Message message = new Message(mail.getRawInputStream()); message = manipulateMessage(message); message.writeTo(mail.getRawOutputStream(), MessageUtils.LENIENT); }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            wmax Markus Wiederkehr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: