Commons Email
  1. Commons Email
  2. EMAIL-74

Create an overridable method in Email.java to create the MimeMessage instance

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Labels:
      None
    • Environment:

      All Java

      Description

      I would like more control over the MimeMessage instance that is created by Email.java in buildMimeMessage().

      Currently it simply instantiates one directly - new MimeMessage(). It would be nice if it called a protected method called something like createMimeMessage(session) so that I could override that with my own subclass.

      Why would I want to subclass it? So I can set the Message-Id on the outgoing message. See this link:

      http://java.sun.com/products/javamail/FAQ.html#msgid

      I've got my own subclass ready but I have no way to hook into Email.java to use it.

        Activity

        Jim McCabe created issue -
        Jim McCabe made changes -
        Field Original Value New Value
        Summary Create an overridable method in Email.java to create the MimeMultipart instance Create an overridable method in Email.java to create the MimeMessage instance
        Description I would like more control over the MimeMultipart instance that is created by Email.java in buildMimeMessage().

        Currently it simply instantiates one directly - new MimeMessage(). It would be nice if it called a protected method called something like createMimeMessage() so that I could override that with my own subclass.

        Why would I want to subclass it? So I can set the Message-Id on the outgoing message. See this link:

           http://java.sun.com/products/javamail/FAQ.html#msgid

        I've got my own subclass ready but I have no way to hook into Email.java to use it.
        I would like more control over the MimeMessage instance that is created by Email.java in buildMimeMessage().

        Currently it simply instantiates one directly - new MimeMessage(). It would be nice if it called a protected method called something like createMimeMessage() so that I could override that with my own subclass.

        Why would I want to subclass it? So I can set the Message-Id on the outgoing message. See this link:

           http://java.sun.com/products/javamail/FAQ.html#msgid

        I've got my own subclass ready but I have no way to hook into Email.java to use it.
        Hide
        Jim McCabe added a comment -

        Added session parameter to createMimeMessage() API suggestion.

        Show
        Jim McCabe added a comment - Added session parameter to createMimeMessage() API suggestion.
        Jim McCabe made changes -
        Description I would like more control over the MimeMessage instance that is created by Email.java in buildMimeMessage().

        Currently it simply instantiates one directly - new MimeMessage(). It would be nice if it called a protected method called something like createMimeMessage() so that I could override that with my own subclass.

        Why would I want to subclass it? So I can set the Message-Id on the outgoing message. See this link:

           http://java.sun.com/products/javamail/FAQ.html#msgid

        I've got my own subclass ready but I have no way to hook into Email.java to use it.
        I would like more control over the MimeMessage instance that is created by Email.java in buildMimeMessage().

        Currently it simply instantiates one directly - new MimeMessage(). It would be nice if it called a protected method called something like createMimeMessage(session) so that I could override that with my own subclass.

        Why would I want to subclass it? So I can set the Message-Id on the outgoing message. See this link:

           http://java.sun.com/products/javamail/FAQ.html#msgid

        I've got my own subclass ready but I have no way to hook into Email.java to use it.
        Hide
        Corey Scott added a comment -

        As per the request

        Show
        Corey Scott added a comment - As per the request
        Corey Scott made changes -
        Attachment EMAIL-74-patch.txt [ 12394543 ]
        Siegfried Goeschl made changes -
        Assignee Siegfried Goeschl [ sgoeschl ]
        Siegfried Goeschl made changes -
        Fix Version/s 1.2 [ 12313573 ]
        Hide
        Siegfried Goeschl added a comment -

        Reviewed and applied the patch

        Show
        Siegfried Goeschl added a comment - Reviewed and applied the patch
        Siegfried Goeschl made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Siegfried Goeschl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        347d 37m 1 Siegfried Goeschl 24/Feb/09 22:32
        Resolved Resolved Closed Closed
        605d 23h 53m 1 Siegfried Goeschl 23/Oct/10 23:25

          People

          • Assignee:
            Siegfried Goeschl
            Reporter:
            Jim McCabe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development