We will set up a restriction class which will limit our policy service to a subset of users. Not only will this avoid unnecessary queries on aliased mailboxes, it will also allow us to override the result using DUNNO
in case the IMAP backend is unable to serve the query.
# We will only query for quotas on real mailboxes via a restriction class. # If Dovecot service is down, still queue mail. smtpd_restriction_classes = quota_users quota_users = check_policy_service { unix:private/quota-status, timeout=10s, default_action=DUNNO }
The users are filtered using a simple access table.
user@example.com quota_users
We use the restriction class by querying the table in our access restrictions:
smtpd_recipient_restrictions = check_recipient_access ${indexed}recipient_access, reject_non_fqdn_recipient, reject_unverified_recipient, check_recipient_access ${indexed}quota_users