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-.2...
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-.2...
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: the over-quota ones
- 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
- 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: the over-quota ones
- 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
- Let a bounce message go out in this case, as necessary
I don't know how it's done with postfix, anyway...
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?
Can anyone confirm this is true?
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?
Can anyone confirm this is true?
I don't want to speak in the name of others, but I think that quota-status doesn't fit in the Dovecot "world". It contradicts the tenet of "Dovecot don't have to know about email addresses", because Postfix sends email addresses with Policy-requests. And yes, you can make it work somehow even if your mailbox names are not email addresses, but IMHO it won't be as fast (or as secure) as a db query by Postfix.
Peter
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-.2...
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?
On 04/16/2015 09:09 PM, E.B. wrote:
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?
Some random links..
https://wiki.ubuntu.com/DashAsBinSh https://lwn.net/Articles/343924/ http://www.cyberciti.biz/faq/debian-ubuntu-linux-binbash-vs-bindash-vs-binsh...
My summary:
I use Debian. dash is actually a Debian-specific creation. The problem with bash is that it's feature-rich and therefore slow to start and slow to execute. For non-interactive scripts, things like tab-completion or command history are not needed of course. Less-than-bash shells however also do not support more advanced bash syntax.
http://mywiki.wooledge.org/Bashism
/usr/bin/mysql is of course 3 times bigger than /bin/bash and for that matter is also guilty of being unnecessarily friendly to interactive users (via libreadline) ;-)
So I did a very crude test and putting a 'echo select 1 | mysql' in a #!/bin/bash script is only ~20% slower than using #!/bin/sh (which is dash in my case). Oh and it looks like mysql -e blah is a bit faster under bash, but not under dash.
I guess the differences are more meaningful when we're talking about more than (hardly even) one line of shell code.
participants (3)
-
E.B.
-
Gedalya
-
Péter Márton