Jimmy's weblog

12/6/2005

Postfix smarthost (simple way)

Filed under: — jimmy @ 2:08 am

Today I removed my last exim server which was running on my private server. Since this was a simple step (it only has to send mails, receiving is done by my main mail server), I decided to test how to setup postfix as a smarthost and how to use a smarthost.

Part I: Configure postfix to use a smarthost
With Debian it’s just reconfiguring the package. If you don’t use debian or want to do it by hand, it’s basically adding one entry in /etc/postfix/main.cf:

relayhost = ultimate.g-tec.co.at

That’s all :-)

Part II: Configure postfix to be a smarthost for another mail server
As the title of this posting says, it’s the simple way. So both servers are in the same LAN and our firewall makes sure, that no attacker from outside can spoof our LAN IPs.
Again, it’s one little change in /etc/postfix/main.cf. Simply add the IP of the other Server to “mynetworks”

mynetworks = 127.0.0.0/8 192.168.0.66

Done. This setup is enough if you only have servers in your LAN and if you don’t receive mails for them. This is useful when having a couple of servers and you want to send mail over one centralized mail server. If you want to send mails over a smarthost outside of your LAN you have to use TLS.