I can't find any posts on this list for peoples using quota_over_flag http://wiki2.dovecot.org/Quota/Configuration#Overquota-flag_.28v2.2.16.2B-.29 If my userdb is sql what would be best script to use in terms of performance? (I mean if over-quota-flag triggers script every time it changes and the script calls CLI mysql client isn't all this so expensive to spawn a new shell session which spawns a mysql client?) Anyone knows how to use this flag with postfix *making postfix send special reject* "user over quota" note instead of plain SMTP reject?? Is an additional database lookup (restriction class?) unavoidable? :( TIA1 PS Looks like it is tricky almost impossible to make postfix do rejects based on this flag for aliases. (Special query would be a little messy for our schema but i dunno at what point postfix resolves aliases?)
On 04/16/2015 05:35 AM, E.B. wrote:> I can't find any posts on this list for peoples using quota_over_flag > > http://wiki2.dovecot.org/Quota/Configuration#Overquota-flag_.28v2.2.16.2B-.29 > > If my userdb is sql what would be best script to use in terms of performance? > (I mean if over-quota-flag triggers script every time it changes and the script > calls CLI mysql client isn't all this so expensive to spawn a new shell session > which spawns a mysql client?)I have a post-login script updating a "lastlogin" timestamp every time a user logs in. This can happen many times per second in busy hours. The only noticeable load is on the mysql _server_ (namely, some I/O). The shell + mysql client load is not noticeable at all. Don't use bash, of course! Now if we're talking about updating a flag when a user comes back under quota? How frequently is this expected to happen?> > Anyone knows how to use this flag with postfix *making postfix send > special reject* "user over quota" note instead of plain SMTP reject?? > Is an additional database lookup (restriction class?) unavoidable? :(I don't actually use this, but try perhaps: https://sys4.de/en/blog/2013/04/08/postfix-dovecot-mailbox-quota/ And perhaps search the mailing list for "quota-status" for more info.> TIA1 > > PS Looks like it is tricky almost impossible to make postfix do rejects > based on this flag for aliases. (Special query would be a little messy > for our schema but i dunno at what point postfix resolves aliases?)Tough one. It gets more complicated: What about aliases expanding to multiple recipients? I figure the options are: * Reject (or defer) the RCPT TO because of the one offender who's over quota * Accept, and deliver only to within-quota recipients, silently drop out the over-quota ones * Let a bounce message go out in this case, as necessary I don't know how it's done with postfix, anyway...
Thanks you so much for your reply--> > Anyone knows how to use this flag with postfix *making postfix send > > special reject* "user over quota" note instead of plain SMTP reject?? > > Is an additional database lookup (restriction class?) unavoidable? :( > > I don't actually use this, but try perhaps: > https://sys4.de/en/blog/2013/04/08/postfix-dovecot-mailbox-quota/ > And perhaps search the mailing list for "quota-status" for more info.That's not the same. Strange but I never found quota-status docs on Dovecot wiki nowhere! Anyway, I think quota_over_flag is new and possibly Timo replacing quota-status with this flag now? It's easier I think to use this flag as a smtpd restriction in postfix and not have to do a policy lookup. However, it would be more nice on the postfix side to do only one lookup including the user lookup and the quota_over_flag but I don't know if I can do that and be able to give reject message that is particular to accounts over quota.> > PS Looks like it is tricky almost impossible to make postfix do rejects > > based on this flag for aliases. (Special query would be a little messy > > for our schema but i dunno at what point postfix resolves aliases?) > > Tough one. It gets more complicated: What about aliases expanding to > multiple recipients?Good point!!!!!! Maybe best to let aliases cause bounces like in years before. SMTP reject for real accounts only is still a improvemtn.> I figure the options are: > * Reject (or defer) the RCPT TO because of the one offender who's over quota > * Accept, and deliver only to within-quota recipients, silently drop out > the over-quota ones > * Let a bounce message go out in this case, as necessary > > I don't know how it's done with postfix, anyway...
E.B.
2015-Apr-17 01:09 UTC
Performance impace of spawning shell processes from Dovecot [was: quota_over_flag examples?]
> > I can't find any posts on this list for peoples using quota_over_flag > > > > http://wiki2.dovecot.org/Quota/Configuration#Overquota-flag_.28v2.2.16.2B-.29 > > > > If my userdb is sql what would be best script to use in terms of performance? > > (I mean if over-quota-flag triggers script every time it changes and the script > > calls CLI mysql client isn't all this so expensive to spawn a new shell session > > which spawns a mysql client?) > > I have a post-login script updating a "lastlogin" timestamp every time a > user logs in. This can happen many times per second in busy hours. The > only noticeable load is on the mysql _server_ (namely, some I/O). The > shell + mysql client load is not noticeable at all.Thank you. Is this common for most people === repeatedly spawning shell scripts from Dovecot processes is not impact performance? I thought it's why apps are written as daemons especially for many times a second as you say!> Don't use bash, of course!Hmm well I didn't not know about this. On CentOS-- lrwxrwxrwx. 1 root root 4 Apr 5 10:31 /bin/sh -> bash* Can you state the reasons you say do not use bash so I can google about them?