Set default mailbox size.

Discussion in 'General' started by ozgurerdogan, Feb 20, 2020.

  1. ozgurerdogan

    ozgurerdogan Member

    I edited following file to set default mailbox size in ui:
    /usr/local/ispconfig/interface/web/mail/form/mail_user.tform.php

    Code:
            'quota' => array (
                'datatype' => 'VARCHAR',
                'formtype' => 'TEXT',
                'validators' => array (  1 => array ( 'type' => 'ISINT',
                        'errmsg'=> 'quota_error_isint'),
                    0 => array ( 'type' => 'REGEX',
                        'regex' => '/^([0-9]{1,})$/',
                        'errmsg'=> 'quota_error_value'),
                ),
                'default' => '1024',   UPDATED THIS FIELD
                'value'  => '',
                'width'  => '30',
                'maxlength' => '255'
            ),
    but web ui still shows as 0. Is there a web cache that I must clear at server?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That limit can be set in ISPConfig panel. Read the ISPConfig Manual chapter 4.5.1.3 Edit Limit-Templates.
     
  3. ozgurerdogan

    ozgurerdogan Member

    Again it is not answer of my question. I want to change "DEFAULT VALUE" in Mailbox quota field when creating a new mail account. If I do that ISPConfig Manual chapter 4.5.1.3, it sets all quotas to that value.
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you sure of this? I have always thought the template has default values used when a new client is created. Changing the template does not change limits for existing clients.
    Anyway, it can not be all quotas, since there can be many templates and a client can be assigned to one of them or to no template at all.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You can do this by changing the defaults value in your DB (dbispconfig -> mail_user -> quota) with PHPMyAdmin for example.
     
  6. ozgurerdogan

    ozgurerdogan Member

    dbispconfig -> mail_user -> quota, Can not believe it did not work either, when creating mail field still shows 0. Something presence it.
     
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You have to set it under the structure tab, as default field.
     
  8. ozgurerdogan

    ozgurerdogan Member

    Yes I did so already. One thing I noticed, default dafault value was -1 but in UI it is 0. So even I set it like 1024, in ui it still shows 0.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The general rule is:

    - Default values for the first tab of a form get set inside the form file (unless it's a value that needs to be computed somehow). If you changed the form file and it remains at 0, then
    - Default values on other tabs can be set in the MySQL database on the structure tab.

    And recording difference 0 and -1: ISPCOnfig uses -1 as value for unlimited and we try to do so consistently in the UI. But some services that connect to ISPConfig have a different meaning for values, this means that ISPConfig has to convert a value between the Ui and the DB. The quota value for email is such a value if I remember correctly. Unlimited in the mail system (dovecot) is 0, and ISPConfig might display this for consistency reasons as -1. But you have to read the whole source of the mail_user form if you want to check this.
     
    Th0m likes this.
  10. ozgurerdogan

    ozgurerdogan Member

    Email creation form is first tab but as I stated at first post, /usr/local/ispconfig/interface/web/mail/form/mail_user.tform.php file is not changing default value with change of 'default' => '1024', UPDATED THIS FIELD. Is there a cache or temp files I need to clear on server ?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    It might be that the quota value is computed then as it gets calculated based on the client and reseller quotas.
     
  12. ozgurerdogan

    ozgurerdogan Member

    No it is not. What should I check for that?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you read through the whole ISPConfig mail code and plugins? I've written that code years ago so I don't remember exactly, but it is very likely that this value gets computed.
     
  14. ozgurerdogan

    ozgurerdogan Member

    Ok I will look in deep thank you.
     
  15. 1337isp

    1337isp New Member

    Did you solve the issue ?
    I'm unable to put quota through api for mailbox creation.

    If i put :
    'quota' => '30', (for 30MB)
    it set 2.8610229492188E-5 in ISPCONFIG

    In api docs it shows this : quota (bigint(20))
    I'm pretty stuck with this

    Anyone have a solution ?

    Regards
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    No, 30 = 30 bytes, a bit small for a mailbox.
     

Share This Page