home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / mail / sendmail / 3093 < prev    next >
Encoding:
Text File  |  1993-01-02  |  3.3 KB  |  81 lines

  1. Newsgroups: comp.mail.sendmail
  2. Path: sparky!uunet!think.com!enterpoop.mit.edu!bloom-picayune.mit.edu!vlcek
  3. From: vlcek@mtl.mit.edu (Jim Vlcek)
  4. Subject: Re: Is it possible to alias a hostname?
  5. Message-ID: <1993Jan2.113941.23309@athena.mit.edu>
  6. Summary: I think I've got it
  7. Sender: vlcek@epimbe.com (Jim Vlcek)
  8. Nntp-Posting-Host: mtl.mit.edu
  9. Organization: EPI / Chorus Corporation
  10. References: <1992Dec30.110027.24942@athena.mit.edu>
  11. Date: Sat, 2 Jan 1993 11:39:41 GMT
  12. Lines: 67
  13.  
  14. I'd needed a way to redirect mail that was addressed to PCs which
  15. (rather misguidedly) used SMTP to forward outgoing messages, but
  16. couldn't accept incoming mail.  Greg Woods of NCAR was quite helpful,
  17. and now I think I've got a solution:
  18.  
  19. Basically, a Unix mailhost running sendmail must intercept the
  20. mail messages targeted to a PC and redirect them instead to the
  21. POP server.  This must be done by implementing new rules into the
  22. sendmail.cf file.
  23.  
  24. First, I defined a new class (named "C") of "mail clients"; these
  25. are the PCs which might originate (but cannot receive) SMTP mail.
  26. This is accomplished with the following line in /etc/sendmail.cf:
  27.  
  28.   FC/etc/mailclients
  29.  
  30. The actual names of the PCs are placed in the file /etc/mailclients
  31. (one name per line, hostname ONLY (not fully qualified host w/
  32. domain))
  33. rather than specifying them in the sendmail.cf file itself; this makes
  34. maintenance much easier as well as keeping the whole process more
  35. streamlined.
  36.  
  37. Next, the rewrite rules for the mailclients must be included in
  38. sendmail.cf.  This is accomplished by the following two rules:
  39.  
  40.   R$*<@$=C>$*           $1<@LOCAL>$3            <@pc> -> <@LOCAL>
  41.   R$*<@$=C.$=m>$*       $1<@LOCAL>$4            <@pc.dom> -> <@LOCAL>
  42.  
  43. This maps addresses of the form <user@pcname> or
  44. <user@pcname.subdomain.domain> into <user@LOCAL>, which is what my
  45. Sun's sendmail wants to see (I'm not certain, but others may be
  46. different).  Note that $=C matches any hostname in the class "C",
  47. and $=m matches any name in the class of valid domain names for this
  48. site.
  49.  
  50. Now, the question is, where should these rules be placed (ie, in which
  51. ruleset)?  Ruleset three is used to map addresses into an internal
  52. canonical form, so these rules should be placed somewhere such that
  53. they are invoked directly or indirectly by ruleset three.
  54.  
  55. In the Sun sendmail.cf, ruleset six ("special local conversions") is
  56. invoked directly by ruleset three.  It previously consisted of but one
  57. rule:
  58.  
  59.   R$*<@$*$=m>$*         $1<@$2LOCAL>$4          convert local domain
  60.  
  61. which simply mapped <user@localhost.subdomain.domain> into
  62. <user@localhost.LOCAL>.  This seemed like the obvious place to put the
  63. two new rules, so I placed them there.  Oh, I put them before the
  64. existing rule so that they wouldn't have to deal with rewritten
  65. addresses like <user@pcname.LOCAL>.
  66.  
  67. Other systems would probably have to modify the rule definitions
  68. and their location somewhat, I would imagine.
  69.  
  70. SInce we're a small shop, I've just got aliases set up for all users
  71. on the uucp host (my SUn) that provides the link to uunet.  In other
  72. environments, it might be more advantageous to set up MX records for
  73. the PCs in the mail link's DNS, directing all the mail for the PCs to
  74. the POP host.  Then, the hacks that I've described above should be
  75. done on the POP host rather than the mail gateway.
  76.  
  77. Thanks again, Greg.
  78.  
  79. Jim Vlcek
  80. vlcek@epimbe.com
  81.