Restrict account from sending emails to all domains: Difference between revisions
Line 13: | Line 13: | ||
1) Specify the account for which the restriction is applied. | 1) Specify the account for which the restriction is applied. | ||
echo "test@example.com restrict_sender" > /opt/zimbra/postfix/conf/ | echo "test@example.com restrict_sender" > /opt/zimbra/postfix/conf/restrict_senders | ||
''Note: If you would like to restrict all users of a domain, enter the domainname instead of email ids. For example:'' | ''Note: If you would like to restrict all users of a domain, enter the domainname instead of email ids. For example:'' | ||
echo "yourdomain.com restrict_sender" > /opt/zimbra/postfix/conf/ | echo "yourdomain.com restrict_sender" > /opt/zimbra/postfix/conf/restrict_senders | ||
2) | 2) | ||
postmap /opt/zimbra/postfix/conf/ | postmap /opt/zimbra/postfix/conf/restrict_senders | ||
3) Create a blank file in which no domain name is specified. | 3) Create a blank file in which no domain name is specified. |
Latest revision as of 14:01, 12 February 2019
Restrict account from sending emails to all domains
Problem
How to restrict a single account from sending emails to all domains.
Resolution
Steps:
1) Specify the account for which the restriction is applied.
echo "test@example.com restrict_sender" > /opt/zimbra/postfix/conf/restrict_senders
Note: If you would like to restrict all users of a domain, enter the domainname instead of email ids. For example:
echo "yourdomain.com restrict_sender" > /opt/zimbra/postfix/conf/restrict_senders
2)
postmap /opt/zimbra/postfix/conf/restrict_senders
3) Create a blank file in which no domain name is specified.
touch /opt/zimbra/postfix/conf/restrict_recipients
4)
postmap /opt/zimbra/postfix/conf/restrict_recipients
5) In the file /opt/zimbra/conf/zmconfigd.cf, find the "SECTION mta DEPENDS amavis", and enter the following before the "RESTART mta" line:
vi /opt/zimbra/conf/zmconfigd.cf
Enter the lines
POSTCONF smtpd_restriction_classes restrict_sender POSTCONF restrict_sender FILE postfix_restrict_sender.cf
6) Enter the line below at the top of the /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf file.
check_sender_access lmdb:/opt/zimbra/conf/restrict_senders
7)
vim /opt/zimbra/postfix/conf/main.cf
Enter these two lines
smtpd_restriction_classes = restrict_sender restrict_sender = check_recipient_access lmdb:/opt/zimbra/conf/sender_recipients, reject
8)
cd /opt/zimbra/conf echo "check_recipient_access lmdb:/opt/zimbra/conf/sender_recipients, reject" >> postfix_restrict_sender.cf
9)
zmmtactl restart
Additional Information