Restricting users to send mails to certain domains only Zimbra(whitelist method)

1.ZCS 8.8.15: Enter in file /opt/zimbra/conf/zmconfigd/ check_sender_access lmdb:/opt/zimbra/common/conf/restricted_senders
2.ZCS 8.8.15: Enter in file /opt/zimbra/conf/
vi /opt/zimbra/conf/
Find the section labeled SECTION mta and enter the following two lines directly below
POSTCONF smtpd_restriction_classes local_only
POSTCONF local_only FILE
3. Create a file “/opt/zimbra/conf/”
vi /opt/zimbra/conf/
check_recipient_access lmdb:/opt/zimbra/common/conf/local_domains, reject
4. Create a file “/opt/zimbra/common/conf/restricted_senders” and list all the users, whom you want to restrict. Follow this syntax:
vi /opt/zimbra/common/conf/restricted_senders
[email protected] local_only
Note: If you would like to restrict all users of a domain, enter the domainname instead of email ids. For example:            local_only
5. Create a file “/opt/zimbra/common/conf/local_domains” and list all the domains where “restricted users” allowed to sent mails. Please follow this syntax:
vi /opt/zimbra/common/conf/local_domains OK OK
6. Run following commands:
postmap /opt/zimbra/common/conf/restricted_senders
postmap /opt/zimbra/common/conf/local_domains
zmmtactl stop
zmmtactl start
After these settings, all the users listed in “/opt/zimbra/common/conf/restricted_senders” are restricted to send mails only to domain which are defined in “/opt/zimbra/common/conf/local_domains”, other are fully allowed to send mails anywhere. These settings will not survive Zimbra upgrades, please make sure that you backup of all these settings while performing upgrades.

Important Note if you need to undo this configuration

Remove the two lines that were added to the file. Make sure the Postfix setting smtpd_restriction_classes has nothing set.
postconf -e smtpd_restriction_classes=' '
zmcontrol restart

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat