Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-222

MessageImplFactory is needed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.8.0
    • parser (core)
    • None

    Description

      In order to create a custom Message-Id, one must currently override the method "newMessageId" e.g.

      return new MessageImpl() {
      @Override
      protected UnstructuredField newMessageId(String hostname)

      { String fieldValue = createUniqueMessageId(hostname); return parse(UnstructuredFieldImpl.PARSER, FieldName.MESSAGE_ID, fieldValue); }

      };

      However, in some cases Mime4j instantiates the MessageImpl internally e.g. DefaultMessageBuilder.parseMessage and therefore the newMessageId function cannot be overwridden. This means that I cannot use DefaultMessageBuilder to create a MessageImpl in which I control how the Message-Id is created.

      I have attached a patch to make DefaultMessageBuilder take a MessageImplFactory to create the MessageImpl.

      Attachments

        1. mime4j-222.patch
          8 kB
          Raman Gupta

        Activity

          People

            ieugen Ioan Eugen Stan
            rocketraman Raman Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: