Restrict users to certain domain

Revision as of 19:01, 24 February 2011 by Glenno (talk | contribs) (Restricting users to send mails to certain domains)

This document describes how to restrict a list of users for sending emails to limited domains. Other users can send mails anywhere. Everything I am doing here as Zimbra user.

Restricting users to send mails to certain domains

1. Enter following in the file “/opt/zimbra/conf/”. Make sure it is entered at the top of the file.

vi /opt/zimbra/conf/
check_sender_access hash:/opt/zimbra/postfix/conf/restricted_senders 

2. Enter following in "/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 hash:/opt/zimbra/postfix/conf/local_domains, reject

4. Create a file "/opt/zimbra/postfix/conf/restricted_senders" and list all the users, whom you want to restrict. Follow this syntax:

vi /opt/zimbra/postfix/conf/restricted_senders            local_only

5. Create a file "/opt/zimbra/postfix/conf/local_domains" and list all the domains where "restricted users" allowed to sent mails. Please follow this syntax:

vi /opt/zimbra/postfix/conf/local_domains                     OK      OK

6. Run following commands:

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

After these settings, all the users listed in "/opt/zimbra/postfix/conf/restricted_senders" are restricted to send mails only to domain which are defined in "/opt/zimbra/postfix/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=' '
zmmtactl reload

Related Articles

Verified Against: unknown Date Created: 10/21/2007
Article ID: Date Modified: 2011-02-24

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search