Configuring sendmail?

watsonaw
watsonaw used Ask the Experts™
on
Hi all,

I am trying to configure sendmail on Rehat 7.3. The scenario is as such.

We have monitoring software that sends out smtp messages, (presently configured to mail accounts at the localhost server). However, I would like to send these via the central mailhost (nt server), to the main company email system (various accounts).

I have configured kmail within CDE without any issue, and can happily send mail to the company mail accounts (via this application). However, I am unable to send messages from the command line using sendmail or mail. I get a message of:

# Name server timeout
... Transient parse error -- message queued for future de
livery
# Name server timeout

The mailhost is named in /etc/hosts and the monitoring server is not using FQDN (just ip address).

Anyone any ideas / suggestions?

Thanks

Andy

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005

Commented:
Are you using a fully qualified domain name in the address or just the domain portion. In the later case sendmail will need to consult the DNS to obtain the MX record for the domain, which in turn defines the host name.

If you've been using a domain address, try sending the message to the fully qualified address, like user@nt-srv.my-dom.tld.

Author

Commented:
Yes... I've been using a Fully Qualified address from the command line.... ie:

/usr/sbin/sendmail -v -f root@localhost user@my-company.com

subject .....
.....

The server I'm trying to send from is not known via by DNS, and shouldn't have any name server running. The mailhost I'm sending to is recognised as my-company.com

Thanks

Andy

Author

Commented:
Yes... I've been using a Fully Qualified address from the command line.... ie:

/usr/sbin/sendmail -v -f root@localhost user@my-company.com

subject .....
.....

The server I'm trying to send from is not known via by DNS, and shouldn't have any name server running. The mailhost I'm sending to is recognised as my-company.com

Thanks

Andy
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2005

Commented:
No that's not a fully qualified address and that's the problem. A fully qualified address would look something like user@nt-server.my-company.com. That means that your hosts file might look something like:

127.0.0.1   localhost.localdomain localhost
10.0.0.100  this-redhat.my-company.com this-redhat
10.0.0.1    nt-server.my-company.com  nt-server

Because the target address only contains a domain, sendmail thinks that it should look up the MX for that domain to obtain the host name of the mail server.

Author

Commented:
Sorry,  please excuse my level of proficiency on this. It seems to be lacking somewhat!

Are you saying that the root@localhost or user@my_company.com is not a FQA?  

This is a snip from /etc/hosts file on the redhat_server

127.0.0.1       localhost
129.3.20.19     redhat_server      .
10.39.46.11     mailhost        my_company.com

The redhat_server is not using DNS so can only be known as either localhost or redhat_server....??
   
Top Expert 2005

Commented:
It doesn't matter if the RedHat box is using DNS or not. Mail transport operates on the basis of the Domain Name System and always obeys the rules associated with that.

Strictly speaking, your hosts file should look like:

127.0.0.1    localhost.localdomain localhost
129.3.20.19  ppp.cs.oswego.edu ppp
10.39.46.11  mailhost.my_company.com mailhost

you'll note that I did a reverse lookup of the IP of your Redhat box and found out what its real host name is from the DNS. That of course assumes that the IP of the Linux system is really that shown above.

A domain name, in the strictest sense, is two tokens separated by a single '.' and the last token is one of the official top level domains (com, net, edu, mil, etc.). A Fully Qualified Domain Name (FQDN) is at least three tokens separated by a '.'. The looser interpretation, which is what sendmail is operating on is that if the address only contains a single '.' it is a domain and if it contains two or more '.'s it may be a hostname.

Author

Commented:
Ok,

I've changed my hosts file so it now reads,

127.0.0.1      localhost.localdomain   localhost
129.3.20.19    redhat_server.mycompany.com redhat_server
10.39.46.11    mailhost.mycompany.com   mailhost

and I'm still getting the following error when I try to use sendmail.

/usr/sbin/sendmail -v -f root@redhat_server.mycompany.com user@mycompany.com
mycompany.com: Name server timeout
user@mycompany.com... Transient parse error -- message queued for future delivery

Any further thoughts?! Thanks

Andy

PS: The 129.3.20.19 address is the correct linux address, but it is behind the corporate firewall and as such we're nothing to do with oswego.edu
Top Expert 2005

Commented:
You mail command must be:

sendmail -v -f root@redhat_server.mycompany.com user@mailhost.mycompany.com

It's the destination address that matter w/respect to DNS.

Author

Commented:
OK, I've tried the above and it didn't produce an error. (I guess that's progress) However, the mail hasn't arrived to my inbox (ie: delivered to user@mailhost.my.company.com).

Do I have to make changes to the /etc/sendmail.cf file. On other systems after sending the message I get lot's of acceptance messages appearing on screen from SMTP, ie:

220 SMTP Server
>>> EHLO brom01.my-company.com
250-mycompany.com
250-SIZE 0
250-ETRN
250-ENHANCEDSTATUSCODES
250-DSN
250-VRFY
250-AUTH
250 8BITMIME
>>> MAIL From:<user@brom01.mycompany.com> SIZE=22
250 2.0.0 user@brom01.mycompany.com OK
>>> RCPT To:<user2@mycompany.com>
250 2.0.0 user2@mycompany.com OK
>>> DATA
354 Ready for data
>>> .
250 2.0.0 Message received OK
user2@mycompany.com... Sent (2.0.0 Message received OK)
Closing connection to mailhost.mycompany.com
>>> QUIT
221 2.0.0 mycompany.com closing
$

However, there are no messages on the linux server.
Top Expert 2005

Commented:
Okay, I think that we've solved that part of the problem. Now it is an Exchange problem. What is needed on the Exchange side is that each user that the Linux box will send mail to must have their mailbox configured to listen for mail addressed to the FQDN in addition to mail addressed to the domain.

Author

Commented:
Ok, that sounds good. However, again... I'm not familiar with exchange. Can you explain in lehman's terms.... sorry.

Also, why would Kmail work from within CDE and sendmail not work from command line? I'm confused by this.....

Thanks

Andy
Top Expert 2005
Commented:
I don't know that I can tell you how to "adjust" the exchange server. I "don't do windows" and I make it a practice to stay as far away as possible from the nightmare that is Exchange. I'll have to ask one of my windows guys how to do that. My recollection is that it must be done on a per-user basis.

Kmail worked because you configured it to talk directly to the Exchange server. Had you configured Kmail to use the local system for sending/receiving email you would have had the same problem as you saw with sendmail.
Commented:
Adding a mailboxes to a Exchange server is pretty straightforward - the damned thing has a very understandable GUI.

In addition, you should check that Exchange server is able to resolve all the "domains" it should send mail to - in your example these are: redhat_server.mycompany.com and mailhost.mycompany.com

You are really close to a solution.
watsonaw:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Author

Commented:
Many thanks for your assistance folks. After several attempts of persuading the exchange admin team there was a change to be made it was successfully completed, and sendmail sprang into life.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial