I modified the table, but that didn't change anything. What did was by removing any negated members from the policy. If the policy has just the single $* member, the counters work fine. As soon as I add a member like !%my-group, the counters start coming up NULL.

-charles


On 03/20/2014 01:09 AM, Urban Loesch wrote:
Hi,

I had the same problem. I changed the type of "Counter" to "decimal(10,4) and the default 
value to "0.000".

Like below:
+----------------+---------------------+------+-----+---------+-------+
| Field          | Type                | Null | Key | Default | Extra |
+----------------+---------------------+------+-----+---------+-------+
| QuotasLimitsID | bigint(20) unsigned | YES  | MUL | NULL    |       |
| TrackKey       | varchar(512)        | YES  |     | NULL    |       |
| LastUpdate     | bigint(20) unsigned | YES  | MUL | NULL    |       |
| Counter        | decimal(10,4)       | YES  |     | 0.0000  |       |
+----------------+---------------------+------+-----+---------+-------+

And the errors are gone.

Regards
Urban



Am 18.03.2014 22:04, schrieb charles:
Howdy,

I'm trying to set up cluebringer v2.0.14-1 to do quotas on a mail server that's 
outgoing mail only.  I think I have the policies set up correctly, but
I'm getting a lot of NULL values in the Counter column of quotas_tracking, which is 
causing arithmetic errors in the log ("Use of uninitialized
value...").  Deleting the NULL entries doesn't appear to change anything.

Note also that a previously numeric value occasionally changes to NULL.


Configurations and tables follow.

Names, Domains, and IP information has been removed to protect the innocent.

cluebringer.conf :

[server]
protocols=<<EOT
Postfix
Bizanga
EOT

modules=<<EOT
Core
AccessControl
CheckHelo
CheckSPF
Greylisting
Quotas
EOT

min_servers=4
min_spare_servers=4
max_spare_servers=12
max_servers=25
max_requests=1000

log_level=4
log_mail=maillog

[database]
DSN=DBI:mysql:database=policyd;host=localhost
Username=USERNAME
Password=PASSWORD

bypass_mode=pass
bypass_timeout=30

[AccessControl]
enable=0

[Greylisting]
enable=0

[CheckHelo]
enable=0

[CheckSPF]
enable=0

[Quotas]
enable=1

---------------------------------------

mysql> select * from policies;
+----+------------+----------+-----------------------+----------+
| ID | Name       | Priority | Description           | Disabled |
+----+------------+----------+-----------------------+----------+
|  1 | Default    |        0 | Default System Policy |        1 |
|  7 | SASL users |       10 | SASL users            |        0 |
+----+------------+----------+-----------------------+----------+

mysql> select * from policy_group_members;
+----+---------------+----------------------+----------+---------+
| ID | PolicyGroupID | Member               | Disabled | Comment |
+----+---------------+----------------------+----------+---------+
|  1 |             1 | 10.0.0.0/8           |        0 | NULL    |
|  2 |             2 | @domain1.com         |        0 | NULL    |
|  3 |             2 | @domain2.com         |        0 | NULL    |
|  4 |             1 | 199.99.193.38        |        0 |         |
|  6 |             1 | 127.0.0.1            |        0 |         |
|  8 |             4 | 199.99.192.0/19      |        0 |         |
|  9 |             3 | dia...@domain1.com   |        0 |         |
| 10 |             3 | $zen-notes           |        0 |         |
| 11 |             2 | @domain3.com         |        0 |         |
| 12 |             2 | @domain4.net         |        0 |         |
| 13 |             1 | 199.99.193.57        |        0 |         |
| 14 |             4 | 2608:3600::/32       |        1 |         |
| 15 |             3 | $hanrahan            |        0 |         |
+----+---------------+----------------------+----------+---------+

mysql> select * from policy_members;
+----+----------+---------------+-------------+---------+----------+
| ID | PolicyID | Source        | Destination | Comment | Disabled |
+----+----------+---------------+-------------+---------+----------+
|  1 |        1 | NULL          | NULL        | NULL    |        0 |
|  8 |        7 | $*            | any         |         |        0 |
|  9 |        7 | !%hi-vol-sasl | any         |         |        0 |
| 10 |        7 | !%My_Network  | any         |         |        0 |
| 15 |        7 | !$-           | any         | any     |        0 |
+----+----------+---------------+-------------+---------+----------+

mysql> select * from policy_groups;
+----+------------------+----------+---------+
| ID | Name             | Disabled | Comment |
+----+------------------+----------+---------+
|  1 | internal_ips     |        0 | NULL    |
|  2 | internal_domains |        0 | NULL    |
|  3 | hi-vol-sasl      |        0 |         |
|  4 | My_Network       |        0 |         |
+----+------------------+----------+---------+

mysql> select * from quotas;
+----+----------+---------------------------+--------------+--------+---------+------+-------------------------------------------------------+----------+
| ID | PolicyID | Name                      | Track        | Period | Verdict | 
Data | Comment                                               | Disabled |
+----+----------+---------------------------+--------------+--------+---------+------+-------------------------------------------------------+----------+
|  3 |        7 | SASL Sending Restrictions | SASLUsername |   3600 | REJECT  | 
300  | Limit outgoing mail per sasl_username to 300 per hour |        0 |
+----+----------+---------------------------+--------------+--------+---------+------+-------------------------------------------------------+----------+

mysql> select * from quotas_tracking;
+----------------+-------------------------------------+------------+---------+
| QuotasLimitsID | TrackKey                            | LastUpdate | Counter |
+----------------+-------------------------------------+------------+---------+
|              4 | SASLUsername:                       | 1395171854 | 6.8409 |
|              4 | SASLUsername:c...@greaterhisiom.com | 1395171616 | 1.0000 |
|              4 | SASLUsername:mpomeroy               | 1395171673 | 1.0000 |
|              4 | SASLUsername:pathansen              | 1395171675 | 1.0000 |
|              4 | SASLUsername:shbats                 | 1395171952 |  NULL |
|              4 | SASLUsername:madreiya               | 1395171686 | 1.0000 |
|              4 | SASLUsername:cheetahs               | 1395171688 | 1.0000 |
|              4 | SASLUsername:cinem...@domain2.com   | 1395171768 | 1.0000 |
|              4 | SASLUsername:jcw                    | 1395171713 | 1.0000 |
|              4 | SASLUsername:kps                    | 1395171718 | 1.0000 |
|              4 | SASLUsername:pemor...@domain2.com   | 1395171777 | 1.0000 |
|              4 | SASLUsername:li...@domain3.com      | 1395171789 |  NULL |
|              4 | SASLUsername:kcwhitaker             | 1395171840 |  NULL |
|              4 | SASLUsername:aauser                 | 1395171819 |  NULL |
|              4 | SASLUsername:deana                  | 1395171829 |  NULL |

--------------

/var/log/cbpolicyd.log:

[2014/03/18-12:38:14 - 19489] [CORE] NOTICE: Process Backgrounded
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] NOTICE: Policyd v2 / Cluebringer - 
v2.0.14-1
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] NOTICE: Initializing system modules.
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] NOTICE: System modules initialized.
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] NOTICE: Module load started...
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => AccessControl: enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => CheckHelo: enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => CheckSPF: enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => Greylisting: enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => Quotas: enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => Protocol(Postfix): enabled
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE:   => Protocol(Bizanga): enabled
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] NOTICE: Module load done.
[2014/03/18-12:38:14 - 19489] [CBPOLICYD] DEBUG: Opening syslog, destination = 
'unix', facility = 'mail'.
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE: 2014/03/18-12:38:14 cbp (type 
Net::Server::PreFork) starting! pid(19489)
[2014/03/18-12:38:14 - 19489] [CORE] NOTICE: Binding to TCP port 10031 on host *
[2014/03/18-12:38:14 - 19489] [CORE] WARNING: Group Not Defined. Defaulting to 
EGID '5002 5002'
[2014/03/18-12:38:14 - 19489] [CORE] INFO: Setting up serialization via flock
[2014/03/18-12:38:14 - 19489] [CORE] INFO: Beginning prefork (4 processes)
[2014/03/18-12:38:14 - 19489] [CORE] INFO: Starting "4" children
[2014/03/18-12:38:14 - 19490] [CORE] DEBUG: Child Preforked (19490)
[2014/03/18-12:38:14 - 19490] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:38:14 - 19491] [CORE] DEBUG: Child Preforked (19491)
[2014/03/18-12:38:14 - 19491] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:38:14 - 19492] [CORE] DEBUG: Child Preforked (19492)
[2014/03/18-12:38:14 - 19492] [CORE] DEBUG: Child Preforked (19492)
[2014/03/18-12:38:14 - 19492] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:38:14 - 19489] [CORE] DEBUG: Parent ready for children.
[2014/03/18-12:38:14 - 19493] [CORE] DEBUG: Child Preforked (19493)
[2014/03/18-12:38:14 - 19493] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:39:40 - 19489] [CORE] INFO: Starting "1" children
[2014/03/18-12:39:40 - 19490] [CORE] INFO: 2014/03/18-12:39:40 CONNECT TCP Peer: 
"127.0.0.1:59558" Local: "127.0.0.1:10031"
[2014/03/18-12:39:40 - 20440] [CORE] DEBUG: Child Preforked (20440)
[2014/03/18-12:39:40 - 20440] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:39:40 - 19490] [CBPOLICYD] INFO: Got request #1
[2014/03/18-12:39:40 - 19490] [CBPOLICYD] INFO: Got request #2 (pipelined)
[2014/03/18-12:40:08 - 19491] [CORE] INFO: 2014/03/18-12:40:08 CONNECT TCP Peer: 
"127.0.0.1:59560" Local: "127.0.0.1:10031"
[2014/03/18-12:40:08 - 19489] [CORE] INFO: Starting "1" children
[2014/03/18-12:40:08 - 20679] [CORE] DEBUG: Child Preforked (20679)
[2014/03/18-12:40:08 - 20679] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:40:08 - 19491] [CBPOLICYD] INFO: Got request #1
[2014/03/18-12:40:09 - 19491] [CBPOLICYD] INFO: Got request #2 (pipelined)
[2014/03/18-12:40:10 - 20440] [CORE] INFO: 2014/03/18-12:40:10 CONNECT TCP Peer: 
"127.0.0.1:59563" Local: "127.0.0.1:10031"
[2014/03/18-12:40:10 - 19489] [CORE] INFO: Starting "1" children
[2014/03/18-12:40:10 - 20713] [CORE] DEBUG: Child Preforked (20713)
[2014/03/18-12:40:10 - 20713] [CBPOLICYD] DEBUG: Starting up caching engine
[2014/03/18-12:40:11 - 20440] [CBPOLICYD] INFO: Got request #1
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
[2014/03/18-12:40:12 - 20440] [CBPOLICYD] INFO: Got request #2 (pipelined)
[2014/03/18-12:40:12 - 20440] [CBPOLICYD] INFO: Got request #3 (pipelined)
Use of uninitialized value in multiplication (*) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 177, <_READ> line 1.
Use of uninitialized value in subtraction (-) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 182, <_READ> line 1.
Use of uninitialized value in multiplication (*) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 177, <_READ> line 1.
Use of uninitialized value in multiplication (*) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 177, <_READ> line 1.
Use of uninitialized value in multiplication (*) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 177, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 310, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.
Use of uninitialized value in addition (+) at 
/usr/local/lib/policyd-2.0/cbp/modules/Quotas.pm line 253, <_READ> line 1.

<snipped... you get the idea>

-----------------------------

'/var/log/mail.log |grep cbpolicyd' for single user:

Mar 18 12:43:40 white cbpolicyd[20679]: module=Quotas, mode=create, 
host=50.39.227.43, helo=aauser, from=aau...@domain2.com, to=seven...@yahoo.com,
reason=quota_create, policy=7, quota=3, limit=4, track=SASLUsername:aauser, 
counter=MessageCount, quota=4.00/300 (1.3%)
Mar 18 12:43:40 white cbpolicyd[20679]: module=Quotas, mode=update, 
host=50.39.227.43, helo=aauser, from=aau...@domain2.com, to=seven...@yahoo.com,
reason=quota_update, policy=7, quota=3, limit=4, track=SASLUsername:aauser, 
counter=MessageCount, quota=0.00/300 (0.0%)
Mar 18 12:43:40 white cbpolicyd[20679]: module=Quotas, mode=update, 
host=50.39.227.43, helo=aauser, from=aau...@domain2.com, to=seven...@yahoo.com,
reason=quota_update, policy=7, quota=3, limit=4, track=SASLUsername:aauser, 
counter=MessageCount, quota=0.00/300 (0.0%)
Mar 18 12:43:40 white cbpolicyd[20679]: module=Quotas, mode=update, 
host=50.39.227.43, helo=aauser, from=aau...@domain2.com, to=seven...@yahoo.com,
reason=quota_update, policy=7, quota=3, limit=4, track=SASLUsername:aauser, 
counter=MessageCount, quota=0.00/300 (0.0%)



_______________________________________________
Users mailing list
Users@lists.policyd.org
http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org


_______________________________________________
Users mailing list
Users@lists.policyd.org
http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org


_______________________________________________
Users mailing list
Users@lists.policyd.org
http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org

Reply via email to