[comp.mail.sendmail] sendmail "from" lines in local network

dan@asihub.UUCP (Dan O'Neill) (11/10/89)

On mail that is passed around our local ethernet, I would like to have
the "@hostname" portion of the "from:" line removed.

Currently all users have a ".forward" file in their home directory.
Mine, for instance, says "dan@asisan".

If I send mail to myself from host "asisan", the from line looks like:

  From: dan (Dan O'Neill)

If I send mail to myself from host "sanf", the from line looks like:

  From: dan@sanf (Dan O'Neill)

I would like all mail that is delivered/sent locally to contain only
the name of the user in the from fields.

I have changed the "from" field definitions and some of the resolution
rules with no luck.  I am beginning to think that "sendmail" places
the name of the system after the user name when mail is delivered.

Thanks for any help you can give.

lcz@dptspd.sat.datapoint.com (Lee Ziegenhals) (11/11/89)

dan@asihub.UUCP (Dan O'Neill) writes:

>On mail that is passed around our local ethernet, I would like to have
>the "@hostname" portion of the "from:" line removed...

Dan, I did exactly what you described by modifying the sender field
rewriting rules in the *local* mailer definition.  It checks the host
name against a class of hosts that are in what I call my "administrative
naming sphere".  All hosts within this class have the same aliases file,
which route a user's mail to the appropriate host.  For mail purposes,
then, all of these hosts are considered "local", and no host name is
needed.

Below is an excerpt from the local mailer sender rewriting rules that
accomplish the task:

---

# If the sending host is in our our naming sphere, reduce to just the user name
R$*<@$=A>$*		$>11$1<@$2>$3		Strip local host


# Ruleset for removing local host name from address that is within our
# administrative naming sphere.  Called from local mailer.
S11

R$*<$*$=A>$*		$1			Strip host name
R$*<$*>$*		$1$2$3			Defocus
R$+			$:$>3$1			Make canonical

---

Note that the call to ruleset 11 is not preceded by a "$:", so that the
call is reapplied until it fails.  This will strip *all* local hosts
from the host name.

If you do this, make sure that all of the hosts to which this applies
knows how to send to any outside host that any of the others know about.
In other words, if A and B are in your "administrative naming sphere", and
Y is an outside host that talks only to A, make sure that B knows to send
mail for Y to A.  This is because the above rule will strip the local host
from the following line:

	From: A!Y!user

to become:

	From: Y!user

The other alternative, of course, would be to modify the rule so that
only users on one of the local nodes has the local hostname sripped.  We
did it the other way on purpose, because we wanted all of our hosts in
the specified class to apprear logically as one host for mail purposes.

Hope this helps!

-Lee Ziegenhals