Skip to content

Converting to MimeMessage results in an invalid Content-Disposition for attachments #103

Closed

Description

@fauvetg

Hello,

When building a MimeMessage from an Email with the class MimeMessageHelper, the resulting MimeMessage has a wrong Content-Disposition header for attachments. The size is attribute is not correct :

------=_Part_32_1708476334.1507045824508
Content-Type: application/pdf; filename=XXX.pdf; name=XXX
Content-Transfer-Encoding: base64
Content-Disposition: attachment; size=0; filename=XXX.pdf
Content-ID: <ATT_TE91266914>

...

Some mailers (reproduced on and Apple mailer and Horde) cannot open those attachments.

I don't have a fix to provide, but I think the bug is in method MimeMessageHelper#getBodyPartFromDatasource.

NB : we use version 4.2.1

Activity

  1. bbottema commented on Oct 21, 2017

    @bbottema
    Owner

    I'll look into it. Thanks for the report!

  2. added this to the milestone on Oct 21, 2017
  3. added a commit that references this issue on Nov 1, 2017
  4. changed the title [-]Wrong Content-Disposition on attachments (size=0)[/-] [+]Converting to MimeMessage results in an invalid Content-Disposition for attachments[/+] on Dec 26, 2017
  5. bbottema commented on Dec 26, 2017

    @bbottema
    Owner

    Released as 5.0.0.rc1-SNAPSHOT. Add OSS' snapshots repo to find it in Maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions