herd-community icon indicating copy to clipboard operation
herd-community copied to clipboard

[Bug]: Mail service crashes when sending email with image from Symfony

Open alexvd95 opened this issue 1 year ago • 0 comments

Platform

macOS

Operating system version

macOS Sonoma 14.5

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.9.1 (Build: 31)

PHP Version

No response

Bug description

At my job we use Symfony, and email template are built using Twig. All emails use the same base layout, which contains a PNG image in the header. Whenever I send email through Herd's mailer, the mail service crashes with the log output attached below, and no emails are sent. When I use a service like Mailhog, the email is sent just fine, including the header image.

Emails are sent using the Symfony mailer.

In case it's relevant, the image is available in both the assets and public directory, under /images/[file].png.

It's included in the template with <img src="{{ email.image('@images/[file].png') }}">.

I would expect it to just work, as it does work without issues using other local mail services.

Steps to reproduce

  1. create a Symfony project
  2. create Twig email template and include an image available in your project
  3. send an email using Symfony's Mailer component.

Relevant log output

node:fs:599
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/Users/[user]/Library/Application Support/Herd/Log/mail//774ba4fb59c449ecd0c8ee856f082b27/2-@images/[file].png'
    at Object.openSync (node:fs:599:3)
    at Object.openSync (pkg/prelude/bootstrap.js:793:32)
    at Object.writeFileSync (node:fs:2221:35)
    at /snapshot/herd-mailserver/index.js
    at Array.map (<anonymous>)
    at /snapshot/herd-mailserver/index.js {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/[user]/Library/Application Support/Herd/Log/mail//774ba4fb59c449ecd0c8ee856f082b27/2-@images/[file].png'
}

Node.js v18.5.0

alexvd95 avatar Aug 16 '24 07:08 alexvd95