home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.mail.sendmail
- Path: sparky!uunet!think.com!enterpoop.mit.edu!bloom-picayune.mit.edu!vlcek
- From: vlcek@mtl.mit.edu (Jim Vlcek)
- Subject: Re: Is it possible to alias a hostname?
- Message-ID: <1993Jan2.113941.23309@athena.mit.edu>
- Summary: I think I've got it
- Sender: vlcek@epimbe.com (Jim Vlcek)
- Nntp-Posting-Host: mtl.mit.edu
- Organization: EPI / Chorus Corporation
- References: <1992Dec30.110027.24942@athena.mit.edu>
- Date: Sat, 2 Jan 1993 11:39:41 GMT
- Lines: 67
-
- I'd needed a way to redirect mail that was addressed to PCs which
- (rather misguidedly) used SMTP to forward outgoing messages, but
- couldn't accept incoming mail. Greg Woods of NCAR was quite helpful,
- and now I think I've got a solution:
-
- Basically, a Unix mailhost running sendmail must intercept the
- mail messages targeted to a PC and redirect them instead to the
- POP server. This must be done by implementing new rules into the
- sendmail.cf file.
-
- First, I defined a new class (named "C") of "mail clients"; these
- are the PCs which might originate (but cannot receive) SMTP mail.
- This is accomplished with the following line in /etc/sendmail.cf:
-
- FC/etc/mailclients
-
- The actual names of the PCs are placed in the file /etc/mailclients
- (one name per line, hostname ONLY (not fully qualified host w/
- domain))
- rather than specifying them in the sendmail.cf file itself; this makes
- maintenance much easier as well as keeping the whole process more
- streamlined.
-
- Next, the rewrite rules for the mailclients must be included in
- sendmail.cf. This is accomplished by the following two rules:
-
- R$*<@$=C>$* $1<@LOCAL>$3 <@pc> -> <@LOCAL>
- R$*<@$=C.$=m>$* $1<@LOCAL>$4 <@pc.dom> -> <@LOCAL>
-
- This maps addresses of the form <user@pcname> or
- <user@pcname.subdomain.domain> into <user@LOCAL>, which is what my
- Sun's sendmail wants to see (I'm not certain, but others may be
- different). Note that $=C matches any hostname in the class "C",
- and $=m matches any name in the class of valid domain names for this
- site.
-
- Now, the question is, where should these rules be placed (ie, in which
- ruleset)? Ruleset three is used to map addresses into an internal
- canonical form, so these rules should be placed somewhere such that
- they are invoked directly or indirectly by ruleset three.
-
- In the Sun sendmail.cf, ruleset six ("special local conversions") is
- invoked directly by ruleset three. It previously consisted of but one
- rule:
-
- R$*<@$*$=m>$* $1<@$2LOCAL>$4 convert local domain
-
- which simply mapped <user@localhost.subdomain.domain> into
- <user@localhost.LOCAL>. This seemed like the obvious place to put the
- two new rules, so I placed them there. Oh, I put them before the
- existing rule so that they wouldn't have to deal with rewritten
- addresses like <user@pcname.LOCAL>.
-
- Other systems would probably have to modify the rule definitions
- and their location somewhat, I would imagine.
-
- SInce we're a small shop, I've just got aliases set up for all users
- on the uucp host (my SUn) that provides the link to uunet. In other
- environments, it might be more advantageous to set up MX records for
- the PCs in the mail link's DNS, directing all the mail for the PCs to
- the POP host. Then, the hacks that I've described above should be
- done on the POP host rather than the mail gateway.
-
- Thanks again, Greg.
-
- Jim Vlcek
- vlcek@epimbe.com
-