On Fri, Apr 17, 2015 at 01:32:36AM -0700, E.B. wrote: > Dovecot has a new feature that can set a flag in the userdb "quota_over_flag" > > http://wiki2.dovecot.org/Quota/Configuration#Overquota-flag_.28v2.2.16.2B-.29 > > I want to use this to reject messages during SMTP conversation for users that > are over quota. I keep this flag in MySQL. [...] > > If possible would like to avoid two database lookups but in postfix [...]
Premature optimization is the root of all evil. Just make two queries, in particular use access(5) tables for this, not address rewriting tables. > Only way I can think to implement this > is a separate smtpd restriction class that makes another sql lookup to > check the quota_over_flag value(?) Yes, use the access control features. > by the way, I won't care about aliases, they will still attempt delivery > and cause a bounce if over quota. If you have aliases that are lists of many users, use local(8) delivery to expand those lists, and configure an "owner-alias" so that bounces go to the list owner and not the poor sender who does not need to know or care whether each and every user on the list got his message. -- Viktor.