sendmail.cf

Jonathan I. Kamens jik at athena.mit.edu
Wed Nov 15 21:22:20 AEST 1989


In article <1989Nov13.193000.12827 at tse.uucp> rick at tse.uucp writes:
>Is it possible to change the sendmail.cf file to indicate a different
>host for different local users?
>
>For example: if user1 sends mail the return address looks like user1 at host1;
>but, if user2 sends mail it has the return address user2 at host2 (even though
>they are working on the same machine).

  Yes.  Define several classes read from files in the sendamil.cf
file; each class represents all the users who should be from one
particular host.

  Then, in the sender pre-write you match against each of those
classes and tack on the appropriate host for any matches.

  I'm assuming that you don't want to tack a host on if the user has
manually specified the host himself -- if the user specifies the from
host, then he really wants mail to go there :-).  If you want to
enforce the host divisions, you need to strip off any host specified
by the sender before matching against the classes.  The level of
paranoia and care you take in doing this is up to you.

  Of course, you can do the same thing for recipients if you want mail
to automatically be delivered to the right host, given only the
username.

  All of this is a little dangerous, because you have to keep all
these files up-to-date on all of the hosts involved.  It's usually a
better idea, when a somewhat large number of hosts is involved, to
have a central machine that knows all the usernames, and to forward
all mail to that machine for delivery, instead of trying to put
correct hosts in the sender field.  Give that machine an automatically
generated aliases file that forwards mail to the appropriate mail
hosts.

  (That's how Project Athena mail works.  Athena.mit.edu is actually
just a mailhub which does mailing list expansion and mail delivery to
Athena users, whose mail actually lives on several post office
machines.)

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list