Problem/Motivation

I have always used the full symfony_mailer module until DCMS when the easy_email_express recipe now installs this module. So I can't tell if webforms used to send attachments earlier until perhaps some new releases of the module or the Symfony Mailer library.

I read about some latest releases introducing a security restriction that prevents files from the private:// file system from being attached to emails unless they are explicitly authorized.

I attached a private PDF file to Webform and did all necessary settings to add the file as email attachment but when the email sends the file is not attached.

Because this module lacks the Mailer Policy UI found in the full version symfony_mailer module, there is currently no way for a site administrator to grant private:// file system access to webforms via the interface.

Steps to reproduce

  1. Install and apply the easy_email_express recipe.
  2. Configure a Webform to send an email with a PDF file attachment.
  3. Configure a Webform Email handler to include the PDF file as an email attachment.
  4. Send a submission; the email arrives but the attachment is missing.

Proposed resolution

Provide a mechanism to authorize private file attachments, or implement a default adjuster that allows Webform attachments specifically, similar to how the full module handles it via policies.

Issue fork easy_email-3589754

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chike created an issue. See original summary.

chike’s picture

Issue summary: View changes
zengenuity’s picture

Project: Drupal Symfony Mailer Lite » Easy Email

This issue is being caused by Easy Email, not Symfony Mailer Lite. Moving it to the correct queue.

zengenuity’s picture

Version: 2.0.x-dev » 3.0.x-dev

zengenuity’s picture

Status: Active » Needs review
chike’s picture

I got this,

$ ddev drush cr
PHP Parse error:  syntax error, unexpected token "=>", expecting "]" in /var/www/html/public_html/modules/contrib/easy_email/modules/easy_email_override/src/Form/EmailOverrideForm.php on line 272

Parse error: syntax error, unexpected token "=>", expecting "]" in /var/www/html/public_html/modules/contrib/easy_email/modules/easy_email_override/src/Form/EmailOverrideForm.php on line 272
zengenuity’s picture

Sorry. Bad copy-paste of some code from my dev environment. Please try it again.

chike’s picture

Caches successfully cleared this time.

I didn't see an attachment in email testing with Mailpit, tomorrow I will push to production and test.

zengenuity’s picture

Sorry, I forgot to mention that there is a setting you need to change for existing sites. Go to the default override setting at Structure > Email Templates > Overrides > Default. There's a new checkbox to "Trust attachments from original email". Make sure that's checked and test again.

chike’s picture

I turned on the checkbox and yet the attachment didn't arrive in Mailpit.