Thursday, December 16, 2010

How to Restrict postfix recipient in zimbra

Restrict postfix recipient in zimbra

This will show how you can modify postfix to restrict who can send to certain address in your domain such as distribution like

These change will most likely not persist between upgrades!!!

zimbra/conf/ Also permissions on files created in /opt/zimbra/postfix/conf/ will be changed.

  • Create permitted sender list as zimbra user under /opt/zimbra/postfix/conf/
permitted_sender List :- This file contains domains list OR User mail list, Only protected senders can send mail to this domains OR users.

# vim /opt/zimbra/postfix/conf/permitted_senders

localhost                         OK                    OK                OK   OK
  • Create protected recipient file as zimbra user under /opt/zimbra/postfix/conf/
protected_recipients :- This file contains email address that can only receive from permitted senders

# vim /opt/zimbra/postfix/conf/protected_senders                 permitted_senders_list         permitted_senders_list

  • Include the important setting to /opt/zimbra/postfix/conf/
permitted_senders_list=check_senders_access hash:/opt/zimbra/postfix/conf/permitted_senders, reject
smtpd_restriction_classes = permitted_senders_list,local_only

FYI :- The changes in will not survive after the upgrade of zimbra.
  • Now add the this restriction on the top of all line.
# vim /opt/zimbra/conf/
check_recipient_access hash:/opt/zimbra/postfix/conf/protected_recipients
  • Reload the settings
/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/permitted_senders
/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/protected_recipients
/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/

/opt/zimbra/postfix/sbin/postfix  reload

FYI :- This configuration can also used in normal postfix..


Chetanneo said...

it is not working & showing error when receive mail from permitted sender.

Showing error " warning: unknown smtpd restriction: "permitted_senders_list" "

Caterpillar said...


Sorry, I forgot to add this line.

smtpd_restriction_classes = permitted_senders_list,local_only