SMTP From address meta issue

Created on 8 September 2022, about 2 years ago
Updated 26 May 2023, over 1 year ago

Problem/Motivation

Several issues around the 'From' address are causing issues with the 1.1 release. Instead of trying to fix each of these in a vacuum, I want to make one meta issue with a patch that addresses them together. Especially since these issues intermingle with each other.

The following issues are impacted:
#3304906: Reply-to header missing after upgrading from 1.0 to 1.1 β†’
#3304449: Error sending e-mail from Sender Name - Invalid address: (From):... (every sender email rejected by Drupal's core validation) β†’
#3304401: From address considered invalid β†’
πŸ› Use from address set in config for all emails Closed: duplicate

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States japerry KVUO

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada endless_wander

    I am experiencing this issue and confirmed that SMTP module is up-to-date and code from commits in this thread are in my codebase. In debugging my particular instance of this issue, I found the MIMEMail module to be responsible.

    If I output $mailerArr from SMTPMailSystem::mail() at line 707, my Sender address looks like this with the brackets. More debugging shows the Sender value is fine until line 432 where the return-path is setting the Sender email address:

            case 'return-path':
              $mailer->Sender = $value;
              break;

    In the MIMEMail config at /admin/config/system/mimemail, there is a field for the "Sender email address." Leaving this field blank when submitting the settings form will fill it in automatically with the site email address from Site settings. Whatever address I put into this MIMEMail config field is the one that gets set as Sender in the return-path case above. So, the <> characters appear to be coming from MIMEMail.

    There is an active issue for MIMEMail module here -- https://www.drupal.org/project/mimemail/issues/3257799 πŸ› RfcComplianceException: RFC 2822 Needs work -- that seems to have the same confusion of responsibility as experiencing here. Maybe this is something in core? Our site recently updated to PHP 8.1 and that seems to be when the problems started so maybe PHP 8.1 is stricter as well? Just spitballing.

  • πŸ‡ͺπŸ‡ΈSpain JavierGL

    Here is a small patch to retrieve 'From' Drupal handling, this way it can be altered again if necessary

Production build 0.71.5 2024