Posts Tagged ‘relay’
In this tutorial I will describe how setup a complete mail server for relaying mail to another server, for example an IMAP server or an Exchange, tipically this machine will be placed in a DMZ network and will be reachable from internet.
I will explain how to install and configure :
- Postgrey : to do GreyListing on incoming mails and avoid SPAM.
- Postfix : to receive mails for local or remote mailboxes and do some checks for trash mail using RBL and internal options.
- Amavisd-New : to scan incoming mails form Viruses and SPAM.
- Clamd : to avoid Amavisd-new virus scan.
- Spamassassin : to avoid amavisd-new SPAM scan with Razor, Pyzor and DCC.
- Altermime : to add a disclaimer (both text and html) for the outgoing mail.
- Cyrus-Sasl : to enable sasl authentication for road warriors.
- Fetchmail : to eventually fetch the mail from another mail server.
- Apache : to create a reverse proxy to reach a webmail service on the internal web server.
I’ll describe all steps needed to install it on RHEL or CentOS because the steps are identical for both distributions and because are my favourites ones.
I’m assuming you’re going to install a 64bit operating system, but if you choose to install the 32bit version pay only attention for some packages to fit your architecture.
First of all you have to install you operating systems. I’ll not explain this process because it’s very simple, but I’ll suggest you to NOT customize the system during the installation procedure, it will be done later.
At the first reboot, disable both Selinux and Firewall, then reboot again and login to your system as user root.
This post will explain how to configure a relay server to put on a DMZ network for relay mail for two domains, and use two mail server on the internal network.
This configuration will be useful to not publish your SMTP server (Linux, Exchange, Lotus Domino or whatever you have) directly on internet, and keep it in your internal network, and publish a relay server for security purpose.
I’ve tested this configuration for relaying mail to Microsoft Exchange, Postfix, QMail, Sendmail, Lotus Domino, Merak and other less common mail server without any kind of problems.
You could use Red Hat Enterprise Linux (RHEL) or CentOS without change an line of the following configuration, but with small adjustement you can use this how to to any linux distribution.
I’ve used Postfix as mail server, because for me it’s the best, and Amavisd-New, Clamd and SpamAssassin for checking Virus and Spam on relaying mail.
This post assume you have two internal network 192.168.1.0/24 and 192.168.2.0/24 and you have a mail server for yourdomain.com on the 192.168.1 network and another mail server for yourdomain.net on 192.168.2 network.
In particular the yourdomain.com mail server have 192.168.1.4/24 and yourdomain.net mail server have 192.168.2.1/24.
This post will also explain how to configure a simple SMTP authentication based on sasl to authenticate external user directly on the relay server and permit them to send mail to any ther domain using it.























