[comp.unix.ultrix] Sendmail and YP aliases

iglesias@draco.acs.uci.edu (Mike Iglesias) (03/15/91)

Does anyone know what magic is required to get sendmail (Ultrix 4.1) to
use YP-distributed aliases?  I've built a YP mail.aliases file, ypmatch
can match the key in the mail.aliases database, but sendmail won't
use it.  I've RTFM - the aliases(5) man page refers to the "Guide to
Yellow Pages Service", but there's nothing that I can find in that
FM that refers to YP-distributed aliases.

The YP master is a DECstation 5000, the clients are other DECstations
5000s (all running Ultrix 4.1) and Suns of various flavors running
Sunos 4.0.3 or 4.1.1. 


Thanks,

Mike Iglesias
University of California, Irvine
Internet:    iglesias@draco.acs.uci.edu
BITNET:      iglesias@uci
uucp:        ...!ucbvax!ucivax!iglesias

jch@hollie.rdg.dec.com (John Haxby) (03/15/91)

In article <27DFCCCD.23236@orion.oac.uci.edu>, iglesias@draco.acs.uci.edu (Mike Iglesias) writes:
|> Does anyone know what magic is required to get sendmail (Ultrix 4.1) to
|> use YP-distributed aliases?

You need to edit /etc/svc.conf to change

	aliases=local

to 

	aliases=local,yp

and you'll probably need to refreeze and restart sendmail.
You might have problems with YP aliases; there are some
funnies in there, if you do, hesiod alias distribution is
rather better.
-- 
John Haxby, Definitively Wrong.
Digital				<jch@wessex.rdg.dec.com>
Reading, England		<...!ukc!wessex!jch>

jbryans@beach.csulb.edu (Jack Bryans) (03/17/91)

Does anyone have a script to produce a mail.aliases file from an aliases file.
They're quite different.  Ultrix 4.1, if it matters; yes, we have perl.

Jack

jch@hollie.rdg.dec.com (John Haxby) (03/18/91)

I thought about it, but this is pretty short:

---------------
#include <ndbm.h>

main () {
    DBM *db = dbm_open ("/usr/lib/aliases", 0, 0);
    datum key, val;

    for (key = dbm_firstkey(db); key.dptr; key = dbm_nextkey(db)) {
        val = dbm_fetch (db, key);
        printf ("%.*s\t%.*s\n", key.dsize, key.dptr,
                                val.dsize, val.dptr);
    }
}
---------------
you'll have to compile it I'm afraid :-)
-- 
John Haxby, Definitively Wrong.
Digital				<jch@wessex.rdg.dec.com>
Reading, England		<...!ukc!wessex!jch>