Smtpd recipient restrictions

Revision as of 09:49, 27 September 2020 by Rnoti (talk | contribs) (To allow a user to receive emails specific users/domains. Example: will receive emails only from, and

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Smtpd recipient restrictions


Restrict a user to receiving emails from all the all and allow from mentioned domains/users only. This can be done per user or domain.

Steps to follow

Edit "/opt/zimbra/conf/zmconfigd/"
Add below line right after "%%contains VAR:zimbraServiceEnabled cbpolicyd, check_policy_service inet:localhost:@@cbpolicyd_bind_port@@%%"
check_recipient_access lmdb:/opt/zimbra/conf/protected_recipients
Create empty fille
touch /opt/zimbra/conf/protected_recipients
Add the entry like below to the "/opt/zimbra/conf/protected_recipients", for whom you want to protect.       permitted_senders_list
If the domain (i.e.: mentioned then this rule will apply to all the users of recipient.
permitted_senders_list is a class name we use this in file.
Create empty file
touch /opt/zimbra/conf/permitted_senders
Add the entry like below to the "/opt/zimbra/conf/permitted_senders", whom you want to allow to send an email to protected recipients. ok ok
Add the home domain to accept emails from the same domain(i.e.:
If a domain mentioned then entire domain will be allowed.
Generate lmdb files for permitted sender & recipients by running below commands.
postmap lmdb:/opt/zimbra/conf/permitted_senders
postmap lmdb:/opt/zimbra/conf/protected_recipients
To keep lmdb files updated, postmap should be executed whenever protected sender/recipients modified.
Edit "/opt/zimbra/common/conf/" and add below lines at the end.
smtpd_restriction_classes = permitted_senders_list
permitted_senders_list = check_sender_access lmdb:/opt/zimbra/conf/permitted_senders, reject
Restart Configd, MTA.
zmconfigdctl restart
zmmtactl restart
Run all the commands as Zimbra user (su - zimbra).
Take backup of respective files before edit.
Submitted by: Raghu Noti
Verified Against: ZCS 8.8.15, ZCS 9.0 Date Created: 2020-09-27
Article ID: Date Modified: 2020-09-27

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