Sender SMTP header

Generally speaking, emails sent by RT are working fine (notifications when assigning, commenting, reminders…) but not when sending dashboard subscriptions.

I’ve seen that RT adds the “Sender:” SMTP header with the value user@servername (www-data@rt in my case). It’s blocked by policy by the email system. I’ve two options: ask the admin to change the rule that blocs my messages or change the value set by RT.

I prefer the second option. Is there any way of setting Sender’s value? I’ve been digging in the code a couple of days without luck.

I’ve read the answer in this post that sendmail is the responsible of adding this header, but configuring $MailCommand as testfile I can see the following headers in the mail sent by root while executing rt-email-dashboard:

X-Mailer: MIME-tools 5.510 (Entity 5.510)
Sender: root <>
Subject: my.subject
Date: Tue, 26 Mar 2024 14:03:17 +0100
Content-Type: multipart/mixed; boundary="----------=_1711458197-2187104-0"
Content-Transfer-Encoding: binary
X-RT-Dashboard-ID: 115
X-RT-Dashboard-Subscription-ID: 122
Precedence: bulk
From: rt.address@my.domain
MIME-Version: 1.0

This is a multi-part message in MIME format...

So I presume that RT is adding the Sender header, isn’t it? How can I set it’s value?

X Files…

I’ve tested right now the following steps:

  1. Set $MailCommand = testfile
  2. Set $SendmailArguments = -oi -ODeliveryMode=b -OErrorMode=m
  3. Send a test email in Dashboard subscription
  4. I’ve seen RT complains about the -f option in $SendmailArguments.
  5. Set to the previous value $SendmailArguments = -oi -ODeliveryMode=b -OErrorMode=m
  6. Set $MailCommand = sendmailpipe
  7. Test again… surprisingly, the mail is sent.
  8. Checking the SMTP headers… the “Sender:” header is gone.

I can’t figure out what has happened, but it’s working now.