I have configured Policyd v2 (cluebringer) to apply quota on msg count for SASL and non-SASL users. It is easy in policyd . However I don't know how to configure postfix (2.7.1). Right now I have this (non important rules removed):
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_rbl_client zen.spamhaus.org,
check_policy_service must be before
permit_sasl_authentificated to be able to check on SASL users (because
permit_sasl_authentificated returns OK and no other permissions are checked after it).
But having it here means, that it would count every incoming email attempt in quota - regardless if it will be accepted by postfix or not (because greylist/blacklist and
reject_unauth_destination are after
check_policy_service). So all rejected spam would count on recipient users' quota.
How is it possible to have policyd be invoked for both SASL incoming email and for non-SASL email which is accepted for server?