Step 1: Add line into main.cf file as below
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_domains, rejectNote: 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 OKNote: only two domain mycompany.com and mail.huuphan.com receive mail
mail.huuphan.com OK
Step 3: To generate hash file:
$ sudo postmap /etc/postfix/recipient_domains
Step 4: To restart postfix service
$ sudo /etc/init.d/postfix restartNow 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]>: Recipient address rejected: Access denied
Conclusion
Thought the article, To help you configure Postfix server only allow whitelisted domain. You have any question to comment below.Thanks for reading Postfix only allow whitelisted Recipient Domain My blog Effortless Zimbra Mail Management: Unleashing the Power of Linux Commands, How-To, and Bash Scripts I hope this is useful.
1 Comments :
how to configure in zimbra multi server
Relaysudo postmap /etc/postfix/recipient_domains
postmap not found