Configuring another postfix server for incoming and outgoing emails
To configure a postfix relay server which is publicly reachable, say mail.sbarjatiya.com, to receive and forward emails on behalf of an internal server, say mailtest.sbarjatiya.com use following steps:
- Add DNS entries for mailtest.sbarjatiya.com with MX mail.sbarjatiya.com on external DNS
- Add DNS entries for mailtest.sbarjatiya.com with MX mailtest.sbarjatiya.com on internal DNS
- Edit '/etc/postfix/main.cf' on mail.sbarjatiya.com to include:
- relay_domains = mailtest.sbarjatiya.com
- mynetworks = <Private IP address of mailtest.sbarjatiya.com>
- Edit '/etc/postfix/main.cf' on mailtest.sbarjatiya.com to include:
- relayhost = mail.sbarjatiya.com
- Test by sending email from external email server and also by using mail command on mailtest.sbarjatiya.com to verify things are working fine.
Note that this would require a IMAP / POP3 server to be setup on mailtest.sbarjatiya.com for users to be able to check email.