Hi,
I got some good suggestions from,
Michael Matthews <matthewm_at_sgate.com>
who suggest to use NIS or use sendmail 8.x which have this facility.
---------
and from,
Daniel.Clar_at_supelec.fr (Daniel Clar)
OSF/1 and ULTRIX are based on IDA, 5.65 + various fixes from both IDA 5.67
and Sendmail V8. But we do not have reverse aliases. To do that, you
need to hack things.
1. Create a reverse alias file, one that maps standard UNIX usernames
into full names.
2. Add some rules into sendmail.cf (following things assume that you
have run a full mailsetup, and are hacking the resultant sendmail.cf file)
- OKR/var/adm/sendmail/revaliases
- modify rules S12 and S22. These are the rules for sending to an
external recipient (Msmtp). If you wish these names to be common,
do similar magic for the other Msmtp rules (Relay and Local-domain).
S12
R<_at_$+>$* $_at_<_at_$1>$2 <route-addr> syntax
R$*<_at_[$+]>$* $_at_$1<_at_[$2]>$3 numeric, lv alone
R$*<_at_$+>$* $_at_$>9$1<_at_$2>$3 canonicalize domain
R$=N $_at_$1<_at_$j> Add $j to local
R$- $:$1??$(_at_ $1 $: $) Look up aliases
R$-??$+ $_at_$1<_at_$j> Found it - reformat
R$-?? $:$1 undo dammage
R$- $:$1$(R $1 $) Reverse alias?
R$+ $_at_$1<_at_$W> fix up return addr
S22
# R$+ $_at_$>12$1 nothing special here
# Logically, we still call S12. But we hacked S12, so we copy the
# original body here.
R<_at_$+>$* $_at_<_at_$1>$2 <route-addr> syntax
R$*<_at_[$+]>$* $_at_$1<_at_[$2]>$3 numeric, lv alone
R$*<_at_$+>$* $_at_$>9$1<_at_$2>$3 canonicalize domain
R$=N $_at_$1<_at_$j> Add $j to local
R$- $:$1??$(_at_ $1 $: $) Look up aliases
R$-??$+ $_at_$1<_at_$j> Found it - reformat
R$-?? $:$1 undo dammage
R$+ $_at_$1<_at_$W> fix up return addr
3. Create the reverse alias file. I've never cobbled together anything
for this, but it should be relatively easy to write a pgm.
---------------end of forwarded message-------------------
The dbm program to do this is available through anonymous ftp on ftp.supelec.fr
in /pub/sys/unix/osf/dbm.
You create a file with
login_name(TAB) full name
.........................
and then
cat file_name | dbm load revaliases and it works (look at my e-mail).
-------
and the last one that I use and I hope you can see that it works in the mail
header was also from Daniel Clar (and earlier SUMMARY),
Subject: NEW SUMMARY on IDA sendmail on OSF
X-Vms-To: SMTP%"alpha-osf-managers_at_ornl.gov"
X-Vms-Cc: DC
I want to thank here Keith Mc Cabe who did all the job keithm_at_ranplc.co.uk
Here is the summary of several mails we exchange.
---begin
I found a few hours free to play around with reverse mail addresses
the other day.
It does indeed appear that DEC compiled in all the IDA extensions to
sendmail but failed to document them.
Here's a very brief description of what I did to get things going. It
is by no means perfect and I can think of lots of ways of improving it.
I don't bother using the m4 macros, I just hack sendmail.cf directly. I
put the following line at the top of sendmail.cf
OKB/var/adm/sendmail/revaliases
which tells sendmail that any time we refer to the database 'B' the
information will be kept in revaliases.pag (the special NIS type database
files).
Then I added the following rules to the 'S1' section:
################################
# Sender Field Pre-rewriting #
################################
S1
R$*<_at_$*.$D> $_at_(B $1 $:$1<_at_$2.$D> $)
R$+ $_at_$(B $1 $:$1 $)
NOTE: SEPARATORS ARE TAB CHARACTERS
This basically says 'try and match the first token in the database B' and
rewrite it if you can.
I wrote a little script that I use to keep aliases and my reverse aliases
file synchronised. I recommend you do something similar.
At the end of my aliases file I have
# REVERSE-ALIASES
Keith.McCabe:keithm
This is where mail addressed to Keith.McCabe_at_ranplc.co.uk get rewritten to
keithm_at_ranplc.co.uk. Then I run a little script:
#!/bin/sh
cd /var/adm/sendmail
newaliases
awk -F: 'BEGIN {reverse=0}
reverse == 1 {print $2" "$1"_at_ranplc.co.uk"}
/REVERSE-ALIASES/ {reverse=1}' aliases > revaliases
cat revaliases | dbm load revaliases
This script runs newaliases then looks through the aliases file for the
line REVERSE-ALIASES and creates a reverse entry in the file revaliases
for everything BELOW that line. Next I use the 'dbm' utility which you can
find easily on various ftp sites. /etc/yp/makedbm is not working for that
purpose
Finally I restarted sendmail '/sbin/init.d/sendmail stop;/sbin/init.d/sendmail
start' or '/sbin/rc3.d/S40sendmail restart'
I think the best approach is to go and get the latest version of
sendmail from either 'ftp.cs.berkeley.edu' in /mail/sendmail (sendmail V8) or
'vixen.cso.uiuc.edu' in /pub/sendmail (IDA) and compile it up, as it will
have security enhancements and new features. But in the mean time this
should work.
Regards,
/Joakim
+---------------------------------------------+-------------------------------+
| Joakim Hartikainen | Phone: +46 8 613 9000, 9318 |
| Ernst & Young, Sweden | |
| E-mail: Joakim.Hartikainen_at_ey.se | |
+---------------------------------------------+-------------------------------+
Received on Wed Sep 06 1995 - 17:54:12 NZST