Sendmail reply-to address

Hi,

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 sendmail.mc and setting up the client-info file

define(SMART_HOST', smtp.fasthosts.co.uk’)dnl
define(confAUTH_MECHANISMS', EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
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 [127.0.0.1]
Jul 5 00:02:19 localhost sendmail[13371]: q64N2JWl013371: to=“recipient display text” recipient@ourdomain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=37638, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q64N2JAj013372 Message accepted for delivery)
Jul 5 00:02:20 localhost sendmail[13374]: q64N2JAj013372: to=recipient@ourdomain.com, ctladdr=root@localhost.localdomain (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=127770, relay=smtp.fasthosts.co.uk. [213.171.216.50], 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 <MAILER-DAEMON@notifications@ourdomain.com>
Message-Id: 201207042302.q64N2LAj013374@localhost.localdomain
To: root@localhost.localdomain
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary=“q64N2LAj013374.1341442941/localhost.localdomain”
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

–q64N2LAj013374.1341442941/localhost.localdomain

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

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

----- Transcript of session follows -----
… while talking to smtp.fasthosts.co.uk.:

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

–q64N2LAj013374.1341442941/localhost.localdomain
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; recipient@ourdomain.com
Action: failed
Status: 5.1.3
Remote-MTA: DNS; smtp.fasthosts.co.uk
Diagnostic-Code: SMTP; 553 root@localhost.localdomain: Sender address rejected: not owned by user notifications@ourdomain.com
Last-Attempt-Date: Thu, 5 Jul 2012 00:02:20 +0100

–q64N2LAj013374.1341442941/localhost.localdomain
Content-Type: message/rfc822

Return-Path: root@localhost.localdomain
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id q64N2JAj013372
for recipient@ourdomain.com; 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” notifications@ourdomain.com
To: “recipient display text” recipient@ourdomain.com
Subject: =?ISO-8859-1?Q?You_have_a_New_Voicemail_from_=22GDL=22_=3C1000?=
=?ISO-8859-1?Q?=3E?=
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.

------voicemail_1200135501915385626
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
------voicemail_1200135501915385626
Content-Type: audio/x-WAV; name=“msg0000.WAV”
Content-Transfer-Encoding: base64
Content-Description: Voicemail sound attachment.
Content-Disposition: attachment; filename=“msg0000.WAV”

UklGRv4SAABXQVZFZm10IBQAAAAxAAEAQB8AAFkGAABBAAAAAgBAAWZhY3QEAAAAgFwAAGRh

HDaa3Ao4m3kZRg==

------voicemail_1200135501915385626–

–q64N2LAj013374.1341442941/localhost.localdomain–

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 sendmail.mc MASQUERADE options may also help you set an acceptable envelope sender.

Hi,

Thank you for your reply.

We’ve tried the various MASQUERADE options in sendmail.mc 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 smtp.fasthosts.co.uk and our email domain is ourdomain.co.uk, what should we do with the MASQUERADE options and hosts file in order for emails to be sent from ourdomain.co.uk?

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(mypublicemaildomain.com')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 -fnotifications@mypublicemaildomain.com

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 submit.mc. Most of my experience is before the sumit/relay split and we hacket submit.mc to bypass sendmail.mc 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?