Hello

After updated the module, I can't send email, with or whithout import swiftmailer config.

Error sending email: Connection to "process /usr/sbin/sendmail -bs" has been closed unexpectedly.

Are you aware of it ? What can it be done to fix it ?

Thanks

Comments

aiphes created an issue. See original summary.

michaelsoetaert’s picture

Make sure that your hosting supports this. I was having the same issue on Acquia and after some research, I found it only supports the -t flag. If your hosting doesn't support the -bs flag, you can configure a new sendmail command in your settings.php file.

This is the documentation for Acquia I followed.

adamps’s picture

Status: Active » Fixed

Hopefully this is now fixed

odeno’s picture

Had this error.
Easiest way to resolve was to remove "Sendmail" as a transport policy option and add "Native" instead.
Change policy at Home -->Administration -->Configuration -->System-->Mailer policy

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

smillerla’s picture

Is there any more advice on how to fix this on Acquia?

I found this document that explains adding sendmail commands to settings.php.

But what commands should be added?

goodboy’s picture

I set $settings['mailer_sendmail_commands'] = ['/usr/sbin/sendmail -t']; in settings.php and there are no errors, but I can receive emails. My own transport returns an error. Is it possible to send emails to Acquia so that they reach the recipient?

bburg’s picture

I just had to debug this on Acquia, I had to add the line goodboy mentions in #8 in settings.php, then add a SendMail transport in the mailer settings, configured to use that command, which becomes an option once you add it in settings.php.

Here's an AI's Assessment explaining why it's needed:

// Acquia Platform Email configuration for symfony_mailer.
//
// Acquia routes outbound mail through /usr/sbin/sendmail (a symlink to their
// compiled ah-email-client binary). symfony_mailer's SendmailTransport
// validates that any sendmail command contains "-bs" or "-t"; the default
// "-bs" flag is not supported by Acquia's binary, so we must explicitly use
// "-t" (pipe-to-stdin mode).
//
// $settings['mailer_sendmail_commands'] whitelists the command so
// ReplacementSendmailTransportFactory (in the symfony_mailer module) allows
// it. Without this whitelist the module throws "Unsafe sendmail command"
// before the process is ever spawned.