Block user to send email locally or externally

Revision as of 00:32, 31 July 2018 by Sujit (talk | contribs)

Block user to send email locally or externally


How to block users to send email locally or externally.


Step 1

Open file /opt/zimbra/conf/zmconfigd/ and add this line at the top

%%contains VAR:zimbraMtaSmtpdSenderRestrictions check_sender_access lmdb:/opt/zimbra/postfix/conf/restricted_senders%%

Then execute :

zmprov ms `zmhostname` +zimbraMtaSmtpdSenderRestrictions "check_sender_access lmdb:/opt/zimbra/postfix/conf/restricted_senders"

Step 2

Open file /opt/zimbra/conf/ and add those lines before "RESTART mta". This is example on my system

POSTCONF    smtpd_restriction_classes  local_only
POSTCONF    local_only  FILE

Step 3

Create a file /opt/zimbra/conf/ and add the following line

check_recipient_access lmdb:/opt/zimbra/postfix/conf/local_domains, reject

Step 4

Create a file /opt/zimbra/postfix/conf/restricted_senders and list a user which you want to block. Follow this syntax :            local_only
Step 5

Create an empty file /opt/zimbra/postfix/conf/local_domains, here we list all the domains where restricted users allowed to send mails. But we will keep this blank file as we don't want to send emails inside or outside from this id. Following is the command :

touch /opt/zimbra/postfix/conf/local_domains
Step 6

Run following commands

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

This external link contains more information about formatting.

Submitted by: Navdeep Mathur
Jump to: navigation, search