Operating System - HP-UX
1752327 Members
5908 Online
108786 Solutions
New Discussion юеВ

Re: sendmail not working (used to work...)

 
tom_2010
Occasional Advisor

sendmail not working (used to work...)

Hi.
Sorry I'm new to HP-UNIX and need help to solve sendmail problem.

My sendmail suddenly fails to send e-mail and
mail.log says
"Deferred: Connection timed out with xx.xx.xx.xx."
Looking at mail.log, I found "relay=xx.xx.xx.xx"
has changed from "relay=aa.aa.aa.aa." to
"relay=bb.bb.bb.bb" (aa and bb are just examples) but I haven't changed any config like sendmail.cf.

How does sendmail determine relay info? Where should I look at?
Could anyone help??
My HP-UNIX version is HP-UX 11i v1

Thank you.
15 REPLIES 15
Deepankar Panda
Advisor

Re: sendmail not working (used to work...)

Hi,

Please dont panic...

Just try to stop and then restart the sendmail

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

and then please look into
/var/adm/syslog/mail.log for more info

if its not working
then please check domain name in the file /etc/resolv.conf
Matti_Kurkela
Honored Contributor

Re: sendmail not working (used to work...)

If your sendmail is in HP-UX default configuration, it will use the Mail Exchanger records in the DNS system to find the relay server separately for each destination address. Effectively, it's trying to deliver each mail as directly as possible to the recipient's mail server.

To run the equivalent DNS query manually, find the FQDN part of the mail address and run nslookup on it using the "-query=mx" option.
For example, if the mail recipient is "Joe.Blow@company.example", then run:

nslookup -query=mx company.example

If there are no MX records in the DNS for the mail recipient, sendmail will (by default) try to contact the recipient host (here "company.example") directly. If that fails too, the mail is undeliverable and a bounce message will be sent to the sender.


In these days, it's the standard practice to allow only the organization's "main" mail server(s) to work like that: all the others are usually configured to send all outgoing mail to the main server(s) only. This is called a "smart host configuration".

Open /etc/mail/sendmail.cf using your favorite editor and search for the string "DS" in all-caps. You'll find a lot of comments describing how to set the smart host configuration, and after the comments, the actual configuration line:

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

If there is no hostname or IP address after the letters "DS", smart host is not configured.

MK
MK
tom_2010
Occasional Advisor

Re: sendmail not working (used to work...)

Deepankar, MK,

Thank you for response.

I tried method you've suggested, but not working...

Here is (part of) my mail.log.

******************************************
Jul 9 11:30:03 xxx00001 sendmail[8337]: LAA08277: to=aaa@bbb.com, ctladdr=xxxxx (3002/500), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, relay=mail.xxxxx.com. [xxx.xxx.xx.xx], stat=Sent (Ok: queued as 4A6C312D6C1)

Jul 9 11:41:19 xxx00001 sendmail[17650]: LAA17606: to=aaa@bbb.com, ctladdr=xxxxx (3002/500), delay=00:01:17, xdelay=00:01:17, mailer=esmtp, relay=mail.yyyyy.com. [yyy.yyy.yy.yy], stat=Deferred: Connection timed out with mail.yyyyy.com.
******************************************

An e-mail sent at 11:30:03 was sent successfully, but e-mail sent at 11:41:19 was not.
Strange thing is "relay=" part of mail.log is changed from "relay=mail.xxxxx.com." to
"relay=mail.yyyyy.com".
It seems like sendmail is trying to access mail.yyyyy.com, but it does not exist
(i tried to ping this server but couldn't).

I typed "nslookup -query=mx xxxxx.yyyyy" (where xxxxx.yyyyy is equivalent to mail.xxxxx.com in mail.log)
and it works fine.
I set Smart-relay host to mail.xxxxx.com and restarted sendmail,
but nothing changed.

As I mentioned in the first post, I haven't changed any config like sendmail.cf, host, resolv etc.
It seems like sendmail suddenly started to act different way.
I'm wondering how sendmail determines "relay=" part...

Thank you
Horia Chirculescu
Honored Contributor

Re: sendmail not working (used to work...)

What is your (post the corresponding line) "Smart" relay host:

DS

from sendmail.cf?

Best regards,
Horia.
Best regards from Romania,
Horia.
tom_2010
Occasional Advisor

Re: sendmail not working (used to work...)


Horia,

Here is my sendmail.cf DS line

DS999.999.99.99
(where 999.999.99.99 is IP address of the server "mail.yyyyy.com
in my previous post)

I tried telnet to this IP address with port 25,
connected successfully and could send e-mail.

Should i change any other config files if I use Smart relay??

Thank you
Bill Hassell
Honored Contributor

Re: sendmail not working (used to work...)

Use sendmail -v to trace the mail transactions:

sendmail -v aaa@bbb.com < /etc/profile

Then post the results. The mail.log file is not very clear about the actual transaction.


Bill Hassell, sysadmin
tom_2010
Occasional Advisor

Re: sendmail not working (used to work...)

Bill

Thank you for your response.
I've tried to send e-mail to my e-mail account using sendmail command,
and below is the trace result.

----------------------------------------------------------
sendmail -v aaaaa@bbbbb.com
TEST MAIL
.
aaaaa@bbbbb.com Connecting to mail.yyyyy.com. via relay...
aaaaa@bbbbb.com Deferred: Connection timed out with mail.yyyyy.com.
----------------------------------------------------------
(aaaaa@bbbbb.com and mail.yyyyy.com are not actual values)


One thing I'm not clear is although I set Smart-Relay (DS in sendmail.cf)
to testtest.com (where test.com does not exist. I wanted to see
if Smart-relaying function is working) and restarted sendmail service.
Then I send e-mail by typing sendmail command directly but
nothing changed.
I mean, sendmail is not trying to connect the server I set in sendmail.cf.

Could anyone pls help... as it's been a couple days past and so many mails
are in mail queue.
Bill Hassell
Honored Contributor

Re: sendmail not working (used to work...)

> I mean, sendmail is not trying to connect the server I set in sendmail.cf.

Did you restart sendmail (use /sbin.init.d/sendmail stop/start)? To get rid of DNS problems, specify the smart relay as an IP address and verify that you can telnet to the smart relay on port 25:

telnet 12.34.56.78 25
Trying...
Connected to smart.relay.org.
Escape character is '^]'.
220 ************************************
quit
221 Bye
Connection closed by foreign host.



Bill Hassell, sysadmin
tom_2010
Occasional Advisor

Re: sendmail not working (used to work...)

Bill,

Thank you for response.

There's an improvement.

I set my sendmail.cf line to specific relay server like [aaaaa.com] (I put square-blackets)
and restarted sendmail service.
Now sendmail has began to use the relay server
specified in sendmail.cf.

I tried to send e-mail to my e-mail account by typing "sendmail -v myaccount@aaa.com ". Sending process looks fine, but e-mail was not sent to me because "RCPT To:" is wrong.
It looks like sendmail appends domain name (looks like domain name but not sure) like
"RCPT To:
How can i fix this?