Difference between revisions of "Block user to send email locally or externally"

Line 56: Line 56:
This [https://www.mediawiki.org/wiki/Help:Formatting external link] contains more information about formatting.
{| class="wikitable" style="background-color:#d0f0c0;" cellpadding="10"
|'''Submitted by''': Navdeep Mathur
Submitted by:  Navdeep Mathur
{{Article Footer||}}

Revision as of 23:55, 20 August 2018

Block user to send email locally or externally

   KB 23348        Last updated on 2018-08-20  

(0 votes)


How to block users to send email locally or externally.


Step 1

Open file /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf 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/zmconfigd.cf and add those lines before "RESTART mta". This is example on my system

POSTCONF    smtpd_restriction_classes  local_only
POSTCONF    local_only  FILE  postfix_check_recipient_access.cf

Step 3

Create a file /opt/zimbra/conf/postfix_check_recipient_access.cf 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 :

user@yourdomain.com            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

Submitted by: Navdeep Mathur
Verified Against: Date Created:
Article ID: https://wiki.zimbra.com/index.php?title=Block_user_to_send_email_locally_or_externally Date Modified: 2018-08-20

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