Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!usc!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: sendmail.cf Message-ID: <15918@bloom-beacon.MIT.EDU> Date: 15 Nov 89 10:22:20 GMT References: <1989Nov13.193000.12827@tse.uucp> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 44 In article <1989Nov13.193000.12827@tse.uucp> rick@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@host1; >but, if user2 sends mail it has the return address user2@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710