Limit sendmail transport to commands specified in settings.php

Created on 27 May 2025, about 1 month ago

Problem/Motivation

When using the Sendmail transport, it's currently possible to set the sendmail command to anything. Drupal core follows a more strict approach that limits the acceptable sendmail commands to those specified in settings.php. We should adopt this same approach for added security.

Steps to reproduce

Install the Drupal Symfony Mailer Lite. Add a Sendmail transport under Configuration > Drupal Symfony Mailer Lite > Transport.

Proposed resolution

Limit the sendmail commands to those specificed in $settings['mailer_sendmail_commands'] in settings.php.

Remaining tasks

Add MR with changes.

User interface changes

Sendmail transport add/edit form will only include custom commands specified in settings.php.

API changes

Sendmail transport will fail if configured with commands not specified in settings.php.

Data model changes

None.

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States zengenuity

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024