New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't create mailbox if quota is not filled in #342
Comments
Hi David, however, there is still a problem. I think this is due to either |
should not have closed |
would this fix it (in MailboxHandler) - around line 200. protected function read_from_db_postprocess($db_result) {
foreach ($db_result as $key => $row) {
if (isset($row['quota']) && is_numeric($row['quota']) && $row['quota'] > -1) { # quota could be disabled in $struct
$db_result[$key]['quotabytes'] = $row['quota'];
$db_result[$key]['quota'] = divide_quota($row['quota']); # convert quota to MB
} else {
$db_result[$key]['quotabytes'] = -1;
$db_result[$key]['quota'] = -1;
}
}
return $db_result;
} I'm not sure whether i need the |
hi david, test 2 test 3 But just a question about the functions i will test further with other variations but i feel it will be overwritten later |
quotabytes is meant to be a virtual field (derived from another).... |
replacing if (isset ($ row ['quota']) && is_numeric ($ row ['quota']) && $ row ['quota'] = 0) back to if (isset ($ row ['quota']) ) solves my problem a question |
Sorry David I was not paying attention and did not adapt a piece of code,so that made it seem that the code was not working so your comment above no longer applies |
Sorry; just for the sake of avoiding possible confusion. Is this the correct code ? if (isset($row['quota']) && is_numeric($row['quota']) && $row['quota'] > -1) { |
Yes that is the correct code Thnx |
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).
The text was updated successfully, but these errors were encountered: