Operating System - HP-UX
1834364 Members
1924 Online
110066 Solutions
New Discussion

Sendmail and service switch

 
David Rodman
Frequent Advisor

Sendmail and service switch

According to #KLTKBRC00005381 (Sendmail 8.x Setup Instructions) Sendmail will not look at the host file if
DNS is running. I can attest to personal experience on this as well.
Does any one have a fix for sendmail that will cause it
to fall back on the host file if DNS is unavailable or gives
a host unknown message?

Does any one have exp on the sendmail specific service switch file under HP-UX? All I have seen are warnings not to use it.
10 REPLIES 10
Carlos Fernandez Riera
Honored Contributor

Re: Sendmail and service switch


set:

hosts: dns [NOTFOUND=continue] files


Is it?
unsupported
Kevin Wright
Honored Contributor

Re: Sendmail and service switch

Just use the /etc/nsswitch.conf file, set params as the above post says, and restart sendmail. or you could just put hosts first, if that is what you what it to search anyway, then dns.
David Rodman
Frequent Advisor

Re: Sendmail and service switch

You guys dont get it yet...
The doc says if nsswitch.conf is set for:
hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns
NOTE: only DNS will be utilized for sendmail lookups (/etc/hosts will not be consulted).

Its a quote! and I can tell you it is true!
Kevin Wright
Honored Contributor

Re: Sendmail and service switch

I have an Irix box running sendmail 8.8.8, which is also a primary dns server for a public domain, and I can get it to use /etc/hosts just fine using nsswitch.conf.
Kevin Wright
Honored Contributor

Re: Sendmail and service switch

see this link for the file you are talking about
I can set the relay through configmail on the Irix box, which may not be available on your version.

http://www.sendmail.org/faq/section3.html#3.22
Kevin Wright
Honored Contributor

Re: Sendmail and service switch


2.5The Service Switch

The implementation of certain system services such as host and user name lookup is controlled by the service switch. If
the host operating system supports such a switch sendmail will use the native version. Ultrix, Solaris, and DEC OSF/1 are
examples of such systems.

If the underlying operating system does not support a service switch (e.g., SunOS, HP-UX, BSD) then sendmail will
provide a stub implementation. The ServiceSwitchFile option points to the name of a file that has the service definitions Each
line has the name of a service and the possible implementations of that service. For example, the file:

hosts dns files nis
aliases files nis

will ask sendmail to look for hosts in the Domain Name System first. If the requested host name is not found, it tries local
files, and if that fails it tries NIS. Similarly, when looking for aliases it will try the local files first followed by NIS.

Service switches are not completely integrated. For example, despite the fact that the host entry listed in the above
example specifies to look in NIS, on SunOS this won't happen because the system implementation of gethostbyname(3)
doesn't understand this. If there is enough demand sendmail may reimplement gethostbyname(3), gethostbyaddr(3),
getpwent(3), and the other system routines that would be necessary to make this work seamlessly.
Wieslaw Krajewski
Honored Contributor

Re: Sendmail and service switch

hi,

Try to use

/etc/mail/service.switch

file. Details you'll find by

man service.switch

Do not forget to edit sendmail.cf file.

Hope this helps.

Rgds.
Permanent training makes master
Kevin Wright
Honored Contributor

Re: Sendmail and service switch

taken directly from the sendmail.cf file..notice what OS is ignored...therefore using the native switch file.../etc/nsswitch.conf.

# service switch file (ignored on HP-UX, Solaris, Ultrix, OSF/1, others)
#O ServiceSwitchFile=/etc/mail/service.switch
Wieslaw Krajewski
Honored Contributor

Re: Sendmail and service switch

Hi,

Kevin is right. I've overlooked this.
Sorry.

Rgds.
Permanent training makes master
David Rodman
Frequent Advisor

Re: Sendmail and service switch

just to close this... HP support backline says there is no way to get the nsswitch functionality in sendmail:

Quote:
It is not the expected behaviour of Sendmail to mix MX record lookups with non-MX record lookups. As per RFC 1123, Section 5.3.5, a sender-SMTP MUST support the MX record scheme. (ie if dns is specified in /etc/nsswitch.conf in whatever order, sendmail MUST do a MX record lookup for the destination host). The latest internet RFC's define that DNS should be used whenever possible for host lookup. HP's Sendmail wants to be as close as possible to the internet wide agreed standards.
end quote: