Friday, May 27, 2016

Postfix configuration


Requirements:


  1. Allow RELAYing for mydomain.com
  2. Allow such relaying ONLY for hosts in the local network

Setup:

/etc/postfix/main.cf


inet_interfaces = all

 mynetworks = 10.0.0.0/16  (local network IP)

smtpd_recipient_restrictions =
        permit_sasl_authenticated
        check_recipient_access hash:/etc/postfix/recipient_access
        reject_unauth_destination

/etc/postfix/recipient_access:

mydomain.com   OK

sudo postmap /etc/postfix/recipient_access
sudo service postmap restart