Problem/Motivation
After updating from 8.x-1.0-beta2 to 8.x-2.0-beta1, receiving error code from SMTP (Amazon SES) server when sending mail via drupal queue
Steps to reproduce
Create email queue, i.e.
$queue->createQueue();
$data['module'] = 'my_module';
$data['key'] = $mykey;
$data['params'] = $params;
$data['email'] = $mail;
$data['lang'] = $target_langcode;
$queue->createItem($data);
Run cron
Error message:
An attempt to send an e-mail message failed, and the following error message was returned : Expected response code 250 but got code "554", with message "554 Transaction failed: Missing final '@domain' "
The e-mail carried the following headers:
Return-Path:
Sender: no-reply@mydomain.com
Message-ID: <47b3e028a1b57a586112b0a6ba9788aa@mydomain.com>
Date: Mon, 21 Sep 2020 03:42:58 +0000
Subject: subject
From: XX no-reply@mydomain.com
Reply-to: 1
To: user@mydomain.com
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: quoted-printable
X-Mailer: Drupal
Proposed resolution
Suspected error generated by "Reply-to: 1"
Comments
Comment #2
adominique CreditAttribution: adominique commentedI have managed to find a solution by adding header to my_module_mail hook:
So I am not sure if it is a new configuration or bug.
Comment #3
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThis behaviour is similar to
\Drupal\Core\Mail\MailManager::doMail
, there is no default Reply-To address if no Reply-To header is set.I am not against adding it, because i had to override it a few times in client projects already.