Settings custom send mail command on multiple env

Created on 13 May 2025, 2 days ago

Problem/Motivation

I'm using mailpit on multiple env (DDEV , integration, QA and prepod) and default sendmail on Prod.
DDEV and the other non prod env have a different settings :

So I add (as recommanded) the following line in settings.local.php:

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

I notice that the complete command is stored in conf :
settings.local.php

  • DDEV : /usr/local/bin/mailpit sendmail -t --smtp-addr 127.0.0.1:1025 -t
  • non prod : /usr/local/bin/mailpit sendmail -t

So I had to override the config in the settings.local.php (since i could not use a config split because this settings is managed by sysadmin)

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

Proposed resolution

Is it the correct solution, did I missing something in the doc? If not I suggest to document this case or to provide another mecanism ?

Feature request
Status

Active

Version

1.5

Component

Documentation

Created by

🇫🇷France o'briat Nantes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024