Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

up vote 5 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 main.cf, you can need to add this directive:

mynetworks=A.B.C.D 

example:

mynetworks = 127.0.0.0/8 168.100.189.0/28
mynetworks = !192.168.0.1, 192.168.0.0/28
mynetworks = 127.0.0.0/8 168.100.189.0/28 [::1]/128 [2001:240:587::]/64

do not put 0.0.0.0 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  --  0.0.0.0/0            0.0.0.0/0           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

 
discard

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.