Postfix setup

Gavin McCullagh gmccullagh at gmail.com
Tue Aug 14 14:46:38 BST 2007


Hi,

On Tue, 14 Aug 2007, Tom Misilo wrote:

> This is the error I get back from telnet
> C:\Documents and Settings\Administrator>telnet mail 25
> Connecting To mail...Could not open connection to the host, on port
> 25: Connect failed

Do you have a linux machine you can connect from?  You should get a
slightly clearer answer from it.

Make sure you can ping mail from the windows machine and that you can ping
it by its ip address as well as by name.

On the server, you can run:

gavinmc at boing:~$ netstat --listening --tcp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:smtp                  *:*                     LISTEN     
tcp        0      0 localhost:2207          *:*                     LISTEN     

the two entries above imply that I have a program listening on the smtp
port (ie tcp port 25) on all (*) interfaces and another listening on
localhost (127.0.0.1) only on tcp port 2207.

> Also to the best of my knowledge there is no firewall running.

You should check this.  You can verify the server has no firewall rules
with:

gavinmc at boing:~$ sudo iptables --list
Password:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

The output above is from a machine with no firewall rules set.

> I also have this in my main.cf
> mynetworks = 127.0.0.0./8 192.168.0.0/24 192.168.1.0/24 So any client
> that is on my network should be able to connect, no?

           [ NB: 127.0.0.0./8 has one too many dots ]

I would have thought so, yes.  Did you restart postfix after the last
change to main.cf?
	sudo /etc/init.d/postfix restart

1. You can connect and send mail on localhost port 25.  
    - Postfix is at least running on localhost

2. Although your mail server can't reach external mail servers to deliver.
    - can you telnet to port 25 on remote mail servers from your server?

3. You can connect by name to port 25 from your mail server, but you get
   "relaying denied".  This should be fixed by the "mynetworks" line above.
   - you should check that.

4. You can't telnet to port 25 from remote windows machine.  
   - can you ping the server from the windows machine, by name and ip?
   - what is is inet_interfaces set to in /etc/postfix/main.cf
   - what is the output of "netstat --listening --tcp"

Gavin




More information about the edubuntu-users mailing list