cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail and nsswitch.conf

SOLVED
Go to solution
mobidyc
Trusted Contributor

sendmail and nsswitch.conf

Hello,

I want to use the nsswitch.conf file for aliases definition (file nis ldap), like i use it on other Unix systems.
but sendmail does not use this file on Red-Hat (tested on Redhat 4 and 5).

How can we activate this fonctionnality ?
the system is correctly configured for using this, I tested with the "getent aliases" command.

Thanks for your help.

Cheers,
Cedrick Gaillard
Best regards, Cedrick Gaillard
2 REPLIES
Steven E. Protter
Exalted Contributor
Solution

Re: sendmail and nsswitch.conf

Shalom Cedrick,

sendmail indeed does use /etc/nsswitch.conf to determine how to resolve domain and host names.

if sendmail is queued up with a mail envelope as it were for delivery, it checks the recipient and then depending on sendmail configuration may attempt to look up the domain name. From there it gets the MX, or mail exchanger record to know what server to attempt to deliver the mail to.

True enough, in most corporate environments, semdmail is configured to bypass this functionality with the DS directive and merely tries to dump its mail on the assigned smtp mail relay server.

But to say sendmail does not use nsswitch.conf without checking how sendmail is configured is not accurate, though it is likely to be the case.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
mobidyc
Trusted Contributor

Re: sendmail and nsswitch.conf

Shalom Steven.

On Red-Hat Linux, sednamil is does not use /etc/nsswitch.conf for aliases definition.

NSSWITCH.CONF(5)
aliases
Mail aliases, used by sendmail(8). Presently ignored.


actually,
if i want to use my 3 aliases maps (files, nis and ldap),
i need to compile the configuration files with:
define(`ALIAS_FILE',`/etc/aliases,nis:mail.aliases,ldap:')

this is not what I want.
What if I want to deactivate the ldap map on certain servers ?
don't want to recompile the configuration files each time.

why sendmail (on Red-Hat, maybe on other Linux) does not use the nsswitch.conf file ?


I tried to do:
define(`confSERVICE_SWITCH_FILE', `/etc/nsswitch.conf')dnl
but It does not work.

Regards,
Cédrick Gaillard
Best regards, Cedrick Gaillard