Tuesday 6 January 2015

Postfix Restrict Recipients

Here i have shown how to restrict recipients on postfix

Edit the postfix main configuration file /etc/postfix/main.cf


[root@server ~]# vim /etc/postfix/main.cf


smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access_recipient, reject_unauth_destination


Create a file /etc/postfix/access_recipient and add below content

[root@server ~]# vim /etc/postfix/access_recipient

test@manivel.com                REJECT
webadmin@manivel.com      OK

Now run postmap command for creating postfix lookup table i.e .db file

[root@server ~]# postmap /etc/postfix/access_recipient


Finally restart the postfix service

[root@server ~]# service postfix restart