SUMMARY: Help with sendmail.cf file configuration.

From: Ying-Meei Chew (ymc@Telebit.COM)
Date: Wed Aug 11 1993 - 03:56:48 CDT


SUBJECT:

        Does anybody know how to change the sendmail.cf file such that
the "From:" and "Reply To:" field only has the top level domainname of
the site? For example, instead of having the return address as
<username>@hostname.sub-domainname, I like to have it re-written to
<username>@domainname only. Please send mail back to me directly and
I'll summarize later.

Thanks for any help offerred.

**************************************************************************

Thanks to all who responded to my email. All suggestions are very helpful.
You will find that some may apply to your site and some may not, depending
on which mailer you are using. But, the concept is basically the same.

I have no problem fixing the problem with the suggestions given below.
I only did it on a single host, as that particular user wanted it that
way.

Thank-you again to the people listed here for your response:

Ingo Jentsch (ingo@lett.kun.nl)
Eamonn McGonigle (emcgon@ca.dcu.ie)
Andrew Watson <ajw@ansa.co.uk>
Eckhard Rueggeberg (eckhard@ts.go.dlr.de)
David St. Pierre (david@srv.PacBell.COM )
Bill Heiser (heiser@tdwr.ed.ray.com)

SUMMARY:
-------

This is what I do in SunOS 4.1.3. Your mileage may vary.

(sendmail.cf)

DmTDWR.ED.RAY.COM

and

R$+ $@$1<@$m> tack on our hostname
# removed <@$w> because we only want to show our DOMAIN name on outbound mail.

Also, you'll have to get your system(s) to recognize incoming
mail addressed to the DOMAIN (as opposed to the hostname).

Do that with something like this in sendmail.cf:

# make inbound addressed to various names resolve locally
Cwtdw901 TDW901 TDW901.ED.RAY.COM tdwr tdwr.ed.ray.com TDWR.ED.RAY.COM TDWR
 

------------------------------------------------------------------------------

in S22, change occurrence os $w/$j to $m. if you're not running NIS,
set Dm near the top.

------------------------------------------------------------------------------

I do this with the ruleset 11, the sender rewriting for the ethernet mailer.
To be precisely : On all the subsidiaries in my domain, 11 is replaced by the
(empty) ruleset 21, so internal mails have only "user" in the From:-field.
This is ok as we have aliases "user:user@mailboxserver" for every user to
ensure only the machine serving /var/spool/mail appends mails.
Outgoing mail is sent to the mailhost, which automatically appends only the
domainname by the sender rewriting rule defined in the ddn mailer.

------------------------------------------------------------------------------

It depends a little on what your external delivery mailer is. In our case,
its 'ddn'. The sender rewriting rule for the 'ddn' mailer is ruleset 22.
I've rewritten our ruleset 22 as follows :-

S22
#R$*<@LOCAL>$* $:$1
#R$-<@$-> $:$>3${Z$1@$2$} invert aliases
#R$*<@$+.$*>$* $@$1<@$2.$3>$4 already ok
#R$+<@$+>$* $@$1<@$2.$m>$3 tack on our domain
#R$+ $@$1<@$m> tack on our domain
# Rewrite 'user', 'user@host' or 'user@host.ourdomain' as 'user@ourdomain'.
# (EMcG)
R$+<@$->$* $@$1<@LOCAL>$3 user@host
R$+<@$+.LOCAL>$* $@$1<@LOCAL>$3 user@host.thisdomain
R$+<@$+>$* $@$1<@$2>$3 user@host.anydomain
R$+ $@$1<@LOCAL> user

This will vary if, for example, your default mailer is UUCP or ETHER, but the
principe remains the same. If you want any further info, please feel free to
get it touch.

-------------------------------------------------------------------------------

I have changed it in the following way (I use ether):

change line :
R$+ $@$1<@$w> tack on our hostname
to
R$+ $@$1<@$j> tack on our domain name

Hope you are using the same mailer, otherwise it won't help you. (Check the
mailer definition, a line starting 'DM'. If it doesn't say 'DMether' forget this
mail. (Or get in touch again in case noone else has the answer you need.)

-------------------------------------------------------------------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:05 CDT