[ 
https://issues.apache.org/jira/browse/MIME4J-222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raman Gupta updated MIME4J-222:
-------------------------------

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

{code}
        return new MessageImpl() {
            @Override
            protected UnstructuredField newMessageId(String hostname) {
                String fieldValue = createUniqueMessageId(hostname);
                return parse(UnstructuredFieldImpl.PARSER, 
FieldName.MESSAGE_ID, fieldValue);
            }
        };
{code}

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.

Can DefaultMessageBuilder take a MessageImplFactory to create the MessageImpl?

  was:
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.

Can DefaultMessageBuilder take a MessageImplFactory to create the MessageImpl?

    
> MessageImplFactory is needed
> ----------------------------
>
>                 Key: MIME4J-222
>                 URL: https://issues.apache.org/jira/browse/MIME4J-222
>             Project: James Mime4j
>          Issue Type: Improvement
>          Components: parser (core)
>    Affects Versions: 0.8
>            Reporter: Raman Gupta
>             Fix For: 0.8
>
>
> In order to create a custom Message-Id, one must currently override the 
> method "newMessageId" e.g.
> {code}
>         return new MessageImpl() {
>             @Override
>             protected UnstructuredField newMessageId(String hostname) {
>                 String fieldValue = createUniqueMessageId(hostname);
>                 return parse(UnstructuredFieldImpl.PARSER, 
> FieldName.MESSAGE_ID, fieldValue);
>             }
>         };
> {code}
> 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.
> Can DefaultMessageBuilder take a MessageImplFactory to create the MessageImpl?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to