Restrict domains in ✉️ Zimbra Mail server

Restrict domains in ✉️ Zimbra Mail server

Here is how to restrict users to send emails to certain domains in the Zimbra mail server.

1. Open file /opt/zimbra/conf/zmconfigd/ and add this line:

 check_sender_access lmdb:/opt/zimbra/conf/restricted_senders

2. Open file /opt/zimbra/conf/ and Find the section labeled SECTION mta and enter the following two lines:

 POSTCONF  smtpd_restriction_classes   local_only  
 POSTCONF  local_only                 FILE  

3. Create a file /opt/zimbra/conf/ and add:

 check_recipient_access lmdb:/opt/zimbra/conf/local_domains, reject  

4. Create a file /opt/zimbra/conf/restricted_senders and list all the domains that you want to restrict. Follow this syntax:      local_only

5. Create a file /opt/zimbra/conf/local_domains and list all the domains where restricted users are allowed to sent emails.           OK      OK

6. Finally, run this commands to implement new rules:

 postmap /opt/zimbra/conf/restricted_senders  
 postmap /opt/zimbra/conf/local_domains   
 zmmtactl stop   
 zmmtactl start  

To undo this configuration
Remove added lines from /opt/zimbra/conf/ file and run this commands:

 postconf -e smtpd_restriction_classes=' '  
 zmmtactl reload

Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.