LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-05-2003, 05:55 AM   #1
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Rep: Reputation: 16
connection refused - mail


RH8.0 - when I try to send out an email I get 'Connection refused by <name of my RH server I am sending from>'. Can this be a firewall issue. I'm thinking I had this problem some time ago but cannot find my notes as to how it was resolved. Any ideas?

Thanks! j-me
 
Old 08-05-2003, 07:30 AM   #2
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
Assuming you have internet access and are able to browse the web, yes this could be a firewall problem. Check the OUTPUT chain of your filter table with 'iptables -t filter -L OUTPUT' and ensure that you either aren't restricting outbound connections, or that SMTP is allowed out from your machine.
 
Old 08-05-2003, 10:37 AM   #3
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
output:

target prot opt source destination

Is this "prot" what you are talking about? Do I need to change it? How?
 
Old 08-05-2003, 08:51 PM   #4
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Hi J-me!

I suspect it has got nothing to do with your firewall, since your mail server is running on the same host as that from whihc you are sending the mail, correct?

If you are using sendmail, you probably have forgotten to configure the file --

#*****************************************************************************#
#
# file : /etc/mail/local-host-names
#
#*---------------------------------------------------------------------------*#
#
# All alias names (CNAME and MX records) for the localhost must be included.
#
#.............................................................................#
#
 
Old 08-06-2003, 08:10 AM   #5
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
prot is for 'protocol'. The listing you've shown indicates that you've got no output filtering. This is good.

Perhaps sendmail isn't running or listening on the loopback interface. Try running

netstat -a -n -p | grep ':25'

and see what you get. If it is not listening, but started, you'll need to adjust an option in sendmail.cf (using an m4 macro) called DAEMON_OPTIONS.
 
Old 08-06-2003, 02:55 PM   #6
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
I am sending outside the firewall to a third party exchange server.
I ran the netstat and got:
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 649/sendmail: accep

I tried telnet smptemail 25 and was able to send email fine. sendmail seems to not be configured properly. I have done nothing with it since I installed so any ideas?

Thanks. j-me
 
Old 08-06-2003, 03:01 PM   #7
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
What about the idea I posted in post #4?
 
Old 08-06-2003, 05:35 PM   #8
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
The fact that it is only listing 127.0.0.1:25 means that it is only going to connect if you 'telnet 127.0.0.1 25'. But, if you try to connect using 'telnet 1.2.3.4 25' it will timeout because sendmail isn't working on this 'interface'. You need to edit your /etc/sendmail.mc (or similar, I can't be certain where your origonal .mc file is) and change

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

and add below it

DAEMON_OPTIONS(`Port=smtp,Addr=1.2.3.4, Name=MTA')

Then, build your .cf file with

m4 /etc/sendmail.mc > /etc/sendmail.cf

Then, restart sendmail

/etc/rc.d/init.d/sendmail restart

Then, try that netstat command again. This time, if you are a pimp, you'll see

tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 666/sendmail: accep
tcp 0 0 1.2.3.4:25 0.0.0.0:* LISTEN 666/sendmail: accep

And now you'll be able to connect to the SMTP server from outside the box. 'telnet 1.2.3.4 25' will work.

This is a change in the default configuration of sendmail on RedHat. I had to do this with my box, and it should work for you, too.

Good luck.
 
Old 08-06-2003, 06:18 PM   #9
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
And if you are using the latest sendmail with the clientmqueue
submission daemon, you will also need to add the line

FEATURE(`msp', `[your_host.your_domain.COM]')dnl

to the end of /etc/mail/submit.mc

and do not forget to do a

# cd /etc/mail
# make clean
# make

to regenerate you sendmail.cf and submit.cf
 
Old 08-07-2003, 07:06 AM   #10
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
okay I editted sendmail.mc.
typed #m4 /etc/mail/sendmail > /etc/mail/sendmail.cf

error message:
/etc/mail/sendmail.mc:8: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory

I check /usr/share and sure enough there is no sendmail-cf directory.
# rpm -q sendmail
sendmail-8.12.5-7
# rpm -q m4
m4-1.4.1-11

Is this issue new with RH 8.0 cause I do not remember having so much trouble with 7.3? sendmail just worked with very little changes.

Last edited by j-me; 08-07-2003 at 12:18 PM.
 
Old 08-07-2003, 03:03 PM   #11
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
I found the reason why I could not get m4 to run. should read a little more. now that I've fixed that, ran m4 and restarted sendmail. Still no email sent. On a whim I installed RH7.3 on a laptop and, without any configuration of sendmail, I tested this same issue. It worked! AUGH! The issue is with 8.0 but how do I work around it? Download the latest 8.12.9 and discard RH8.0 sendmail distro. I think I'm gong to give that a try.

Thanks! j-me
 
Old 08-07-2003, 05:26 PM   #12
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
Quote:
Originally posted by j-me
okay I editted sendmail.mc.
typed #m4 /etc/mail/sendmail > /etc/mail/sendmail.cf
And how about editing the /etc/mail/submit.mc file as I suggested?
 
Old 08-08-2003, 08:24 AM   #13
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
Corin,

I did edit submit.mc:
FEATURE(`msp', `[your_host.your_domain.COM]')dnl

I understand it to be
FEATURE(`msp', `myhost.mydomain.COM')dnl
Is this correct?
In /etc/mail I did a
# make clean
# make
# lsl (verified date/time stamp changed for submit.cf)
# /etc/rc.d/init.d/sendmail restart

tried to resend mail
# mail -s test2 <address>

I check /var/log and now I get no attempt to send mail.
I even tried lower-case .com. same result.

One thing I noticed in previous attempts compared to those server that work using 7.3, the maillog relay=outlook.kfbs.com.
On 8.0 maillog, the relay is my server I am trying to send from.
(relay=3wtlap.kfbs.com) Just a difference that may be worth noting.

Am I just doing something wrong?

Thanks for your patience and help. j-me

okay, found out what was wrong. It IS working!!! 8)

Thank you all very much!

Last edited by j-me; 08-08-2003 at 08:32 AM.
 
Old 08-08-2003, 01:22 PM   #14
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 30
j-me

For our benefit and other readers of this thread, please could you post what you did to solve the problem?

When other people who have a similar problem read this thread, it would be very helpful for them to see what was your solution.
 
Old 09-18-2003, 02:05 PM   #15
j-me
Member
 
Registered: Jan 2003
Location: des moines, ia
Distribution: suse RH
Posts: 123

Original Poster
Rep: Reputation: 16
Sorry Corin. Just read this message.
What I did to resolve this issue is to run:
# make clean
# make submit

and sent an email. It worked!

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket Connection Failed: 111 Connection Refused degraffenried13 Linux - General 3 05-31-2009 01:17 AM
connection refused bijuhpd Linux - Newbie 3 03-20-2005 09:49 PM
ircd.conf: "Connection failed. Error: Connection refused" hamish Linux - Software 3 03-10-2005 07:23 AM
POSTFIX holding mail in qeue, won't deliver, connection refused bentman78 Linux - Software 2 10-27-2004 07:11 AM
lp filename yields "cannot open connection to localhost - Connection refused" jjge Linux - General 3 12-28-2003 11:02 PM


All times are GMT -5. The time now is 01:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration