Restrict users to certain domain: Difference between revisions
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
1. Enter following in the file “/opt/zimbra/conf/postfix_recipient_restrictions.cf”. Make sure it is entered at the top of the file. | 1. Enter following in the file “/opt/zimbra/conf/postfix_recipient_restrictions.cf”. Make sure it is entered at the top of the file. | ||
'''For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf''' | '''For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf''' | ||
Line 14: | Line 15: | ||
2. Enter following in "/opt/zimbra/conf/zmmta.cf" | 2. Enter following in "/opt/zimbra/conf/zmmta.cf" | ||
'''For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd.cf''' | '''For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd.cf''' | ||
Revision as of 09:17, 13 August 2013
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 7.x or older. For ZCS8, looks for specific steps inline.
Restricting users to send mails to certain domains
1. Enter following in the file “/opt/zimbra/conf/postfix_recipient_restrictions.cf”. Make sure it is entered at the top of the file.
For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd/smtpd_recipient_restrictions.cf
vi /opt/zimbra/conf/postfix_recipient_restrictions.cf check_sender_access hash:/opt/zimbra/postfix/conf/restricted_senders
2. Enter following in "/opt/zimbra/conf/zmmta.cf"
For ZCS 8.x - Modify in file /opt/zimbra/conf/zmconfigd.cf
vi /opt/zimbra/conf/zmmta.cf Find the section labeled SECTION mta and enter the following two lines directly below 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"
vi /opt/zimbra/conf/postfix_check_recipient_access.cf 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 user@yourdomain.com 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 yourdomain.com OK otheralloweddomain.com 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 zmmta.cf file. Make sure the Postfix setting smtpd_restriction_classes has nothing set.
postconf -e smtpd_restriction_classes=' '
zmmtactl reload
Related Articles