Block user for send email to some external email

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Block user for send email to some external email


   KB 24433        Last updated on 2022-05-26  




0.00
(0 votes)

Problem

How to block user for send email to some external email ?

Solution

ZCS 8.8.x and Later

Step 1:

Open file /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf and add the below line at the top.

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

Then execute:

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

Step 2:

Open file /opt/zimbra/conf/zmconfigd.cf and add below lines before "RESTART mta".

POSTCONF    smtpd_restriction_classes  local_only
POSTCONF    local_only  FILE  postfix_check_recipient_access.cf

Note: We can find like below

SECTION mta DEPENDS amavis
 -----------
 -----------
 -----------
RESTART mta

Step 3:

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

check_recipient_access lmdb:/opt/zimbra/common/conf/local_domains, permit

Step 4:

Create a file /opt/zimbra/common/conf/restricted_senders and enter the list of users that you want to block. Follow this syntax:

user@yourdomain.com            local_only

Step 5:

Create a file /opt/zimbra/common/conf/local_domains, here list all the domains/emails where restricted users denied sending mails.

USER@DOMAIN.TLD REJECT
YOURDOMAIN.TLD REJECT

Step 6:

Set ownership permissions for created files

chown zimbra:zimbra /opt/zimbra/conf/postfix_check_recipient_access.cf
chmod 644 /opt/zimbra/conf/postfix_check_recipient_access.cf
chown :zimbra /opt/zimbra/common/conf/restricted_senders
chmod 775 /opt/zimbra/common/conf/restricted_senders
chown :zimbra /opt/zimbra/common/conf/local_domains
chmod 775 /opt/zimbra/common/conf/local_domains

Step 7:

Run the below commands as Zimbra user.

postmap /opt/zimbra/common/conf/restricted_senders
postmap /opt/zimbra/common/conf/local_domains
zmmtactl stop
zmmtactl start
Submitted by: Ankit Dagdi
Verified Against: Date Created:
Article ID: https://wiki.zimbra.com/index.php?title=Block_user_for_send_email_to_some_external_email Date Modified: 2022-05-26



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