Problem/Motivation

Symfony Mailer library now recommends Sendmail, and avoiding Native.

Proposed resolution

  • Create Sendmail transport. Use a settings.php variable mailer_sendmail_commands to specify available commands (otherwise can execute arbitrary shell commands).
  • Add warning to Native transport
  • Change default configuration to Sendmail
  • Update hook: if the automatically created Native transport still exists, delete it and replace with Sendmail
  • Create Null transport

Remaining tasks

User interface changes

API changes

Data model changes

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new11.52 KB

  • AdamPS committed b4ce44d on 1.x
    Issue #3274465 by AdamPS: Add Sendmail transport
    
adamps’s picture

Status: Needs review » Fixed
adamps’s picture

Status: Fixed » Needs review
StatusFileSize
new1.74 KB

Small correction

adamps’s picture

Status: Needs review » Fixed

  • AdamPS committed 556380e on 1.x
    Issue #3274465 by AdamPS: Add Sendmail transport (correction)
    

Status: Fixed » Closed (fixed)

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

super_romeo’s picture

To send mails to Mailhog on dev-enviroment:

  1. Add in settings.local.php:
    # Symfony Mailer module sendmail commands.
    $settings['mailer_sendmail_commands'] = [
      '/usr/sbin/sendmail -i -S -t mailhog:1025',
    ];
    
  2. Add new transport with id = mailhog and select Command = usr/sbin/sendmail -i -S -t mailhog:1025.
  3. Add in settings.local.php:
    $config['symfony_mailer.settings']['default_transport'] = 'mailhog';
    
alex g’s picture

Just in case someone is using laragon on Windows you can use something similar to the below:

$config['symfony_mailer.mailer_transport.sendmail']['configuration']['query']['command'] = ini_get('sendmail_path') . ' -t';

$settings['mailer_sendmail_commands'] = [
ini_get('sendmail_path') . ' -t'
];