Dovecot Quota = 2GB

  • Hey Guys,


    running i-MSCP trunk on a Server now. :D
    I use dovecot and want to set a quota higher than 2GB.
    So i change the value an the DB for the user but everytime when i save the record it is max. 2147483647 ?


    Any suggestions ?


    Thanks & Greez
    BeNe

  • Seems that the table definition


    `quota` int(10) default '10485760',


    makes a signed INT type going from -2G till +2G


    changing to unsigned will lift the limit to 4GB but I think it rather should be an unsigned BIGINT - so we can set till 18446744073709551615 Bytes...
    = 18446744TB = around 18 Exa Bytes... ???
    (should be enough... :-)


    /Joxi

    Edited once, last by joximu ().

  • Or you can modify /etc/dovecot-sql.conf
    changing

    Code
    1. CONCAT('*:bytes=', `quota` , 'B') AS 'userdb_quota_rule'


    in

    Code
    1. [code]CONCAT('*:bytes=', `quota` * 2, 'B') AS 'userdb_quota_rule'

    [/code] to have 2*2 GB and so on :)
    Time to ask, what limit you think is needed as default?

    Edited once, last by oldev01 ().

  • a creative solution... :-) maybe it's enough to set Megabytes instead of Bytes - so

    Code
    1. CONCAT('*:bytes=', `quota` * 1024*1024, 'B') AS 'userdb_quota_rule'


    is maybe ok... the limit then is 2 PetaBytes... - or 4PB if you change to unsigned INT



    Default - my opinion:
    Default limit should be configurable via hostingplan...


    The POP users do not need more than some hundrets of MB, the IMAP people often need >10GB...


    /Joxi

  • Quote

    CONCAT('*:bytes=', `quota` * 1024*1024, 'B') AS 'userdb_quota_rule'


    Have you noticed the 'B' in here? I think we could safely change this to 'M' (meaning that we could specify quotas from -2TB to 2TB with int, 0-4TB with biging). More than enough and no ugly quota*1024 hacks...

  • Good idea killburn


    but wrong math afterwards... :-)


    int = -2*1024*1024*1024 .. +2*1024*1024*1024, so -2G ..+2G
    or in decimal: -2*10^9 .. +2*10^9


    with MB (= 10^6B) instead of B it's from -2 * 10^15 .. +2*10^15 which is -2Petabyte .. +2Petabyte


    and with unsigned it's 0 .. 4Petabytes.... - which should be enough for mails... :-)



    /J


    PS: we do not speak about mysql bigint... this would be toooo much...

  • I must have been drunk or something when I wrote that XD. First, you're totally right in that I made the calculation using Kb's instead of Mb's (which was my proposal of unit to use). Second, I wanted to refer to "unsigned int", not "big int" in the last part :S

  • God: when I see


    Code
    1. int = -2*1024*1024*1024 .. +2*1024*1024*1024, so -2G ..+2G
    2. or in decimal: -2*10^9 .. +2*10^9


    I think really that I must return at school.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • God: when I see


    Code
    1. int = -2*1024*1024*1024 .. +2*1024*1024*1024, so -2G ..+2G
    2. or in decimal: -2*10^9 .. +2*10^9


    I think really that I must return at school.


    no need for school - you are member in the i-mscp forum :D