Postfix only allow whitelisted Recipient Domain
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg63owu0A9r2FNhKY9tNan7iZqIdkPJde_vaHaKfB6k_igCttgfzUXZcsds_l3q6mt3rIM6a4um5Oga0Au7ckrV5cRYvPstpD6gE-hOm_TwO-rpukwUX6ffAUcwNHIBJSz4gbWvleDD6vca/s640/Postfix+only+allow+whitelisted+Recipient+Domain.jpeg)
In this tutorial, How to Configure " Postfix only allow whitelisted Recipient Domain ". We test environment with user data. To minimize the risk of sending to unwanted email recipients. Step 1: Add line into main.cf file as below smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_domains, reject Note: Warring /etc/postfix/recipient_domains, reject , Allow receive email in recipient_domain, and REJECT All domain not in whitelisted domain. Step 2: To create recipient domain is the whitelist file mycompany.com OK mail.huuphan.com OK Note: only two domain mycompany.com and mail.huuphan.com receive mail Step 3: To generate hash file: $ sudo postmap /etc/postfix/recipient_domains Step 4: To restart postfix service $ sudo /etc/init.d/postfix restart Now to try sending an email to a another domain not in whitelist. You will find error something like that as below: NOQUEUE: reject: RCPT from …: 554 5.7.1 <[email protected]&g