SUMMARY: sendmail: How to always tack on _at_domain for outgoing mail.

From: Thomas Leitner <tom_at_radar.tu-graz.ac.at>
Date: Mon, 18 Jan 1999 21:21:19 +0100 (MET)

Hello,

So here's how I finally did it:

Problem #1: local mail bounces back from local mail server because Digital
Unix's sendmail does not append the domain name to the From: address.

Solution: The mail server is running sendmail 8.9.2 and I've added
FEATURE(accept_unqualified_senders) to its configuration. Now,
the From: address is accepted without an attached domain name.
This does *not* pose any additional security risk because the mail
server is not directly reachable from outside.

Problem #2: Under Digital Unix 4.0E, local e-mail is sent to the
central mailhub rather then directly to the target host *if* the
target host has both an A and MX DNS record where the MX record
points to the central mailhub.

Solution: Add this to your sendmail.cf:

# if we are the best MX host for a site, try it directly instead of config err
O TryNullMXList

Actually this is already in the DU 4.0E sendmail.m4 file but it is
commented out. Since I didn't know how to change this from the host.m4
file, I took the dirty route and modified the sendmail.m4 file directly
and rebuilt the host.cf file from it.

Finally many thanks to the following people for their replies:

     Ward Edwards <wedwards_at_cfmmajestic.com>
     Martin Mokrejs <mmokrejs_at_natur.cuni.cz>
     Tom Smith <smith_at_cag.lkg.dec.com>

I'm attaching the replies below.

Thanks again everybody // Tom

------------------------------------------------------------------
From: Ward Edwards <wedwards_at_cfmmajestic.com>

Hi Tom,

If you have access to the DNS you can enter a second MX record with a
higher preference (lower number) for that machine and make sure that the
sendmail is configured to send any non-local mail to the mail hub directly.

------------------------------------------------------------------
From: Martin Mokrejs <mmokrejs_at_natur.cuni.cz>

Hello Tom,
 first of all:
try
FEATURE(always_add_domain)

if it will make /bin/mail happier. On my machines it works the same: mail,
mail do not append _at_domain when sendmail e-mail locally, it message goes
outside the host, sendmail masquerades as _at_natur.cuni.cz
(`DMnatur.cuni.cz' line)

There are some features that do specifically handle "unqualified names",
which is the case of mail and the others. I can't find it right know.
See those README files in sendmail's tree.

> P.S: As an aside: I have upgraded one machine to Digital Unix 4.0E and
> found the following strange behaviour: The local mail relay
> is defined as finwds01.tu-graz.ac.at which has both, an DNS
> A record and a DNS MX record. However the MX record points to our
> campus wide mailgate. Now all outgoing e-mail, even if it's a local
> e-mail goes through the campus mailgate and comes back to our local
> mail server. This is not necessary, IMHO. Any idea anyone how
> to avoid this?

Try the line (edit it in sendmail.cf):

# if we are the best MX host for a site, try it directly instead of configerr
O TryNullMXList

-----------------
If you need pre-compiled and prepared sendamil.cf and binaries, have a
look on http://www.natur.cuni.cz/~mmokrejs/sendmail

------------------------------------------------------------------------
From: Tom Smith <smith_at_cag.lkg.dec.com>

If you're asking about the sendmail.cf for sendmail V5.65, look in
ruleset 0 for a line that contains "#smtpl" on the right-hand side.
Comment it out. The smtpl mailer omits the sender domain in certain
circumstances. Commenting out the rule makes all outgoing mail go
through the smtp mailer, which always attaches a domain.

-Tom
------------------------------------------------------------------------
From: Tom Smith <smith_at_cag.lkg.dec.com>

> > P.S: As an aside: I have upgraded one machine to Digital Unix 4.0E and
> > found the following strange behaviour: The local mail relay
> > is defined as finwds01.tu-graz.ac.at which has both, an DNS
> > A record and a DNS MX record. However the MX record points to our
> > campus wide mailgate. Now all outgoing e-mail, even if it's a local
> > e-mail goes through the campus mailgate and comes back to our local
> > mail server. This is not necessary, IMHO.
>
> Any idea anyone how to avoid this?
>

sendmail always uses the MX records if present. It only uses the A
record if there are no MX records. Every host should usally have itself
as its highest priority MX record. You should probably add
"IN MX 1 finwds01.tu-graz.ac.at" to the DNS entry for
finwds01.tu-graz.ac.at.

-Tom

------------------------------------------------------------------------
From: Martin Mokrejs <mmokrejs_at_natur.cuni.cz>
Subject: Try these in some.m4

# who I send unqualified names to (null means deliver locally)
DR`'ifdef(`LOCAL_RELAY', LOCAL_RELAY)

# who gets all local email traffic ($R has precedence for unqualified names)
DH`'ifdef(`MAIL_HUB', MAIL_HUB)

----------------- O R I G I N A L Q U E S T I O N -------------------------
Subject: sendmail: How to always tack on _at_domain for outgoing mail.

Hi,

This weekend, I've upgraded our mail server on Ultrix 4.4 to sendmail
8.9.2. All our Alphas are relaying their outgoing e-mail through this mail
server. The mail server is configured to require the from: address to have
the domain name tacked on. Mail sent, for instance from "tom" is not
accepted. It needs "tom_at_radar.tu-graz.ac.at" now, even for locally
received e-mail.

While this works without problems with mails sent by pine, the /bin/mail
and /bin/mailx commands do not work and cause the mails to be bounced
by the mail server like this:

While talking to finwds01:
>>> MAIL From:<tom>
<<< 553 <tom>... Domain name required
554 tom_at_finwds01.tu-graz.ac.at... Remote protocol error

Apparently pine itself appends the domain name to the sender address
and mail and mailx do not.

I have already checked my Digital Unix 4.0D sendmail setup and my
/var/adm/sendmail/hostname.m4 file contains:

dnl -- Name tacked on exported local addresses (user_at__ExportedName)
define(_ExportedName, {finwds01.tu-graz.ac.at})dnl

which apparently does not work!! When I add me to this list:

dnl -- Users which always need $j tacked on
define(_NonHiddenUsers, {root postmaster news uucp mailer-daemon rdist
nobody})dnl

the outgoing mail gets "xxxxx.tu-graz.ac.at" tacked on and local
e-mail is delivered.

But for some reason, the _ExportedName setting does not work.

Any ideas anyone?

Thanks a lot // Tom

P.S: As an aside: I have upgraded one machine to Digital Unix 4.0E and
     found the following strange behaviour: The local mail relay
     is defined as finwds01.tu-graz.ac.at which has both, an DNS
     A record and a DNS MX record. However the MX record points to our
     campus wide mailgate. Now all outgoing e-mail, even if it's a local
     e-mail goes through the campus mailgate and comes back to our local
     mail server. This is not necessary, IMHO. Any idea anyone how
     to avoid this?
-- 
--------------------------------------------------------------------------
T o m   L e i t n e r                       Dept. of Communications
                                            Graz University of Technology, 
e-mail    : tom_at_radar.tu-graz.ac.at         Inffeldgasse 12
Phone     : +43-316-873-7455                A-8010 Graz / Austria / Europe
Fax       : +43-316-463-697
Home page : http://wiis.tu-graz.ac.at/people/tom.html
PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send 
mail with subject "get Thomas Leitner" to pgp-public-keys_at_keys.pgp.net
--------------------------------------------------------------------------
    Before we have the paperless office, we have the paperless toilet!
Received on Mon Jan 18 1999 - 20:22:16 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT