StarCitizenWiki / mediawiki-extensions-SymfonyMailer

GNU General Public License v2.0
0 stars 1 forks source link

HTML and Multipart emails are not encoded properly #1

Open alistair3149 opened 1 week ago

alistair3149 commented 1 week ago

With SymfonyMailer enabled, the HTML and Multipart emails received from MediaWiki are not encoded properly. MediaWiki already encoded the $body passed to the hook. Using the text() or html() methods on the Email class break the email content.

Steps to reproduce

  1. Allow MediaWiki to send HTML by setting $wgAllowHTMLEmail = true;
  2. Install and enable Extension:Echo
  3. Trigger a email notification (e.g. Putting a message in your own talk page)
  4. Observe the email received

Actual result Email becomes gibberish because of the encoding characters and raw HTML.

Expected result Email is formatted properly and the HTML is rendered.

octfx commented 4 days ago

I've looked into this. Symfony Mailer currently has no easy way of sending an already pre-encoded multipart mail.

While there are methods for sending such mails (https://symfony.com/doc/current/components/mime.html#creating-raw-email-messages) this is not supported when using the default Email class (https://symfony.com/doc/current/mailer.html#message-contents).

I've tried sending a html mail locally without Extension:SymfonyMailer installed and the output does look correct: image

Maybe Ext:SymfonyMailer can be sunsetted?

alistair3149 commented 4 days ago

Maybe Ext:SymfonyMailer can be sunsetted?

I agree with sunsetting it.

The original use case for SwiftMailer seems to be that PEAR mail is not being maintained, but it is not the case anymore. And HTML emails and multipart emails are working fine without the extension.