Name

NIS

Synopsis

NIS stands for Network Information Services. If you intend to have sendmail support nis (formerly Yellow Pages) maps, you need to define NIS with a line such as the following in your Build m4 file:

APPENDDEF(`confMAPDEF', `-DNIS')

If NIS is defined, the AliasFile option can be specified as:

OAnis:mail.aliases            V8.6
O AliasFile=nis:mail.aliasesV8.7 and above (if no service-switch file)

See AliasFile for more details about the AliasFile option. See ServiceSwitchFile for a description of the ServiceSwitchFile option and its effect on nis aliases. Be aware that the above AliasFile option declaration will override the lack of an nis entry in the service-switch file.

NDBM also needs to be defined to allow sendmail to rebuild its alias files for use by nis:

APPENDDEF(`confMAPDEF', `-DNIS -DNDBM')

For this to work, the path of the alias file needs to contain the substring:

/yp/

A typical /var/yp/Makefile will contain a line such as this:

/usr/lib/sendmail -bi -oA$(YPDBDIR)/$(DOM)/mail.aliases

Here, $(YPDBDIR)/ is usually /var/yp/, so the substring is found. When the substring /yp/ is found, sendmail augments the aliases database with two special entries that are needed by nis:

YP_LAST_MODIFIED
YP_MASTER_NAME

These allow the newly built aliases file to be successfully distributed for use by nis clients. Without these entries you will see an error such as the following when pushing your nis maps:

Status received from ypxfr on nisslave: Failed - no local order number in map - use ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.