Skip to content

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

@fauvetg

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions