Zimbra: Restrict User to Send Mail to Particular Email Address

Assalamualaikum..

In order to forbid your users to send emails to a single email address or to a whole domain you specify one or more postfix transport rules. To do so on Zimbra 7.1.3 follow this steps:

1. Create a new file called “postfix_transport” in /opt/zimbra/conf/
2. Enter the email addresses and domains you want to block in the following format:

email@domain.com          error: Forbidden Recipient Address
domain.com          error: Forbidden Recipient Domain

(you can change the error message after “error:” with one of your choice)

3. Save and close the file
4. Use postmap to create a lookup table based on the file you just created (run the command as the ‘zimbra’ user)

postmap /opt/zimbra/conf/postfix_transport

5. Edit the localconfig.xml file to add the contents of the lookup table to the “postfix_transport_maps” key

change:

<key name="postfix_transport_maps">
    <value>proxy:ldap:/opt/zimbra/conf/ldap-transport.cf</value>
</key> 

to:

<key name="postfix_transport_maps">
<value>hash:/opt/zimbra/conf/postfix_transport, proxy:ldap:/opt/zimbra/conf/ldap-transport.cf</value>
</key> 

6. Save the file and exit.
7. Wait for the MTA service to restart automatically (or restart it manually running `zmmtactl restart` as the zimbra user)

You can now check the main.cf file to see if the change has been correctly applied and the zmconfigd.log/zimbra.log files to see if there is any error related to the new setting.

Should you need to add more forbidden addresses/domains, remember to run the `postmap` command I previously mentioned every time to make any change to the postfix_transport file, otherwise the changes won’t be taken into account by Zimbra.

Ref:
Restrict-user-send-mail-particular-email-address-only
Restrict_sending_to_certain_domains
Restrict_users_to_certain_domain

wassalam..

Advertisements
This entry was posted in Zimbra and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s