Menu

can't create mailbox when quota is not filled in

jan kruis
2020-03-15
2020-03-16
  • jan kruis

    jan kruis - 2020-03-15

    Hey,

    I have found the following problem.

    If the field 'mailbox quota' table 'domain' is set to the value 0 (= unlimited) for a domain and I want to create a new mailbox for that domain and do not enter the field of the quota for that mailbox with a value, then I got the error that the mailbox cannot be created. However, an alias with that name is created for the domain.
    In the previous version of postfixadmin, the value 0 (= unlimited) was entered in the "quota" table "mailbox" of the database (if no value was entered).
    This does not happen now, see also the error message that the web server (in my case apache2) makes.

    [php7: notice]… Invalid query: SQLSTATE [HY000]: General error: 1366 Incorrect integer value: '' for column 'quota' at row 1 caused by INSERT INTO mailbox (username
    , local_part, domain, maildir, password, name, quota, active, phone, email_other, token, token_validity, created, modified, password_expiry) VALUES (: username,: local_part,: domain,: maildir,: password,: name ,: quota,: active,: phone,: email_other,: token,: token
    _validity, now (), now () ,: password_expiry), referer: http: //x.x.x.x/pfa/edit.php? table = mailbox

    If I enter the value 0 in the quota field when creating the mailbox for the domain, everything works fine.

    I think there should be a check.

    If the value of 'quota' in the table 'domain' is equal to 0, no value is entered in the quota field when creating a mailbox for that domain, then the value for 'quota' in the table 'mailbox' must be set to 0 are set.

    This problem was not present with the previous version.

    I tested the latest git version of postfixadmin (03/14/2020).

     
  • J.Kruis

    J.Kruis - 2020-03-16

    An addition.

    If I have entered the value 0 in the 'quota' field for the mailbox
    is the message with the virtual overview "Unlimited". However, if you want to adjust in the mailbox, the mailbox quota is set to -1 (disable)
    I think this is due to either the '30f97c9' model / MailboxHandler.php or the 'fefe3f7' model / DomainHandler.php customization

    a note regarding issus # 299

    By using a config.local.php file and making your changes in it, you can avoid missing new changes (perhaps necessary) in the config, inc.php.

    mv config.inc.php config.local.php

    remove this from your config.local.php (at the end of the file)
    .....
    // If you want to keep most settings at default values ​​and / or want to ensure
    // that future updates work without problems, you can use a separate config
    // file (config.local.php) instead of editing this file and override some
    // settings there.
    if (file_exists (dirname ( FILE). '/config.local.php')) {
    require_once (dirname ( FILE). '/config.local.php');
    }
    .....

    and get the latest config.inc.php (git pull)

     

Log in to post a comment.

MongoDB Logo MongoDB