Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail issues Solaris 9 1

Status
Not open for further replies.

djr111

Technical User
Aug 5, 2006
357
US
I have a server that if I send mail from, I get the following entry in the /var/mail/(user) (SEE BELOW)

I have seen many items on google that points to a dns issue, the resolv.conf and nsswitch.conf.

these files seems to be just fine, I am resolving names just fine, but it still will not send mail.

We have a few servers that are having this issue, I'm not sure if it could be a blocked port issue, or something more local on the server.

out sendmail.cf, is the basic installed version.


thanks




----- Transcript of session follows -----
550 5.1.2 <user@company.com>... Host unknown (Name server: mailhost.company.com: host not found)

--k7MKDYHX012135.1156277614/servername.company.com
Content-Type: message/delivery-status
 
You need to have a mailhost to send to even if it's a local mailhost that has to forward it. Do a "[tt]nslookup mailhost[/tt]" (no company.com on it) and does that return an IP or an error?

If it returns an error, go to a machine that can send mail and see if it has "[tt]mailhost[/tt]" defined in it's [tt]/etc/hosts[/tt] file. If it does, copy that entry to the machine that's not working.

Can that machine send mail to anything else? Or is it just that one destination?
 
Hi Sambones,

sendmail is not my fortay, so I'm learning the hard way.

the weird thing is, when I do a nslookup on a machine that is able to deliver mail, its nslookup gives the same output as the server in which can not deliver mail.

The below, entry is what I receive. I do not know what else to check.

There are no machines that I can see which have a mailhost entry in the /etc/hosts file.

by the way nslookup on a servername other than 'mailhost'' returns a valid ip address

THANKS!!!

/etc/mail> nslookup
Default Server: server.my.company.com
Address: 10.0.89.30

> mailhost
Server: server.my.company.com
Address: 10.0.89.30

*** server.my.company.com can't find mailhost: Server failed
> q
Server: server.my.company.com
Address: 10.0.89.30

*** server.my.company.com can't find q: Server failed
 
Try the FQDN mailhost.company.com also.

Also try this:

Code:
nslookup
> set type=MX
> my.company.com
> it should list out all your e-mail servers
 
Hi Coffeeysm,


I did what you put in your posting also I contacted our firewall dept.

It appears that my server is trying to use the wrong smtp server, he could see logs from the hosts showing that it can not connect to the smtp server.

^Croot@:/etc/mail> nslookup
Default Server: server.company.com
Address: 10.0.0.0

> set type=MX
> company.com
Server: server.company.com
Address: 10.8.0.1

company.com preference = 10, mail exchanger = serversmtp.company.com
company.com nameserver = server.company.com
company.com nameserver = server.company.com
company.com nameserver = server.company.com
serversmtp.company.com internet address = 10.1.2.3 (this is the wrong one)

it should be 10.2.3.4

how do I change this, I thought I could put an entry in the /etc/hosts, tried it, does not work



my /etc/hosts entry ( i need to use this mailhost)
10.2.3.4 mailhost mailhost server.company.com
 
Well you can't change the DNS records unless you have access to the server. Make sure your /etc/nsswitch.conf file lists

hosts: files nis dns

It should look like this in your /etc/hosts file:
10.2.3.4 servername mailhost mailhost.company.com

Then try running:
mailx -v -s "Test Message" your@address
Enter text message
. <ENTER>

That will run the command in verbose and tell you what server it is trying to connect to.
 
Do you have a relay set-up in sendmail.cf?

vi the file and search for ^DS

if it's blank (Just DS) try adding you mail host (Exchange Server?)

DSexchangeserver.co.uk

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
I seem to be able to send email from this server now, however, it is taking over 7 minutes to actually get delivered.

When I send mail from its sister machine, it gets delivered to me immediately, kind of ruling out delay issues with the mailhost

both machines are on the same subnet, using the same dns server, they are basically twins.



thanks again!!





0-server.company.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<root@server.company.com> SIZE=85
250 2.1.0 <root@server.company.com>... Sender ok
>>> RCPT To:<user@company.com>
>>> DATA
250 2.1.5 <user@company.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> . <<< ---- HANGS HERE, until it finally delivers


 
Well the first line kind of throws me off a little:

Code:
0-server.company.com Hello localhost [127.0.0.1], pleased to meet you

It is identifying your client as localhost it should be your workstations name or ip address. That could be one of your problems, the mail server you are sending to could think it is coming from itself or something. Does the sister machine say that as well in the first line.
 
That is exactly what it thinks, after 8 or so minutes, the machine that sends delayed email has this entry from the
mailx -v command


050 250 2.1.5 root OK
050 <root@server.company.com>... Sent
250 2.0.0 k7OHgXF0014016 Message accepted for delivery
user@company.com... Sent (k7OHgXF0014016 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 server.company.com closing connection <<--- it is report itself back here


To answer your question, yes, the sister server does have a localhost entry.

BUT you have the million dollar answer, the sister server says 'hello servername, NOT localhost during the mailx command.
adding the mailhost entry in the /etc/hosts allows the system to eventualy send the mail, but that is all I know.
 
On the machine that takes 8 minutes to send an e-mail. Check your /etc/hosts files make sure it is in this format:

Code:
127.0.0.1 loghost localhost
10.x.x.x  machine_name
10.2.3.4  mailhost mailhost.company.com
 
this is the entry format for both machines...

127.0.0.1 localhost
10.0.3.9 server.company.com server loghost
10.2.3.4 servername mailhost mailhost.company.com

notice loghost is next to the server name, both machines are this way, the one that send mail fine, and the other that delays email....we were instructed to place 'loghost' in that position'
 
On the last line where you have:

Code:
10.2.3.4 servername mailhost  mailhost.company.com

Is that the name of the machine you are on or the name of the mail server from DNS?
 
sorry for the confusion,

that is the mailserver name we have in DNS for our area. (not the server with the delay issues)
 
Try sending a message manually:

Code:
telnet mailhost.company.com 25
ehlo or helo -see if it still says localhost
mail from: your e-mail
rcpt to: your-email
data
some text here
. <ENTER>
quit
 
well I tried doing it manually,
I did not get a return message to me

What I did notice, it was connecting to the correct mailhost.

Code:
root@server:/> telnet mailhost.company.com 25
Trying 10.2.3.4...
Connected to mailserver.  <-- my mailhost
Escape character is '^]'.
220 mailserver.company.com ESMTP Service (Lotus Domino Release 6.5.1) ready at Thu, 24 Aug 2006 18:07:55 -0400
again, it will deliver my emails sooner or later, but not sure why it did not deliver the manually sent email.
all the steps seemed to validate fine.

 
Try this:

Code:
If sendmail is running: /etc/init.d/sendmail stop
cd /etc/mail
cp -p /etc/mail/sendmail.cf sendmail.ORIG
cp -p /etc/mail/subsidiary.cf sendmail.cf
Then startup it again if you need to.
Try sending another message with mailx -v
 
Well Coffeysm,

you did it!!

it is working just fine now, once I send an email, I receive it within seconds...excellent!!

The subsidiary.cf file, what is that file?

I am not familiar with the file.




thanks




 
Your normal version of Sendmail is usually configure via a macro processor. Solaris though ships with two standard config files already setup for you. They are called main.cf and subsidiary.cf. The main.cf file is used if you are setting up a Sendmail server. The other one is used if you are going to send your e-mail out via relays. Odds are the correct config file was not used when setting up the machine for e-mail. You also do not need Sendmail running to send mail out, however, it should run every now and then to clear out the queue.
 
Thank you for your help,

This has been a learning experience for me, sendmail is not one of my strong points, although, this experience has increased my learning curve.

thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top