Menu

#3 Need to handle Mime messages

1.5
open
None
5
2004-11-02
2004-11-02
No

The following is from the Open Discussion forum:

By: spesh - spesh
How to test a MimeMultipart Message Content
2004-10-12 16:57
The emails that we are sending use a MimeMultipart
Message Content and include plain and html versions of
the body. The SmtpMessage class has a getBody() method
that returns a String but that makes it difficult to
compare with the Multipart message we are sending. Does
anyone have a suggestion? This might be an idea to
include in the SmtpMessage class.

By: Jason Kitchen - jasonkitchen
RE: How to test a MimeMultipart Message Conte
2004-10-13 16:12
This is a very good question. There is no
specific support right now in Dumbster for Mime message
content. However this appears to be something that we
need to implement. I'm currently reading the
appropriate RFCs to figure out in detail how this stuff
is meant to work and formulate an appropriate
abstraction. I definitely don't want to implement a
full blown MIME implementation and I don't think that
there would be a whole lot of value in that. However I
would like to provide a way for the test code to get a
list of the body parts, count them, compare them to
what was placed in the message, etc.

Any ideas, thoughts, opinions welcome....

Discussion

  • Jason Kitchen

    Jason Kitchen - 2004-11-02
    • milestone: --> 1.5
    • assigned_to: nobody --> jasonkitchen
     
  • Nobody/Anonymous

    Logged In: NO

    Maybe you could use the javax.mail.internet.MimeMessage class

    "Service providers that implement MIME compliant backend
    stores may want to subclass MimeMessage and override certain
    methods to provide specific implementations. The simplest
    case is probably a provider that generates a MIME style
    input stream and leaves the parsing of the stream to this
    class."

    it has a method called parse

    protected void parse(java.io.InputStream is)
    throws MessagingException

    maybe you could just make smtpMessage subclass this ?

    rgds

    dan

     
  • Rhett Sutphin

    Rhett Sutphin - 2005-11-11

    Logged In: YES
    user_id=1135131

    I put a comment on the original thread describing how I
    handle MimeMultiparts in my unit tests:

    http://sourceforge.net/forum/message.php?msg_id=3424095

     

Log in to post a comment.