Some messages have two "Content-Type" headers

Created on 24 November 2023, over 1 year ago
Updated 3 December 2023, over 1 year ago

Problem/Motivation

Some (single-part?) messages have an extra Content-Type header, which causes some spam filters to reject messages.

Example rejection message from a real spam filter:

<email-redacted@example.com>: host mx10.spamshield.eu[109.237.215.10] said: 550 Messages
    should have one or no Content-Type headers, not 2. (in reply to end of DATA
    command)

Steps to reproduce

  • set up a fresh Drupal 10.2 test site
  • composer require drupal/symfony_mailer_lite
  • enable Mail System and Drupal Symfony Mailer Lite
  • on /admin/config/system/mailsystem, set the default sender to Drupal Symfony Mailer Lite
  • on /admin/config/system/symfony-mailer-lite/transport, configure an appropriate transport for your test environment
  • log out, then go to /user/password and send yourself a password reset email
  • the resulting message has 2 Content-Type headers:
Received: from [127.0.0.1] (localhost [127.0.0.1])
        by d10-web (Mailpit) with SMTP
        for ; Fri, 24 Nov 2023 21:15:12 +0000 (UTC)
Subject: Replacement login information for admin at Drush Site-Install
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes;
 charset=UTF-8; format=flowed; delsp=yes
X-Mailer: Drupal
Return-Path: <admin@example.com>
Sender: admin@example.com
Reply-to: admin@example.com
To: admin@example.com
From: Drush Site-Install 
Message-ID: <15d6e90e8e79feed0279f630658a9ace@example.com>
Date: Fri, 24 Nov 2023 21:15:12 +0000
Content-Type: text/plain; charset="text/plain"
Content-Transfer-Encoding: quoted-printable

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smokris Athens, Ohio, USA

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

Comments & Activities

Production build 0.71.5 2024