Configuring another postfix server for incoming and outgoing emails

From Notes_Wiki
Revision as of 10:43, 14 July 2022 by Saurabh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Home > CentOS > CentOS 6.x > Postfix server configuration > 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:

  1. Add DNS entries for mailtest.sbarjatiya.com with MX mail.sbarjatiya.com on external DNS
  2. Add DNS entries for mailtest.sbarjatiya.com with MX mailtest.sbarjatiya.com on internal DNS
  3. Edit '/etc/postfix/main.cf' on mail.sbarjatiya.com to include:
    relay_domains = mailtest.sbarjatiya.com
    mynetworks = <Private IP address of mailtest.sbarjatiya.com>
  4. Edit '/etc/postfix/main.cf' on mailtest.sbarjatiya.com to include:
    relayhost = mail.sbarjatiya.com
  5. 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.


Home > CentOS > CentOS 6.x > Postfix server configuration > Configuring another postfix server for incoming and outgoing emails