Operating System - Tru64 Unix
1751877 Members
5384 Online
108782 Solutions
New Discussion юеВ

sendmail: getmxrr() returns -1 value(s):

 
SOLVED
Go to solution
Greg Roach
New Member

sendmail: getmxrr() returns -1 value(s):

I have two (supposedly) identical machines, trying to relay mail through the same mail-relay. One machine works, the other gives the error in the subject line.

I can reproduce the problem using the following sendmail test instructions.

root@good-host$ echo "/mx my-relay.my-domain.com" | sendmail -bt -d8.20
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter

> getmxrr(my-relay.my-domain.com, droplocalhost=0)
getmxrr(my-relay.my-domain.com) returns 0 value(s):

root@bad-host$ echo "/mx my-relay.my-domain.com" | sendmail -bt -d8.20
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter

> getmxrr(netaexcd.bmreports.co.uk, droplocalhost=0)
getmxrr: res_search(netaexcd.bmreports.co.uk) failed (errno=0, h_errno=0)
getmxrr: res_search (netaexcd.bmreports.co.uk) failed with impossible h_errno (0)
getmxrr(netaexcd.bmreports.co.uk) returns -1 value(s):

On the good server, it finds zero MX records for the mail relay (this is OK). On the bad server, it finds -1 MX records, which causes sendmail to fail.

The configuration on both machines (sendmail.cf, network settings, etc.) appears to be identical.

Any suggestions what to look at next?

I'm using sendmail v8.11 on Tru64v5.1b(2650)

Greg Roach
6 REPLIES 6
Greg Roach
New Member

Re: sendmail: getmxrr() returns -1 value(s):

I've now managed to get this to work.

Neither machine uses DNS (they just use /etc/hosts).

By setting the "bad" machine to use our local DNS server, it now works.

This doesn't explain why the "good" machine works without it.
Al Licause
Trusted Contributor

Re: sendmail: getmxrr() returns -1 value(s):

What is it you're trying to accomplish with this test ? And what is it supposed to return ?

Can we assume that one system can relay and the other cannot ?

Did you run mailsetup as root on both systems and answer the questions with similar answers in particular those for the mail relay ?

Al Licause
Trusted Contributor

Re: sendmail: getmxrr() returns -1 value(s):

Is the hosts line in /etc/svc.conf the same on both systems ?
Ivan Ferreira
Honored Contributor

Re: sendmail: getmxrr() returns -1 value(s):

I don't know if you forgod to replace the server name in the second test, because the name resolved in the first and the second are different (my-relay.my-domain.com/netaexcd.bmreports.co.uk).

Verify your host table, svc.conf, nsswitch.conf, resolv.conf, and use nslookup to test the DNS server configuration.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Al Licause
Trusted Contributor
Solution

Re: sendmail: getmxrr() returns -1 value(s):

V8.any of sendmail rely likes to have the use of a dns service. You can sometimes trick it into using local resources only but I've never seen this work in a consistant manner.

If you have dns servers available, you'd be far better off using them.
Greg Roach
New Member

Re: sendmail: getmxrr() returns -1 value(s):

Al,

Yes, I ran mailsetup on both machines.

Yes, one machine can forward mail to the relay and one cannot.

The purpose of the test was to reproduce the error I get while trying to relay, but with some debug enabled.

/etc/svc.conf is the same on both machines.

Ivan,

I was trying to hide the real host names and replace them with "my-host.my-domain". I missed one. Oops :-(

/etc/hosts, and /etc/*.conf are all identical.

There is (was) no DNS on these machines. They sit on a small network and only need to speak to one external machine. Hence we just use a hosts file.

Interestingly, I have now disabled dns on the "non working" machine (using sysman dns) and it continues to work.

The fix appears to have been "enable dns, disable dns".

The old (working) machine previously ran dns.
The new (non working) machine had never used dns.

Thank-you both for your time.