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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail - problem creating SMTP socket 2

Status
Not open for further replies.

hellsing

MIS
Sep 3, 2001
97
GB
I think I have a conflict on port 25. I have sendmail running which I know listens on port 25 but whenever I try to email to an external email addres I get the following in /usr/adm/syslog

Dec 19 16:37:05 rocc2 sendmail[9888]: NOQUEUE: SYSERR(root): opendaemonsocket:
aemon Daemon0: cannot bind: Address already in use
Dec 19 16:37:05 rocc2 sendmail[9888]: daemon Daemon0: problem creating SMTP socket

I think possibly there might be something else using the same port. Does anyone else agree. Also if this might be the case how do I check to see if anything else is using this port.
 
It's normal for sendmail itself to be listening on port 25, however it sounds like it's trying to start it as a daemon every time you send a message.

How are you trying to send the emails? Is sendmail running as a daemon already? ps -ef | grep sendmail should confirm that for you.

netstat -an | grep *.25 will confirm whether or not something, anything, is listening on port 25. Annihilannic.
 
Hi thanks for the reply,
I'm trying to send messages to external accounts using:

/usr/lib/sendmail -v name@address.co.uk < /dev/null

Sendmail is already running as a daemon. If I run the ps I get:

root 370 1 0 22:03:26 ? 00:00:00 sendmail: accepting connections

When I run netstat -an | grep *.25 it comes back with:
tcp 0 0 *.25 *.* LISTEN




 
Hmm... not sure. That command line works fine for me. Perhaps you should check your sendmail configuration using mkdev cf and choosing option 7. Annihilannic.
 
You are using &quot;sendmail&quot; to send the mail? This sounds odd to me. &quot;sendmail&quot; should be a daemon that runs in the background & you should use &quot;mail&quot; to send mail:
echo &quot;test&quot; | mail -s &quot;Test 1&quot; name@address.co.uk
 
Gi,
I tried running the mail command you suggested. It didn't come back with anything and the email didn't send.
Running mailq shows the following:

/usr/spool/mqueue (1 request)
----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------
gBU9S0118092 5 Mon Dec 30 09:28 rocc
(host map: lookup (domain.co.uk): deferred)
peter.luck@domain.co.uk
 
Is domain.co.uk a valid domain? I tried this on my local server and got the following:

$ nslookup domain.co.uk

*** can't find domain.co.uk: Server failed
 
No sorry, domain.co.uk is just a representation. Its actually a different address but I thought I had better not post my companies actual .co.uk name as they may have a problem with it.
 
Is your system set up in DNS? It may need to be, or if not possible, you may have to work around it (I'm not sure how you go about it). Annihilannic.
 
No my system isn't setup in DNS and its not possible to do so. Everything on the network works off IP address.

Does anyone else out there know how to set this up without using DNS.
 
Are you using a 'smart' mailhost to route the email through, or are you trying to send them directly to the 'net? Annihilannic.
 
Hmm... then you shouldn't need it set up in DNS.

Can you post the output of mkdev cf option 7 (with values changed for privacy of course)?

In /etc/hosts is your hostname listed like this:

[tt]1.2.3.4 hostname hostname.domain.co.uk[/tt] Annihilannic.
 
Thanks for the help by the way.

mkdev cf option 7 looks like this:

Sendmail configuration information...

Machine name: host.domain.co.uk
DOMAIN name: domain.co.uk
UUCP connections: NOT SET
Alternate names: host host.domain.co.uk
Connect to uunet via UUCP? n
Is there a UUCP gateway on the net? n
Is there a smart mailhost on the net? mail.domain.co.uk
Use NIS aliases with sendmail? n
Gateway for non-local X.400 mail? NOT SET
Aliases for X.400 gateway? NOT SET
Is this host on the Internet? y

My hosts files has the following line for this server:
1.2.3.4 host host.domain.co.uk


Pete
 
Looks great! But that doesn't help you very much... sorry, I'm out of ideas. Annihilannic.
 
Can you &quot;telnet mail.domain.co.uk 25&quot;? You should get a &quot;connected&quot;. Check the sendmail log files (not sure where they are on SCO).
 
I don't know if you already figured out how to setup sendmail without using DNS. I recently configured a system using sendmail without DNS. I actually found the solution in the sco site. I hope this helps you.

Problem
I need to configure sendmail (8.8.4) to deliver mail to hosts on my intranet. Sendmail by default attempts to resolve via DNS. Commenting out the 'OI' line in the sendmail.cf and restarting the sendmail daemon does not resolve this issue.
I receive the following message:


message is deferred: hostname lookup failure


Solution
One solution to this issue is as follows. As root:
1. Rename /etc/resolv.conf to /etc/resolv.conf.bak, if it exists.

2. Validate that the /etc/hosts file is up-to-date, and accurate on all hosts.

3. Edit /usr/lib/sendmail.cf as follows:

(a) Ensure that the OI entry in the OPTIONS section is is changed as follows:


OI-DNSRCH


(b) Add another entry immediately after the OPTIONS heading.

# Service.Switch to eliminate DNS lookup
O ServiceSwitchFile=/etc/service.switch


4. Create a file /etc/service.switch which contains a single line:

hosts files


NOTE: The word 'hosts' is followed by a space and the word 'files'.
5. The permissions and owner/group on /service.switch are:


chown bin:bin /etc/service.switch
chmod 644 /etc/service.switch


6. kill the current sendmail daemon:

ps -ef | grep sendmail
kill <sendmail-pid>


7. Manually restart the sendmail daemon:

/usr/lib/sendmail -bd -q1h


To test and troubleshoot the changes, invoke:

/usr/lib/sendmail -v <user>@<hostname>

 
First off Annihilannic, thanks for all your help.

Secondly, Wonboodoo , I ran the telnet command you suggested and succesfully connected.

Thirdly joen I have done as your post suggested and I'm just waiting to see if it was succesfull. I got a message about relaying denied but then got a succesfull sent. I'll see if I get the email and let you know.

Thanks for the help.
 
Right local addresses on the machine work Ok and I've sent mail to them.

I have tried sending to external accounts and have got the following:

sco_unix> /usr/lib/sendmail -v peterluck@freeserve.co.uk < /etc/hosts
Warning: .cf file is out of date: sendmail 8.11.0 supports version 9, .cf file i
s version 5
peterluck@freeserve.co.uk... Connecting to mail.domain.co.uk via relay...
220 courier.intra.domain.co.uk ESMTP MailMarshal (v5,0,3,76) Ready
>>> EHLO rocc2.intra.domain.co.uk
250-courier.intra.domain.co.uk Hello host.intra.domain.co.uk (172.17.1.16)
250-AUTH LOGIN
250-AUTH=LOGIN
250 SIZE
>>> MAIL From:<user@host.intra.domain.co.uk> SIZE=350
250 sender ok <user@host.intra.domain.co.uk>
>>> RCPT To:<peterluck@freeserve.co.uk>
550 <peterluck@freeserve.co.uk> Relaying Denied
>>> RSET
250 State reset
/u/home/user/dead.letter... Saved message in /u/home/user/dead.letter
Closing connection to mail.domain.co.uk
>>> QUIT
221 courier.intra.domain.co.uk closing connection


From the looks of things its the configuration on the machine the mail is trying to go through once it leaves the Unix box, and the Unix box is Ok. Do you think thats right?
 
Do you have the smart relay option setup like this?

# &quot;Smart&quot; relay host (may be null)
DSsmtp:[ip address]

&quot;ip address&quot; - the mailserver ip address locally

Make sure that you stop and start the sendmail daemon.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top