<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5">
</HEAD>
<BODY>
Hello Kapetanakis.<BR>
<BR>
Thanks for your interest. I haven't had enough time to look at the<BR>
change you propose and the state of mod-mquota, but my initial review<BR>
is that the module will require the following work:<BR>
<BR>
- Add support for SQL (currently all quota configuration is done<BR>
through /etc/valvula/valvula.conf, <default-sending-quota> tag).<BR>
<BR>
- This means that before adding multi database SQL access, first is<BR>
required a general module update to have SQL configurations located at<BR>
a MySQL database.<BR>
<BR>
- Because of that, maybe a more generic approach can be implemented at<BR>
the very beginning, with a single database. That will improve a lot<BR>
usability for a system administrator (having several databases or<BR>
tables for the same thing is problematic).<BR>
<BR>
- After that, a general update to mod-mquota must be applied because<BR>
current period selection is global (see __mod_mquota_current_period).<BR>
That will require rewriting it to make it support domain/user period storage<BR>
(adding, possibly one or two hashes) and then, updating the rest of the<BR>
module where this is used (I've seen a couple of places that will<BR>
require a bit of work).<BR>
<BR>
- Apart from that, module update **must** support previous<BR>
configuration so old installations keep working without any issue, so<BR>
users that want MySQL support for this module, and hence user/domain<BR>
level selection, can opt-in.<BR>
<BR>
- Once finished, a full regression test is required to ensure it works<BR>
with global, domain and user limits, but also to check valgrind is fine<BR>
with it.<BR>
<BR>
A bit work :-) <BR>
<BR>
Please, before investing your time, if you attempt to make this change<BR>
for it to be included into valvula's official repo, we will need a CLA.<BR>
If you are interested, please, let me know so I can request it.<BR>
<BR>
Best Regards.<BR>
<BR>
<BR>
El lun, 26-03-2018 a las 14:30 +0300, Kapetanakis Giannis escribió:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I was wondering if the following change (not yet done) is interesting to your project.

Right now mod-mquota uses same limits for all domains.

I think it might be easy to make a change and add separate sql configuration per domain or even per user (in a domain).

I'm not talking about domain limits (all users) but specific user limits per domain or per user.

<A HREF="mailto:user1@domain1.com">user1@domain1.com</A>: minute-limit=2, hour-limit=10, global-limit=100, etc
domain1.com: minute-limit=10, hour-limit=100, global-limit=1000, etc
domain2.com: minute-limit=20, hour-limit=200, global-limit=2000, etc

the plugin will check in a specific db table if the following exists:

a) check for user specific limits: <A HREF="mailto:db_sasl_user='user1@domain1.com">db_sasl_user='user1@domain1.com</A>' -> return limits
b) check for global domain limits: <A HREF="mailto:db_sasl_user='%GLOBAL%@domain1.com">db_sasl_user='%GLOBAL%@domain1.com</A>' -> return limits
c) if nothing is found use default limits from config file

In advance the db limits can use the same label as in <limit label=/> to differentiate limits per time of day as in config.

If you agree on this I might find some time to do it since I need it in my setup.

Regards,

Giannis
_______________________________________________
Valvula mailing list
<A HREF="mailto:Valvula@lists.aspl.es">Valvula@lists.aspl.es</A>
<A HREF="http://lists.aspl.es/cgi-bin/mailman/listinfo/valvula">http://lists.aspl.es/cgi-bin/mailman/listinfo/valvula</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Francis Brosnan Blázquez  -  ASPL
http://www.asplhosting.com/
http://www.aspl.es/
https://twitter.com/aspl_es
https://twitter.com/asplhosting
https://twitter.com/francisbrosnanb
https://es.linkedin.com/in/francis-brosnan-blázquez-1353a218

91 134 14 22 - 91 134 14 45 - 91 116 07 57
Av. Juan Carlos I 13, 2ºC, Torre Garena
28806 - Alcalá de Henares (España)

AVISO LEGAL
 
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL).
 
ASPL garantiza que los datos serán tratados con la finalidad de mantener
las oportunas relaciones comerciales o promocionales con usted o la
entidad que usted representa. No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y oposición dispuestos en
la mencionada Ley Orgánica, notificándolo por escrito a ASPL -
Protección Datos, Av. Juan Carlos I 13, 2ºC, Alcalá de Henares
(Madrid).
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>