1823179 Members
3588 Online
109647 Solutions
New Discussion юеВ

Re: sendmail/proxy

 
Scott D. Allen
Regular Advisor

sendmail/proxy

having trouble getting messages out from my hp-ux hp9000 box through a proxy server. i configured /etc/mail/sendmail.cf with the DSproxy setting and proxy accepts smtp connections. am i missing something? help!

--scott
"Sometimes the devil you know is better than the devil you don't know."
15 REPLIES 15
Rick Garland
Honored Contributor

Re: sendmail/proxy

What kind of trouble? Is it not going out at all? Is it going out with a different format?
What does the /var/adm/syslog/mail.log file say is happening on the HP?
What does the mail log say on the proxy box?
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

I can't get at the proxy logs, but nothing is coming up in syslog.log and mail.log just says that the message is queued. Here,

Jun 15 14:54:43 hp9000 sendmail[22338]: OAA22338: from=root, size=35, class=0, pri=30035, nrcpts=1, msgid=<200006152154.OAA22338@hp9000.tycom.com>, relay=root@localhost
Jun 15 14:54:43 hp9000 sendmail[22338]: OAA22338: to=sallen@infomng.com, delay=00:00:00, mailer=relay, stat=queued

Suggestions?
"Sometimes the devil you know is better than the devil you don't know."
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

Do you need to have DNS resolver configured for sendmail to work?

I don't have a /etc/resolv.conf on this host. If I just configure resolv.conf with the domain flag, will that suffice?

--Scott
"Sometimes the devil you know is better than the devil you don't know."
Berlene Herren
Honored Contributor

Re: sendmail/proxy

To set a mail relay, find in the /etc/mail/sendmail.cf

# "Smart" relay host (may be null)
DS


and set to
DSyour.mailrelay.com << this is the name of your Exchange mail server.

Then stop and restart sendmail to re-read the sendmail.cf file

#/sbin/init.d/sendmail stop
#/sbin/init.d/sendmail start


You can test by issuing
#sendmail -v bherren@www.atl.hp.com
test
.
It should connect to the exchange server and go out it's merry way to the internet.


NOTE: 8.8.6, sendmail automatically assumes that you are using DNS and be returning fully qualified hostnames. If you are not, you MUST do the following workaround to trick it.. At sendmail 8.8.6, service.switch IS NOT USED AT ALL, regardless of whether you've uncommented it in sendmail.cf..

If you are not using dns (you do not have a fully-qualified domain name), you MUST:
a) Set the Dj$w macro in sendmail.cf to Dj$w. (as opposed to Dj$w without a dot at the end) AND (and here's where if differs from previous versions)
b) Add an alias to /etc/hosts that ends with a "." (for example, a pre- 8.8.6 host file line might look like this:

1.1.1.1 hello

to make things work at 8.8.6, change it to
1.1.1.1 hello hello.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

Thanks Berlene, that's what I thought.

Here's the /etc/hosts entries for my host....

192.168.1.1 host host.
192.168.2.1 host
192.168.3.1 host host.domain.com
192.168.3.250 mailhost.domain.com mailhost

My sendmail.cf has....
Dj$w.
DSmailhost.domain.com

When I restart sendmail and try to send the message I get.....

# sendmail -v sallen@infomanage.net
sallen@infomanage.net... infomanage.net: Name server timeout
sallen@infomanage.net... Transient parse error -- message queued for future delivery
hello tough guy
.
sallen@infomanage.net... queued
# mailq
Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
HAA19552 14 Fri Jun 16 07:14 imcsa
(host map: lookup (infomanage.net): deferred)
sallen@infomanage.net
#


what else could it be? does my host. entry need to be on the same subnet as my mailhost? i have three subnets.

--Scott
"Sometimes the devil you know is better than the devil you don't know."
Rick Garland
Honored Contributor

Re: sendmail/proxy

From the mail.log and other responses, I would have to say that the mail is queued because it doesn't know where to go. As Berlene stated, define the Smart Host, bounce the sendmail daemon, and restart it.

I would believe that by now you have something in the local root mailbox indicating that the message is not being sent.
Berlene Herren
Honored Contributor

Re: sendmail/proxy

Scott, what is returned when you type
#nslookup
>policy >> should be just one lookup (files) if you are not using dns or nis.

Check for an /etc/nsswitch.conf file. If one doesn't exist, you can copy one from /usr/newconfig/etc/ (nsswitch.file to /etc/nsswitch.conf for 11.0 OR nsswitch.conf /etc/nsswitch.conf for 10.20). If copying the nsswitch.conf for 10.20, after the file is in place, edit it and take out DNS and NIS on the hosts line.

See if this helps.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

yeah, i did not have an nsswitch.conf file and i added it in. when i do nslookup i get...

# nslookup
Using /etc/hosts on: hp9000

> hp9000.
Using /etc/hosts on: hp9000

looking up FILES
Name: hp9000
Address: 128.200.1.1
Aliases: hp9000., hp9000_1, hp9000.domain.com

> mailhost
Using /etc/hosts on: hp9000

looking up FILES
Name: mailhost.domain.com
Address: 128.200.1.61
Aliases: mailhost, exch-irv, exchange-server, exchange

> quit

The thing that concerns me is that when I try to send a message, I get the following in the mail.log file. It looks like the relay is NOT coming active as what I had set in DSmailhost.domain.com

Jun 16 07:21:06 hp9000 /sbin/init.d/sendmail[26041]: #### rebooted ####
Jun 16 07:21:06 hp9000 sendmail[26045]: alias database /etc/mail/aliases rebuilt by imcsa
Jun 16 07:21:06 hp9000 sendmail[26045]: /etc/mail/aliases: 10 aliases, longest 9 bytes, 116 bytes total
Jun 16 07:21:07 hp9000 sendmail[26050]: starting daemon (8.8.6 (PHNE_17135)): SMTP+queueing@00:30:00
Jun 16 07:21:40 hp9000 sendmail[26146]: HAA26146: from=imcsa, size=16, class=0, pri=30016, nrcpts=1, msgid=<200006161421.HAA26146@hp9000.>, relay=root@localhost
Jun 16 07:21:40 hp9000 sendmail[26146]: HAA26146: to=sallen@infomanage.net, delay=00:00:07, mailer=relay, stat=queued
Jun 16 07:22:54 hp9000 sendmail[26302]: NOQUEUE: Null connection from pike.wp.infomng.com [10.132.52.12]
Jun 16 07:28:02 hp9000 sendmail[26769]: NOQUEUE: Null connection from pike.wp.infomng.com [10.132.52.12]
Jun 16 07:33:10 hp9000 sendmail[3088]: NOQUEUE: Null connection from pike.wp.infomng.com [10.132.52.12]

Instead, it looks like the relay=root@localhost instead of mailhost.domain.com.
Do I need to reboot for this to take effect?

--Scott
"Sometimes the devil you know is better than the devil you don't know."

Re: sendmail/proxy

Check your /etc/mail/sendmail.cw if this file exists, ensure that it contains only the hostname and not the fqn of the hosts otherwise, sendmail will assume that the local host is the relay.
Berlene Herren
Honored Contributor

Re: sendmail/proxy

Scott, if you issue
#sendmail -bs
does it return something that looks like this?
ESMTP Sendmail 8.8.6 (PHNE_17190)/8.8.6

After the slash, is it the same version number?


If not, try this
mv /etc/mail/sendmail.cf /etc/mail/sendmail.bak
cp /usr/newconfig/etc/mail/sendmail.cf /etc/mail

vi this /etc/mail/sendmail file and set the DS and Dj$w again.

Check your sendmail.cw >>
localhost
shortname of this host
shortname. of this host

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Berlene
Berlene

http://www.mindspring.com/~bkherren/dobes/index.htm
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

It does return those the same version 8.8.6....
# sendmail -bs
220 hp9000. ESMTP Sendmail 8.8.6 (PHNE_17135)/8.8.6; Fri, 16 Jun 2000 11:08:31 -0700 (PDT)
quit
221 hp9000. closing connection
#

My sendmail.cw has
localhost
host
host.

My sendmail.cf has
Djhost.
DSmailhost.$m

I've tried all combinations of Dj [host, host., host.domain.com, host.domain.com.] and still nothing. Everytime I do this I get the following when I try to send a message.....

# sendmail -v sallen@infomanage.net
sallen@infomanage.net... infomanage.net: Name server timeout
sallen@infomanage.net... Transient parse error -- message queued for future delivery
hello tough guy.

.
sallen@infomanage.net... queued
# exit


It looks like a DNS issue. Is there a way to trick sendmail to just send everything not for @host onto my mailhost?

--Scott
"Sometimes the devil you know is better than the devil you don't know."

Re: sendmail/proxy

Did you remember to /sbin/init.d/sendmail stop ; /sbin/init.d/sendmail start after you made your changes?

Another thing you might want to try is to see if the relay is even accepting connections to port 25:

# telnet mailhost 25

helo hp9000

mail from:
250 ... Sender ok
rcpt to:
250 ... Recipient ok
data
354 Enter mail, end with "." on a line by itself


see what you get after completing a test message ...

Good luck
Berlene Herren
Honored Contributor

Re: sendmail/proxy

Sounds like you need to configure a DNS root server.
Verify that a query to a root server is failing. A lookup on a bogus address will return a rcode = SERVFAIL. If the root name server is setup and responding correctly to a bogus address then a rcode = NXDOMAIN will be returned.
яВ╖ nslookup when no root server is available/configured
Default Name Server: blauser
Address: 15.17.184.52

> set type=mx
> set d2
> bogus.com
...
Got answer (27 bytes):
HEADER:opcode = QUERY, id = 3, rcode = SERVFAIL
header flags: response, want recursion, recursion avail.
questions = 1, answers = 0, authority records = 0, additional = 0
QUESTIONS: bogus.com, type = MX, class = IN


Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Berlene Herren
Honored Contributor

Re: sendmail/proxy

Sounds like you need to configure a DNS root server.
Verify that a query to a root server is failing. A lookup on a bogus address will return a rcode = SERVFAIL. If the root name server is setup and responding correctly to a bogus address then a rcode = NXDOMAIN will be returned.
яВ╖ nslookup when no root server is available/configured
Default Name Server: blauser
Address: 15.17.184.52

> set type=mx
> set d2
> bogus.com
...
Got answer (27 bytes):
HEADER:opcode = QUERY, id = 3, rcode = SERVFAIL
header flags: response, want recursion, recursion avail.
questions = 1, answers = 0, authority records = 0, additional = 0
QUESTIONS: bogus.com, type = MX, class = IN


Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Scott D. Allen
Regular Advisor

Re: sendmail/proxy

Alright guys. I found my problem. It was actually my own fault. I was too busy playing around with sendmail.cf/w to pay any attention to the nsswitch.conf file.....getting away from the problem over the weekend helped.

/etc/nsswitch.conf:
hosts: files[NOTFOUND=return UNAVAIL=return TRYAGAIN=return]

Previously, I had an entry for dns in there also because (supposedly) the dns server was working......it wasn't so it was giving me the "transient error:" stuff (same as Doug).

Now, it gives me a nice, clean sendmail message like.....
$ sendmail -v sallen@infomanage.net
hello everyone!!!

.
sallen@infomanage.net... Connecting to mailhost.tycom.com via relay...
220 proxy-irv.domain.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2448.0) ready
>>> EHLO hp9000.domain.com
250-proxy-irv.domain.com Hello [cpl-hsrp-sub001.nts.uci.edu]
250-XEXCH50
250-HELP
250-ETRN
250-DSN
250-SIZE 0
250-AUTH LOGIN
250-AUTH=LOGIN
250-STARTTLS
250 TLS
>>> MAIL From: SIZE=19
250 OK - mail from ; can accomodate 19 bytes
>>> RCPT To:
250 OK - Recipient
>>> DATA
354 Send data. End with CRLF.CRLF
>>> .
250 OK
sallen@infomanage.net... Sent (OK)
Closing connection to mailhost.domain.com
>>> QUIT
221 closing connection

Looks good! Thanks to all who helped.

--Scott
PS.
My sendmail.cw had just localhost, hp9000, hp9000. and my sendmail.cf had Djhp9000.domain.com and DSmailhost.domain.com

"Sometimes the devil you know is better than the devil you don't know."