How to Restrict users sending to certain users/Domains Zimbra 8.6 on Ubuntu (Server) 14.04 LTS Step-by-Step

This document describes how to restrict a list of users for sending emails to limited domains. Other users can send mails anywhere. All steps I am doing here as Zimbra user. These steps are verified on ZCS 8.x or newer.

You have to be logged in as a root.

If you can open file you can set full permission with the following command as root

Step 1 – Set permission as root

root@mail:/# chmod 777 /opt/nameoffile

Step 2 – You must work as zimbra user.

root@mail:/# su – zimbra

Step 3 – Enter in file /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf this line check_sender_access hash:/opt/zimbra/postfix/conf/restricted_senders

zimbra@mail:~$ nano /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf

Step 4 – Your file look like as this:

Step 5 – Set permission on this file /opt/zimbra/conf/zmconfigd.cf with the following command:

zimbra@mail:~$ chmod 775 /opt/zimbra/conf/zmconfigd.cf

Step 6 – Then and add those lines before RESTART mta.

POSTCONF smtpd_restriction_classes local_only
POSTCONF local_only FILE postfix_check_recipient_access.cf

Step 7 – Your file look like as this:

Step 8 – Execute the following command and this line check_recipient_access lmdb:/opt/zimbra/postfix/conf/local_domains, reject

zimbra@mail:~$ nano /opt/zimbra/conf/postfix_check_recipient_access.cf

Step 9 – Execute the following nano /opt/zimbra/conf/postfix_check_recipient_access.cf command and add all the users, whom you want to restrict. Follow this syntax:

test@yourdomain     local_only

Step 10 – Execute the following nano /opt/zimbra/postfix/conf/local_domains command and add all the domains, whom you want to allow to sending mail. Follow this syntax:

yourdomain   OK

Step 11 – For the changes to take effect execute the following commands:

zimbra@mail:~$ postmap /opt/zimbra/postfix/conf/restricted_senders
zimbra@mail:~$ postmap /opt/zimbra/postfix/conf/local_domains

If you insert new user or new domain don’t forget to running again number 11.

Step 12 – Restart service.

zimbra@mail:~$ zmmtactl stop
zimbra@mail:~$ zmmtactl start

Step 13 – When you attempt to sending mail from not allowed user you will see this.

16 ThemeHow to migrate Zimbra 6,7,8 and next version with script from one server to another

Leave a Reply

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

*
*
Website