home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / mail / sendmail / 2123 < prev    next >
Encoding:
Text File  |  1992-08-22  |  4.7 KB  |  121 lines

  1. Newsgroups: comp.mail.sendmail
  2. Path: sparky!uunet!mcsun!sunic!sics.se!eua.ericsson.se!erix.ericsson.se!per
  3. From: per@erix.ericsson.se (Per Hedeland)
  4. Subject: Re: Using sendmail to print Full name as mail address
  5. Message-ID: <1992Aug22.104808.14951@eua.ericsson.se>
  6. Sender: news@eua.ericsson.se
  7. Nntp-Posting-Host: super.eua.ericsson.se
  8. Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
  9. References: <1992Aug21.091754@bldrdoc.gov> <BtCJp8.yn@nntp-sc.Intel.COM>
  10. Date: Sat, 22 Aug 1992 10:48:08 GMT
  11. Lines: 108
  12.  
  13. In article <BtCJp8.yn@nntp-sc.Intel.COM> jst@inews.intel.com (Jason
  14. Thomasser) writes a very nice description of the workings of the
  15. "reverse aliasing" function (such as it is:-) of SunOS sendmail/.cf -
  16. one might think that that such a description should be provided by Sun,
  17. but at least to my knowledge, it isn't... Anyway, since I've just
  18. recently been dealing with this myself, I'd like to add a few comments.
  19.  
  20. > You need to add the -s -n options to mkalias (by default
  21. >in /var/yp/Makefile) like this:
  22. >
  23. >MKALIAS=$(YPDIR)/mkalias -s -n
  24.  
  25. What do these options do? The mkalias command is also totally
  26. undocumented (yes I have grep'ed all of /usr/man/man*/* for it).
  27.  
  28. > Be warned that you have
  29. >to specify a mailserver (other wise you have an alias loop) and that
  30. >it makes life mush easier if the master mail machine is dedicated to that 
  31. >function (not acting as a direct mailserver to any users due to subtle
  32. >sendmail rewrites you have to contend with).
  33.  
  34. I have done what is perhaps those "subtle rewrites", i.e. extended the
  35. simple lookup in the distributed .cf to work also in the case where the
  36. reverse aliasing is done on the mailserver, in the form of a separate
  37. ruleset:
  38.  
  39. S27
  40. # We assume that the key is an unqualified user@host
  41. # and that the inverse alias is something else
  42. R$-<@$*LOCAL>        $1<@$2LOCAL>?$2$m?$1@$2$m    change local info
  43. R$-<@$*>        $1<@$2>?$2?$1@$2        already OK
  44. R$-            $1?$w?$1@$w            tack on our hostname
  45. R$*?$*$=m?$-@$-.$*    $1?$2$3?$4@$5            unqualify our domain
  46. R$*?$*?$-@$-.$*        $@$1                not our domain
  47. R$*?$*?$*        $1?${Z$3$}            lookup
  48. R$*?$-@$-        $@$1                not found
  49. R$*?$*            $@$>3$2                found
  50.  
  51. I realize that this is a bit complex (you get that way after too much
  52. browsing of the IDA sendmail config:-) - this is due to the fact that it
  53. will handle all of 'user' (in which case the current host's name as
  54. found in $w is used, which may result in either of the three following
  55. forms), 'user@host', user@host.domain', and 'user@domain' as canditates
  56. for reverse aliasing, and to the lack of failure indication in Sun's NIS
  57. lookups.
  58.  
  59. This can then be called as
  60.  
  61. R$+            $:$>27$1            invert aliases
  62.  
  63. wherever desired in the sendmail.cf (e.g. replacing the direct lookup in
  64. the 'ddn' mailer ruleset).
  65.  
  66. In the case of the mailserver doing the reverse aliasing, you would of
  67. course not have the
  68.  
  69. uid: full.name
  70.  
  71. alias for local users. It might also be added that you should take care
  72. not to have any aliases of the form
  73.  
  74. alias: user@host
  75.  
  76. that you *don't* want to be candidates for reverse mapping.
  77.  
  78. An additional point is that the mkalias program runs off the
  79. mail.aliases database, where all aliases have been converted to
  80. lowercase - i.e. your reverse alias will be on the form
  81. full.name@domain, rather than Full.Name@domain - if this bothers you,
  82. you can replace the mkalias call in /var/yp/Makefile with a string of
  83. commands believed to do the same thing, but directly from the aliases
  84. source file (diff from the SunOS 4.1.1 version):
  85.  
  86. *** /var/yp/Makefile.ORIG    Sat Feb  2 12:14:33 1991
  87. --- /var/yp/Makefile    Fri Oct 11 09:59:33 1991
  88. ***************
  89. *** 154,160 ****
  90.   aliases.time: $(ALIASES)
  91.       @cp $(ALIASES) $(YPDBDIR)/$(DOM)/mail.aliases; 
  92.       @/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases; 
  93. !     $(MKALIAS) $(YPDBDIR)/$(DOM)/mail.aliases $(YPDBDIR)/$(DOM)/mail.byaddr; 
  94.       rm $(YPDBDIR)/$(DOM)/mail.aliases; 
  95.       @touch aliases.time; 
  96.       @echo "updated aliases"; 
  97. --- 154,164 ----
  98.   aliases.time: $(ALIASES)
  99.       @cp $(ALIASES) $(YPDBDIR)/$(DOM)/mail.aliases; 
  100.       @/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases; 
  101. !     (sed -e '/^#/d' -e s/#.*$$// -e 's/[     ]//g' \
  102. !         $(YPDBDIR)/$(DOM)/mail.aliases $(CHKPIPE))\
  103. !     |( awk -F: 'BEGIN { OFS="\t"; } \
  104. !         NF == 2 && $$2 !~ /,/ && $$2 ~ /@/ { print $$2, $$1 }' $(CHKPIPE))\
  105. !     | $(MAKEDBM) -l - $(YPDBDIR)/$(DOM)/mail.byaddr; 
  106.       rm $(YPDBDIR)/$(DOM)/mail.aliases; 
  107.       @touch aliases.time; 
  108.       @echo "updated aliases"; 
  109.  
  110. >As for IDA don't know. Any one else?
  111.  
  112. I'll let someone else give the details, but I know that there is very
  113. good support for this kind of thing in the standard config that comes
  114. with IDA, and in particular the 'xalparse' program provides great
  115. flexibility in how to set up both forward and reverse aliasing.
  116.  
  117. --Per Hedeland
  118. per@erix.ericsson.se  or
  119. per%erix.ericsson.se@sunic.sunet.se  or
  120. ...uunet!erix.ericsson.se!per
  121.