LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-22-2005, 12:44 AM   #1
nevarlen
Member
 
Registered: Feb 2005
Distribution: Debian 3.x & Fedora Core 3, Debie on IBM Thinkpad
Posts: 68

Rep: Reputation: 15
Help getting Postfix to accept mail from anywhere


Hello All,
Once again I stumped with another problem..
I am running Mandrake 10.2 with postfix 2.1.5. Problem is when I am on the host machine, I can telnet through port 25 and get the postfix's welcome message, however I can not establish connection from another machine. If try from another machine, I keep getting Unable to connect to remote host: Connection refused error.
I know for sure that my isp does not block port 25 coz I tried running IIS's smtp server, worked with no problem, which also meant that my port forwarding on my router worked well too. Also, I made sure that host machine is accepting all connections on port 25.
Finally I turned off all the firewalls, still no luck.
When I netstat -t -a | grep LISTEN, it spits out::
tcp 0 0 mydomain.com:smtp *:* LISTEN
tcp 0 0 *:microsoft-ds *:* LISTEN
tcp 0 0 *:670 *:* LISTEN
tcp 0 0 *:http *:* LISTEN
tcp 0 0 *:x11 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:https *:* LISTEN

I am assuming that there is something disabling smtp to listen connection from everything except mydomain.com. Again, the above is applicable even if all the firewalls are turned off. Also, hosts.allow and deny files are okay too. In postfix's man.cf file, I have inet_interface=all..

Any ideas what might be causing this? Thanks in advance...
 
Old 06-22-2005, 03:04 AM   #2
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
If inet_interface=all, then I would think the output of netstat -ta would be something like:
Code:
tcp   0     0       *:smtp      *:*       LISTEN
What you posted shows that postfix is ONLY listening on whatever the IP address is of mydomain.com. So where is the localhost entry since postfix is not bound to all interfaces? At least based on what you posted. Also, are you sure the IP address of mydomain.com is correct?

Can you post the output of: netstat -nap | grep :25

As a reference, here is the equivalent at my end. Note: I do not set inet_interfaces=all. Plus, I have truncated most grep output for clarity.
Code:
[root@excelsior postfix]# grep inet_interfaces main.cf
inet_interfaces = $myhostname, localhost

[root@excelsior postfix]# grep myhostname main.cf                               
myhostname = mail.mydomain.com

[root@excelsior postfix]# netstat -nap | grep :25
tcp    0    0 192.168.8.2:25      0.0.0.0:*         LISTEN      3260/master         
tcp    0    0 127.0.0.1:25        0.0.0.0:*         LISTEN      3260/master

[root@excelsior postfix]# ifconfig eth0 | grep "inet addr"
          inet addr:192.168.8.2  Bcast:192.168.8.255  Mask:255.255.255.0

[root@excelsior postfix]# dig +short mail.mydomain.com
192.168.8.2
 
Old 06-22-2005, 08:38 AM   #3
nevarlen
Member
 
Registered: Feb 2005
Distribution: Debian 3.x & Fedora Core 3, Debie on IBM Thinkpad
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks for your reply Scowles,
Before anything:
netstat -t -a | grep LISTEN:: in my earlier post returned
tcp 0 0 mydomain.com:smtp *:* LISTEN..
mydomain.com part was my actual localhost name not my domain name(I know it is a stupid naming convention).

Here is output for

[root@mailer ~]# netstat -nap | grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 17872/master

If I change the inet interfaces like yours
inet_interfaces = $myhostname, localhost

I get the following error when reloading the postfix
postfix: fatal: parameter inet_interfaces: no local interface found for 33.33.333.333
(So I went ahead and assign my external ip to device eth0 remotely and LOST connection, which means that I cant do jack until I get home. ugghhh)

Since I get my IP dynamically from my ISP, I try not to use my external ip in most conf files so it wont be pain to update them once it is changes.

grep myhostname main.cf
myhostname = www.mailer.com

ifconfig eth0 | grep "inet addr"
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0

dig +short www.mailer.com
33.33.333.333

As I mentioned, I do not have connection to the server now, so I do not what else to do.
Any suggestion on how to set the interfaces correctly so postfix works like charm would be deeply appreciated.
 
Old 06-22-2005, 07:01 PM   #4
nevarlen
Member
 
Registered: Feb 2005
Distribution: Debian 3.x & Fedora Core 3, Debie on IBM Thinkpad
Posts: 68

Original Poster
Rep: Reputation: 15
My server is up again..

Since port 25 is only listened by 127.0.0.1, I can not get to it from outside the box..
How and where do I set it so that port 25 listenes on either 192.168.1.100 or EVERYTHING???
I tried firewall settings, did not help much..
Thank again..
 
Old 06-23-2005, 05:53 AM   #5
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
I would think running a mail server with a dynamic IP address would be a pain in the.... Fortunately, I have never had to admin a mail server with a DHCP assigned address.

If possible (you seem to be using rfc1918 address space) configure your system with a static IP address like 192.168.1.100 and then edit the hosts file to include entries for both localhost and eth0. i.e. Something like:
Code:
[root@excelsior etc]# cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
192.168.8.2     excelsior.mydomain.com  mail.mydomain.com excelsior mail
Now configure postfix main.cf file to correspond to the entries in /etc/hosts.

If you must continue to use DHCP, then I would think your only option is to set inet_interfaces=all in main.cf. But I would think postfix would have to be reconfigured and restarted if the IP address changed. Again, I have never admin a mail server with a DHCP address.
 
  


Reply



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
Postfix send mail problem(In RH9, kernal 2.4.20, postfix 2.1.5) minor Linux - General 6 09-23-2019 10:09 PM
How to make postfix accept mail from multiple domains Farthom Linux - Newbie 4 09-14-2006 11:13 AM
Postfix won't accept mail from ONE client dontaylor2 Linux - Networking 5 11-10-2005 12:10 PM
qmail-will not accept mail zuessh Linux - Software 4 04-25-2005 08:53 PM
Postfix wil not accept external mail gruger Linux - Software 8 06-19-2003 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration