Zimbra email server – how to block domains or email addresses

Reading Time: < 1 minutes

There are certain situations you would like to block all messages from specific email address or whole domain. You can do it easily with Zimbra creating reject list.

This is not intended for fighting spam as Zimbra includes more useful anti-spam features such as Spamassasin, this is blocking email communication entirely from entries on the reject list.

Create postfix_reject_sender file, which lists email addresses and/or domains you would like to block. Messages from entries on that file will not be delivered, they will be rejected in cold blood with message “Sender address rejected: Access denied”:

nano /opt/zimbra/common/conf/postfix_reject_sender

Execute the zimbraMtaSmtpdSenderRestrictions command as a Zimbra user (replace ZIMBRAHOSTNAME with your server name):

zmprov ms ZIMBRAHOSTANAME +zimbraMtaSmtpdSenderRestrictions "check_sender_access lmdb:/opt/zimbra/common/conf/postfix_reject_sender"

Postmap the reject list with the following cmd:

/opt/zimbra/common/sbin/postmap /opt/zimbra/common/conf/postfix_reject_sender

Restart Zimbra MTA services:

zmmtactl restart

Now domains and email addresses on the reject list are absolutely unable to send any messages to any addresses on the Zimbra server.

 

5/5 - (3 votes)
See also  Why Zimbra OSC is one of the best email servers

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.