Difference between revisions of "Domain level blocking of users"

Line 6: Line 6:
 
1. Set smtpd_sender_restrictions as appropriate for the version of ZCS
 
1. Set smtpd_sender_restrictions as appropriate for the version of ZCS
 
  ZCS 7:
 
  ZCS 7:
  zmlocalconfig -e postfix_smtpd_sender_restrictions="hash:/opt/zimbra/postfix/conf/reject"
+
  zmlocalconfig -e postfix_smtpd_sender_restrictions="hash:/opt/zimbra/conf/postfix_reject_sender"
  
 
  ZCS 8:
 
  ZCS 8:
  Add "client_sender_access hash:/opt/zimbra/postfix/conf/reject" as the first line of '''/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf'''
+
  Add "client_sender_access hash:/opt/zimbra/conf/postfix_reject_sender" as the first line of '''/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf'''
  
  ZCS 8.5:
+
  ZCS 8.5 and 8.6:
  Create the postmap database as defined below and add with
+
  Create the postmap database as defined below
  zmprov ms <zmhostname> +zimbraMtaRestriction "client_sender_access lmdb:/opt/zimbra/postfix/conf/reject"
+
Modify '''/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf''', by adding this as the second line of the file:
 +
  %%contains VAR:zimbraMtaSmtpdSenderRestrictions check_sender_access lmdb:/opt/zimbra/conf/postfix_reject_sender%%
 +
  zmprov ms <zmhostname> +zimbraMtaRestriction "client_sender_access lmdb:/opt/zimbra/postfix/conf/postfix_reject_sender"
  
2. Create file /opt/zimbra/postfix/conf/reject with the list of email addresses and domains to be rejected in the below format:
+
2. Create file /opt/zimbra/conf/postfix_reject_sender with the list of email addresses and domains to be rejected in the below format:
 
   user@domain.com REJECT
 
   user@domain.com REJECT
 
   domainX.com REJECT
 
   domainX.com REJECT
  
 
3. postmap it and restart postfix
 
3. postmap it and restart postfix
   postmap /opt/zimbra/postfix/conf/reject
+
   postmap /opt/zimbra/conf/postfix_reject_sender
 
   zmmtactl stop && zmmtactl start
 
   zmmtactl stop && zmmtactl start
  

Revision as of 21:13, 5 March 2015

Admin Article

Article Information

This article applies to the following ZCS versions.

ZCS 7.0 Article ZCS 7.0 ZCS 8.0 Article ZCS 8.0


Below mentioned are the steps to "REJECT" an external email address from sending mail to the users of the Zimbra Domain.

The same results can also be achieved using Amavis via blacklisting.

1. Set smtpd_sender_restrictions as appropriate for the version of ZCS

ZCS 7:
zmlocalconfig -e postfix_smtpd_sender_restrictions="hash:/opt/zimbra/conf/postfix_reject_sender"
ZCS 8:
Add "client_sender_access hash:/opt/zimbra/conf/postfix_reject_sender" as the first line of /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf
ZCS 8.5 and 8.6:
Create the postmap database as defined below
Modify /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf, by adding this as the second line of the file:
 %%contains VAR:zimbraMtaSmtpdSenderRestrictions check_sender_access lmdb:/opt/zimbra/conf/postfix_reject_sender%%
zmprov ms <zmhostname> +zimbraMtaRestriction "client_sender_access lmdb:/opt/zimbra/postfix/conf/postfix_reject_sender"

2. Create file /opt/zimbra/conf/postfix_reject_sender with the list of email addresses and domains to be rejected in the below format:

  user@domain.com REJECT
  domainX.com REJECT

3. postmap it and restart postfix

 postmap /opt/zimbra/conf/postfix_reject_sender
 zmmtactl stop && zmmtactl start

You'll be able to see the changes show up in /opt/zimbra/log/zmconfigd.log .

Reject messages will be logged in /var/log/zimbra.log ; format looks like this:

[date / hostname] postfix/smtpd[####] NOQUEUE: reject: RCPT from [remote mta]: 554 5.7.1 <senders-email@DOMAIN>:
Sender address rejected: Access denied: from=<senders-email@DOMAIN> to=<local-zimbra-user@domain> proto=ESMTP helo=<remote mta>

The sender will receive a returned email declaring the rejection.

Verified Against: ZCS 8.5, ZCS 8.0, ZCS 7.0 Date Created: 03/21/2013
Article ID: https://wiki.zimbra.com/index.php?title=Domain_level_blocking_of_users Date Modified: 2015-03-05



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