Skip to content

Magento 2.3.3 notifications converted to attachments in MS Exchange - Disposition Header #25076

Closed
zendframework/zend-mail
#251
@jaminion

Description

@jaminion

Preconditions (*)

  1. Magento version 2.3.3 (worked fine previously on 2.3.2)
  2. Outlook 2010 behind MS Exchange 2010 (don't have later version accessible for immediate testing with this project), or Outlook Web Access, have also confirmed with Mail clients on Mac, iPhone and Android that pull mail from this Exchange server
  3. Issue does not appear to affect rendering from Gmail/etc - seems to only be clients that are connecting to MS Exchange 2010 to retrieve the message

Steps to reproduce (*)

  1. Submit an order, send order notification or send shipment notification
  2. Receive email using a client/server combination similar to above noted configuration (Outlook/Exchange)

Expected result (*)

  1. Receive an email with the body of the message containing the rendered template for the order notification email

Actual result (*)

  1. Receive an email with a blank body, and the content included as an ATT*-labeled attachment to the email
  2. EmailContentAsAttachment

Notes

I understand that this Outlook/Exchange combination is fairly aged, but it's what I'm working with for at least the next couple of months.

I believe this is associated with the changes from #23643, putting the quoted-printable [back] into the emails.

From what I can determine, when a header is rendered, it's processed by a class implementing Zend\Mail\Header\HeaderInterface. There is no class registered for the header "Content-Disposition", so it ends up getting rendered through the Zend\Mail\Header\GenericHeader class. The getFieldValue() method looks like this:

    public function getFieldValue($format = HeaderInterface::FORMAT_RAW)
    {
        if (HeaderInterface::FORMAT_ENCODED === $format) {
            return HeaderWrap::wrap($this->fieldValue, $this);
        }

        return $this->fieldValue;
    }

When commenting out the if() block above, the email looks fine when it's received. What's happening is that the Content-Disposition is getting set to "inline", however when rendered it is being translated as quoted-printable and ends up with a value of =?utf-8?Q?inline?=, instead of inline. The MS Exchange 2010 involved appears to reject or not understand this disposition type and treats it as a generic attachment.

I don't believe that it's necessary/good to have the Content-Disposition header encoded like this. Maybe it is. I'm not completely familiar with the relevant RFCs and it's completely possible that this Exchange server is not handling it correctly. I will be attempting to find a workaround I can implement as a local plugin for now, but wanted to get this out in front of more experienced Magento developers in case the impact is greater than an old and just about out-of-support version of MS Exchange.

Thank you!

The 2.3.3 rollout has been working pretty well for us so far outside of this issue - all the hard work is much appreciated, you guys rock!

Metadata

Metadata

Assignees

Labels

Component: EmailFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: ready for confirmationPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Priority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Triage: Ready for TriageIssue is ready to me triaged with Product Manager

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions