Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have PostFix up and running on a CentOS box and would like to send mail from a Windows server on the same network out through the PostFix server.

When I try to telnet from the Windows server into port 25 on the PostFix server currently the connection fails.

Where do I set this up within PostFix/CentOS?

Thanks in advance!

share|improve this question
up vote 12 down vote accepted

You will need to configure relay. However when postfix is running you should be able to still connect to port 25. Might there be a firewall blocking this connection?

When you open, you can need to add this directive:



mynetworks =
mynetworks = !,
mynetworks = [::1]/128 [2001:240:587::]/64

do not put or you will become an open relay.

share|improve this answer
That solves the relay problem...will open another question to address the problem of being unable to telnet in via port 25. Thanks. – Windows Ninja Mar 20 '12 at 20:05
Lucas, I don't believe this actually does what I need it to do. From the way I read it, configuring the relay host tells the postfix server where to send mail after receiving it. However, I want mail to go out directly from this postfix server, I just want to configure it to allow other machines to relay mail to it...does that make sense? – Windows Ninja Mar 21 '12 at 12:06
I made a mistake, it should have been mynetworks, not relayhost, like in the example. Relayhost is indeed to tell other machines to use this server as relay. You put all the network addresses of the allowed machines after this directive to allow them to use the relay. – Lucas Kauffman Mar 21 '12 at 12:15
K, will check that. Thanks for the quick reply! – Windows Ninja Mar 21 '12 at 12:34

My Postfix server has something of the sort in its IPtables to enable connections.

ACCEPT     tcp  --             state NEW tcp dpt:25

Your server might be restricted even further, depending on what you are trying to do. But if telneting to it on port 25 fails do not expect the machine to function as an SMTP server (unless of course you change the ports - which is not what you said). Note that it is possible, many time preferable to accept connections on other ports.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.