Thread View: mail.uk-sendmail-workers
2 messages
2 total messages
Started by A.Macpherson
Thu, 25 Oct 1990 22:51
Re: inverted alias lookup?
Author: A.Macpherson
Date: Thu, 25 Oct 1990 22:51
Date: Thu, 25 Oct 1990 22:51
32 lines
1677 bytes
1677 bytes
Steve, and anyone else who wants to use a standard Sun sendmail, rather
than the IDA versions. (Available from Brunel and STL)
This is one for your localise.sh
Define a map eg Y for the reverse YP
DYmail.byaddr
Then as the first line in ruleset 4
R$-@$* $:${Y$1@$2$}
This will only affect headers, since transport addresses are still in <>
and will fix up for every delivery channel
There is a possible "catch" in that it is usual in uk-sendmail for the
domain component to be the cannonical domain by this stage --- you might
need to load up:
id: id@host
f.u.llname: id@domain
to get the (reverse) mapping you want to achieve. You can check by running
test mode, for rules 3,1,20,4 and looking at what is passed in to 4
Short plug: I have explicit rules in a modified uk-sendmail, both for this
and for MX based routing, with a default if no MX record is found. FTAM or
Niftp to stl, ANON/guest login, file sendmail.cf/UK2.1.stc.tar.Z
--
A.Macpherson@stl.stc.co.uk - or - Post@stl.stc.co.uk
"Quot homines, tot sententiae"
Re: inverted alias lookup?
Author: Per Hedeland
Date: Wed, 31 Oct 1990 14:04
Date: Wed, 31 Oct 1990 14:04
112 lines
4471 bytes
4471 bytes
In article <8019.9010252245@helios.cs.hw.ac.uk>, A.Macpherson@stl.stc.co.uk
writes:
|> Define a map eg Y for the reverse YP
|>
|> DYmail.byaddr
|>
|> Then as the first line in ruleset 4
|>
|> R$-@$* $:${Y$1@$2$}
This works, but not too well, if you use the Sun-supplied way of building
the mail.byaddr map, i.e. essentially just reversing the mail.aliases map.
Problems:
- With several aliases pointing to the same userid, there's really no
telling which of them will be the one selected for the reverse mapping -
experiments indicate that it is the last one in the aliases file, but I
certainly wouldn't rely on it and risk having all my mail go out with
'postmaster' or something as the sender.
- There's no sensible way to have several addresses (e.g. on different
hosts) map to the same reverse alias.
- The reverse alias will always be all-lowercase, which some would consider
unaesthetic in a username like Mr Macpherson's above.
If for some reason you don't want to run the IDA setup, at least get the
xalparse program that comes with it, and use it to generate both forward and
reverse aliases. Below is a diff to the yp Makefile in SunOS 4.0.3 that
accomplishes just that, picking the xalparse input from /etc/xaliases and
putting the reversed aliases in the mail.revaliases map (which then goes in
the DY definition as above, I thought it best to use another name than
mail.byaddr for various reasons).
--Per Hedeland
per@erix.ericsson.se or
per%erix.ericsson.se@uunet.uu.net or
...uunet!erix.ericsson.se!per
*** /var/yp/Makefile.orig Tue Apr 25 02:26:50 1989
--- /var/yp/Makefile Mon Jan 8 10:23:18 1990
***************
*** 4,10 ****
--- 4,12 ----
DIR =/etc
DOM = `domainname`
NOPUSH = ""
+ XALIASES = /etc/xaliases
ALIASES = /etc/aliases
+ REVALIASES = /etc/revaliases
YPDIR=/usr/etc/yp
YPDBDIR=/var/yp
YPPUSH=$(YPDIR)/yppush
***************
*** 209,225 ****
echo "couldn't find $(DIR)/bootparams"; \
fi
! aliases.time: $(ALIASES)
! -@if [ -f $(ALIASES) ]; then \
cp $(ALIASES) $(YPDBDIR)/$(DOM)/mail.aliases; \
/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases; \
$(MKALIAS) $(YPDBDIR)/$(DOM)/mail.aliases $(YPDBDIR)/$(DOM)/mail.byaddr; \
rm $(YPDBDIR)/$(DOM)/mail.aliases; \
touch aliases.time; \
echo "updated aliases"; \
if [ ! $(NOPUSH) ]; then \
$(YPPUSH) mail.aliases; \
$(YPPUSH) mail.byaddr; \
echo "pushed aliases"; \
else \
: ; \
--- 211,231 ----
echo "couldn't find $(DIR)/bootparams"; \
fi
! aliases.time: $(ALIASES) $(REVALIASES)
! -@if [ -f $(ALIASES) -a -f $(REVALIASES) ]; then \
cp $(ALIASES) $(YPDBDIR)/$(DOM)/mail.aliases; \
/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases; \
$(MKALIAS) $(YPDBDIR)/$(DOM)/mail.aliases $(YPDBDIR)/$(DOM)/mail.byaddr; \
rm $(YPDBDIR)/$(DOM)/mail.aliases; \
+ awk 'BEGIN { OFS="\t"; } {for (i = 2; i <= NF; i++) print $$i, $$1}' \
+ $(REVALIASES) | \
+ $(MAKEDBM) -l - $(YPDBDIR)/$(DOM)/mail.revaliases; \
touch aliases.time; \
echo "updated aliases"; \
if [ ! $(NOPUSH) ]; then \
$(YPPUSH) mail.aliases; \
$(YPPUSH) mail.byaddr; \
+ $(YPPUSH) mail.revaliases; \
echo "pushed aliases"; \
else \
: ; \
***************
*** 348,352 ****
$(DIR)/netid:
$(DIR)/security/passwd.adjunct:
$(DIR)/security/group.adjunct:
! $(ALIASES):
$(DIR)/netmasks:
--- 354,362 ----
$(DIR)/netid:
$(DIR)/security/passwd.adjunct:
$(DIR)/security/group.adjunct:
! $(ALIASES) $(REVALIASES): $(XALIASES)
! /usr/local/bin/xalparse $(XALIASES) $(ALIASES).tmp $(REVALIASES)
! echo "### Do not edit this file, it is generated automatically from $(XALIASES)" > $(ALIASES)
! cat $(ALIASES).tmp >> $(ALIASES)
! rm -f $(ALIASES).tmp
$(DIR)/netmasks:
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads