Commons Email
  1. Commons Email
  2. EMAIL-131

MimeMessageParser not able to read the inline attachments.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Labels:
      None

      Description

      Hi All,

      I am trying to extract attachments using MimeMessageParser. But unable to extract the attachment when i have mime part as below

      Content-Type: text/plain; charset=us-ascii;
      name="abc.txt"
      Content-Transfer-Encoding: 7bit
      Content-Disposition: attachment;
      filename="abc.txt"

      After looking into parse method,
      ======
      protected void parse(Multipart parent, MimePart part)
      throws MessagingException, IOException
      {
      if (part.isMimeType("text/plain") && (plainContent == null))

      { plainContent = (String) part.getContent(); }

      else
      {
      if (part.isMimeType("text/html") && (htmlContent == null))

      { htmlContent = (String) part.getContent(); }

      else
      {
      if (part.isMimeType("multipart/*"))
      {
      this.isMultiPart = true;
      Multipart mp = (Multipart) part.getContent();
      int count = mp.getCount();

      // iterate over all MimeBodyPart

      for (int i = 0; i < count; i++)

      { parse(mp, (MimeBodyPart) mp.getBodyPart(i)); }

      }
      else

      { this.attachmentList.add(createDataSource(parent, part)); }

      }
      }
      }
      ====

      so attachment is going to plainContent

      Can anybody please let me know. how can this going to work

      Do we need to consider Content-Disposition ? According to java mail documentation

      Thanks,
      Raju

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Raju Y
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development