Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
Restrict domains in ✉️ Zimbra Mail server - PC✗3
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/smtpd_recipient_restrictions.cf and add this line:

 check_sender_access lmdb:/opt/zimbra/conf/restricted_senders

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

 POSTCONF  smtpd_restriction_classes   local_only  
 POSTCONF  local_only                 FILE postfix_check_recipient_access.cf  

3. Create a file /opt/zimbra/conf/postfix_check_recipient_access.cf 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:

 yourdomain.com      local_only

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

 yourdomain.com           OK   
 someotherdomain.com      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/zmconfigd.cf file and run this commands:

 postconf -e smtpd_restriction_classes=' '  
 zmmtactl reload

whoami
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.