Sendmail reply-to address


We’re configuring sendmail to be a relay in order to send voicemail emails.

Our ISP’s smtp server requires authentication as well as requiring that the reply-to address matches the from address.

We can authenticate without problem by using the following in and setting up the client-info file

FEATURE(authinfo',hash /etc/mail/auth/client-info’)dnl

We believe the probem we have lies with setting the reply-to address - we are setting serveremail in voicemail.conf

The session traces in maillog we get are like the following:

Jul 5 00:02:19 localhost sendmail[13371]: q64N2JWl013371: from=root, size=7638, class=0, nrcpts=1, msgid=Asterisk-1-826521046-2001-3550@localhost.localdomain, relay=root@localhost
Jul 5 00:02:19 localhost sendmail[13372]: q64N2JAj013372: from=root@localhost.localdomain, size=7770, class=0, nrcpts=1, msgid=Asterisk-1-826521046-2001-3550@localhost.localdomain, proto=ESMTP, daemon=MTA, relay=localhost.localdomain []
Jul 5 00:02:19 localhost sendmail[13371]: q64N2JWl013371: to=“recipient display text”, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=37638, relay=[] [], dsn=2.0.0, stat=Sent (q64N2JAj013372 Message accepted for delivery)
Jul 5 00:02:20 localhost sendmail[13374]: q64N2JAj013372:, ctladdr=root@localhost.localdomain (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=127770, [], dsn=5.1.3, stat=User unknown
Jul 5 00:02:21 localhost sendmail[13374]: q64N2JAj013372: q64N2LAj013374: DSN: User unknown
Jul 5 00:02:21 localhost sendmail[13374]: q64N2LAj013374: to=root@localhost.localdomain, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=39035, dsn=2.0.0, stat=Sent

The failed emails sent to root are like:
From MAILER-DAEMON@localhost.localdomain Thu Jul 5 00:02:21 2012
Return-Path: MAILER-DAEMON@localhost.localdomain
Received: from localhost (localhost)
by localhost.localdomain (8.13.8/8.13.8) id q64N2LAj013374;
Thu, 5 Jul 2012 00:02:21 +0100
Date: Thu, 5 Jul 2012 00:02:21 +0100
From: Mail Delivery Subsystem <>
Message-Id: 201207042302.q64N2LAj013374@localhost.localdomain
To: root@localhost.localdomain
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message


The original message was received at Thu, 5 Jul 2012 00:02:19 +0100
from localhost.localdomain []

----- The following addresses had permanent fatal errors -----
(reason: 553 root@localhost.localdomain: Sender address rejected: not owned by user

----- Transcript of session follows -----
… while talking to

<<< 553 root@localhost.localdomain: Sender address rejected: not owned by user
550 5.1.1… User unknown
<<< 554 Error: no valid recipients

Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Thu, 5 Jul 2012 00:02:19 +0100

Final-Recipient: RFC822;
Action: failed
Status: 5.1.3
Remote-MTA: DNS;
Diagnostic-Code: SMTP; 553 root@localhost.localdomain: Sender address rejected: not owned by user
Last-Attempt-Date: Thu, 5 Jul 2012 00:02:20 +0100

Content-Type: message/rfc822

Return-Path: root@localhost.localdomain
Received: from localhost.localdomain (localhost.localdomain [])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id q64N2JAj013372
for; Thu, 5 Jul 2012 00:02:19 +0100
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id q64N2JWl013371;
Thu, 5 Jul 2012 00:02:19 +0100
Date: Thu, 05 Jul 2012 00:02:19 +0100
From: “The Asterisk PBX”
To: “recipient display text”
Subject: =?ISO-8859-1?Q?You_have_a_New_Voicemail_from_=22GDL=22_=3C1000?=
Message-ID: Asterisk-1-826521046-2001-3550@localhost.localdomain
X-Asterisk-CallerID: 1000
X-Asterisk-CallerIDName: GDL
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=“----voicemail_1200135501915385626”

This is a multi-part message in MIME format.

Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Dear Recipient ,
You have received a new voicemail from “GDL” <1000>
on Thursday, July 05, 2012 at 12:02:19 AM.
Find attached.

Asterisk PBX
Content-Type: audio/x-WAV; name=“msg0000.WAV”
Content-Transfer-Encoding: base64
Content-Description: Voicemail sound attachment.
Content-Disposition: attachment; filename=“msg0000.WAV”





Can anybody help please?

What you are referring to is called the envelope address, not the reply-to address.

You have a misconfigured DNS or /etc/hosts. There should be an entry in at least one of them that gives the proper domain name for the machine.

The MASQUERADE options may also help you set an acceptable envelope sender.


Thank you for your reply.

We’ve tried the various MASQUERADE options in with no success.

We can correctly resolve external domains via our DNS.

The development box is an internal box sitting behind a shared public address - if our ISP’s server is and our email domain is, what should we do with the MASQUERADE options and hosts file in order for emails to be sent from

LINUX / Asterisk and everything related are new to us so we’re on a steep learning curve so apologies if I’m asking the obvious.

Your problem is reverse resolving the internal address, not resolving external names.

MASQUERADE_AS(mypublicemaildomain.example')dnl FEATURE(masquerade_envelope’)dnl

Thank you for your reply.

Now solved!

We used:
MASQUERADE_AS(')dnl FEATURE(masquerade_envelope’)dnl

as per your suggestion but found we also had to add a -f switch on the sendmail command in voicemail.conf:
mailcmd=/usr/sbin/sendmail -t

Thank you again.

I almost mentioned the -f option, but wasn’t sure if the command options were exposed. -f will only work for those specific mails.

It is possible that you need to set the masquerade’s in Most of my experience is before the sumit/relay split and we hacket to bypass on the one I did recently.

You should not run asterisk as root.

I think that now we have a working solution we’ll leave well alone for the time being at least.

Why should we not run Asterisk as root?