Fedora This forum is for the discussion of the Fedora Project. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-19-2007, 08:51 AM
|
#1
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Rep:
|
Port 25 closed...can't open
I have a server running Fedora 4. I've been having trouble getting email to work, and just discovered port 25 is closed. This is despite the firewall having port 25 open...
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:25
However, when I do this from another computer: telnet 209.190.35.138 25
I get connect to address 209.190.35.138: Connection refused
When I try to check email using Outlook Express in Windows, I get "Server teminated connection"
http, ftp and ssh all work just fine. But for some reason, port 25 is blocked and I can't unblock it.
Any ideas?
|
|
|
03-19-2007, 09:07 AM
|
#2
|
LQ Newbie
Registered: Mar 2007
Posts: 6
Rep:
|
Does your ISP block port 25?
|
|
|
03-19-2007, 09:59 AM
|
#3
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Quote:
Originally Posted by coolio2006
Does your ISP block port 25?
|
If you mean the company that gives me access to the Internet here at my office, no. Both my other servers have no problem with email.
This new server is with a company I've not used before. It's possible they're blocking port 25 (and I've asked just in case), but it would be extraordinary if they did given this is a dedicated server and needs to send and receive email.
NOTE: I can "telnet localhost 25" just fine.
It's "telnet 209.190.35.138 25" from another machine (own PC using secureCRT and telnet while logged in to my other web server) that cause the problem.
So it seems to me, the issue mus be around something preventing connections from port 25 from outside the server itself.
And I'm wondering if there's something obvious on the box itself that I've overlooked (e.g. I'm know nothing about iptables, so may have misunderstood what's I'm seeing there).
For example, the line...
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
...appears at the bottom of the iptables report when I type "service iptables status" Is this the problem? Baring in mind the file also contains...
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:25
Last edited by 60s TV Batman; 03-19-2007 at 10:54 AM.
|
|
|
03-20-2007, 11:07 AM
|
#4
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
What are you using as your MTA? If you are using Sendmail, by default it will not accept connections from anything accept localhost. If you show us "netstat -pant" as root that could be helpful.
|
|
|
03-20-2007, 11:45 AM
|
#5
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Quote:
Originally Posted by benjithegreat98
What are you using as your MTA? If you are using Sendmail, by default it will not accept connections from anything accept localhost. If you show us "netstat -pant" as root that could be helpful.
|
Before posting here, I'd commented out the line that has Sendmail listen only on localhost, and had Fedora restart sendmail.
It may be my problem isn't a blocked port at all. As of right now, my /etc/resolv.conf file doesn't contain the IPs of my hosting companies nameservers. I suspect that is the main problem.
Here's the netstat results:
[root@localhost ~]# netstat -pant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2107/mysqld
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1732/portmap
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2017/vsftpd
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN 1964/mDNSResponder
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 12666/sendmail: acc
tcp 0 0 :::995 :::* LISTEN 12455/dovecot
tcp 0 0 :::110 :::* LISTEN 12455/dovecot
tcp 0 0 :::80 :::* LISTEN 11660/httpd
tcp 0 0 :::22 :::* LISTEN 2009/sshd
tcp 0 1008 ::ffff:209.190.35.138:22 ::ffff:82.153.163.1:4500 ESTABLISHED 22238/sshd:
Last edited by 60s TV Batman; 03-20-2007 at 11:48 AM.
|
|
|
03-20-2007, 12:04 PM
|
#6
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
This line:
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 12666/sendmail: acc
That line says that sendmail is only listening on 127.0.0.1. Only connections coming from 127.0.0.1 will be accepted. If send mail was listening for any incoming connection the line would say this:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 12666/sendmail: acc
You definitely need to check out your configuration to see what is up.
To test this out further, you say you can telnet localhost 25 just fine, but replace localhost with the IP address of the network adapter.
I'm using FC6 and here is what I have in my sendmail.mc:
Code:
dnl #DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
The top line was what was originally there (with out the dnl # and tailing dnl). I replaced it with the bottom line. I believe if you restart sendmail after that it will compile your sendmail.mc file to the sendmail.cf for you. Or you can do m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf with root privey. Back up your old cf file.
Quote:
It may be my problem isn't a blocked port at all. As of right now, my /etc/resolv.conf file doesn't contain the IPs of my hosting companies nameservers. I suspect that is the main problem.
|
That wouldn't stop you from at least making an initial connection to port 25.
Last edited by benjithegreat98; 03-20-2007 at 12:05 PM.
|
|
|
03-20-2007, 12:54 PM
|
#7
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Benjithegreat98, thank you for your help with this.
Quote:
Originally Posted by benjithegreat98
This line..
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 12666/sendmail: acc
...says that sendmail is only listening on 127.0.0.1.
Code:
dnl #DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
|
OK, I changed my sendmail.mc file to...
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
NOTE: The Addr=127.0.0.1 line was already commented out. I just added in your line. I then entered service sendmail restart. Then I entered netstat -pant and got...
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 23080/sendmail: acc
As you can see, it's still listening on 127.0.0.1.
EDIT: I just commented out your line and restarted sendmail. This did not change the date/time stamp on sendmail.cf.
Could there be a problem that is preventing sendmail.cf from being built, and so causing this problem?
Last edited by 60s TV Batman; 03-20-2007 at 12:59 PM.
|
|
|
03-20-2007, 01:04 PM
|
#8
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
You can manually create the .cf file with the command I gave earlier. Do this with root access:
Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
That command will overwrite your sendmail.cf file. After that you can restart sendmail.
|
|
|
03-20-2007, 01:06 PM
|
#9
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Quote:
Originally Posted by benjithegreat98
You can manually create the .cf file with the command I gave earlier. Do this with root access:
Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
|
That gives me this error message:
/etc/mail/sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory
...and sendmail.mc ends up being 0 bytes long (fortunately, I took your advice and made a copy).
*************************
EDIT: I edited sendmail.cf directly, and commented out the existing DaemonPortOptions line and replaced it with yours.
This did the trick. netstat shows sendmail listening on 0.0.0.0:25, and I can now "telnet 209.190.35.138 25" successfully.
I guess I have another issue with respect to editing sendmail.mc, but that's less important right now.
So thanks for your help.
********************
EDIT #2:
Sendmail still isn't working. Bah! I can see the mail in mqueue, but it's not being delivered.
Ah the joy. More research I guess.
Last edited by 60s TV Batman; 03-20-2007 at 01:20 PM.
|
|
|
03-20-2007, 03:01 PM
|
#10
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
Maybe m4 isn't installed do this:
rpm -qa|grep m4
if that doesn't show anything you can do "yum install m4" to get that on your system.
Good luck
|
|
|
03-20-2007, 03:07 PM
|
#11
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Quote:
Originally Posted by benjithegreat98
Maybe m4 isn't installed do this:
rpm -qa|grep m4
if that doesn't show anything you can do "yum install m4" to get that on your system.
|
The problem is I don't have the IP address for my hosting company's nameservers for /etc/resolv.conf
Until I get those, I won't be getting any further.
Thanks for all your help.
|
|
|
03-20-2007, 03:14 PM
|
#12
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
No problem. The last post was to try and fix the problem you were having creating a .cf file from the .mc file.
|
|
|
03-22-2007, 10:42 AM
|
#13
|
Member
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118
Rep:
|
Quote:
Originally Posted by benjithegreat98
No problem. The last post was to try and fix the problem you were having creating a .cf file from the .mc file.
|
There are 2 ways to modify the .cf file using macros , the one mentioned above and the other way is to use :
|
|
|
03-22-2007, 10:50 AM
|
#14
|
Senior Member
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019
Rep:
|
if m4 is having trouble then the make -C /etc/mail command will fail because it depends on the presence of m4
You can look at /etc/mail/Makefile to see what the make command is doing.
|
|
|
03-22-2007, 11:51 AM
|
#15
|
Member
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60
Original Poster
Rep:
|
Quote:
Originally Posted by benjithegreat98
if m4 is having trouble then the make -C /etc/mail command will fail because it depends on the presence of m4
You can look at /etc/mail/Makefile to see what the make command is doing.
|
The main problem was /etc/resolv.conf didn't contain the IP addresses of my server's hosting company's nameservers. As a result, Yum wouldn't work.
Yesterday, I managed to find out what the IP addresses are. As soon I entered them in resolv.conf, I was able to use Yum to install sendmail-cf. Then I was able to update sendmail.cf via sendmail.mc as per normal.
So everything now works as it should.
Thank you all for your help.
|
|
|
All times are GMT -5. The time now is 10:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|