[GH-ISSUE #282] mailbox.cli-get-sizes [Unknown Mail Size] #229

Closed
opened 2026-02-26 09:36:55 +03:00 by kerem · 1 comment
Owner

Originally created by @jdsampayo on GitHub (Jun 14, 2021).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/282

Problem

I turned on the mail size:

defaults.list_size.disabled = false

on /usr/local/vimbadmin/application/configs/application.ini but was not getting any size on the frontend:

Screen Shot 2021-06-14 at 7 43 52

Debug

Then executed manually:

sudo ./vimbtool.php -d -a mailbox.cli-get-sizes
Module:
Controller: mailbox
Action:     cli-get-sizes

Processing mydomain.com...
    - user@mydomain.com [Unknown Mail Size]

Added an echo for the unknown on:

/usr/local/vimbadmin/application/controllers/MailboxController.php

$msize = OSS_DiskUtils::du( $mailbox->getCleanedMaildir() );

And got that getCleanedMaildir() was returning:

/srv/vmail/mydomain.com/user/mail

I checked /etc/dovecot/conf.d/10-mail.conf and got:

mail_location = maildir:/var/vmail/%d/%n

My email dir is: /var/vmail/mydomain.com/user

Solution

Then changed it on application.ini:

defaults.mailbox.maildir = "maildir:/var/vmail/%d/%u:LAYOUT=fs"
defaults.mailbox.homedir = "/var/vmail/"

Then logged in MySQL:

mysql vimbadmin -u vimbadmin -p

And executed:

mysql> select maildir from mailbox;
+---------------------------------------------------------------------+
| maildir                                                             |
+---------------------------------------------------------------------+
| maildir:/srv/vmail/mydomain.com/user/mail:LAYOUT=fs                 |
...

mysql> UPDATE mailbox SET maildir = REPLACE(maildir, '/srv/', '/var/');
mysql> UPDATE mailbox SET maildir = REPLACE(maildir, '/mail', '');

mysql> select maildir from mailbox;
+---------------------------------------------------------------------+
| maildir                                                             |
+---------------------------------------------------------------------+
| maildir:/var/vmail/mydomain.com/user:LAYOUT=fs                      |
...

Executed again:

sudo ./vimbtool.php -d -a mailbox.cli-get-sizes
Module:
Controller: mailbox
Action:     cli-get-sizes

Processing mydomain.com...
    - user@mydomain.com [Mail Size: 1306624] [Home Size: 3230674944]

Restarted sudo service php-fpm restart and was now getting the value on the front:

Screen Shot 2021-06-14 at 8 01 41 Screen Shot 2021-06-14 at 8 02 12

Conclusion

I hope this helps someone to double check all the config about your data directories and would be nice that in the future ViMbAdmin displayed a message like "Can't find directory [dir], check your configuration".

Regards.

Originally created by @jdsampayo on GitHub (Jun 14, 2021). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/282 ### Problem I turned on the mail size: ``` defaults.list_size.disabled = false ``` on `/usr/local/vimbadmin/application/configs/application.ini` but was not getting any size on the frontend: <img width="1065" alt="Screen Shot 2021-06-14 at 7 43 52" src="https://user-images.githubusercontent.com/1060579/121894053-4bb9a700-cce4-11eb-84c8-2379cb3b6a72.png"> ### Debug Then executed manually: ``` sudo ./vimbtool.php -d -a mailbox.cli-get-sizes Module: Controller: mailbox Action: cli-get-sizes Processing mydomain.com... - user@mydomain.com [Unknown Mail Size] ``` Added an echo for the unknown on: ``` /usr/local/vimbadmin/application/controllers/MailboxController.php $msize = OSS_DiskUtils::du( $mailbox->getCleanedMaildir() ); ``` And got that `getCleanedMaildir()` was returning: `/srv/vmail/mydomain.com/user/mail` I checked `/etc/dovecot/conf.d/10-mail.conf` and got: ``` mail_location = maildir:/var/vmail/%d/%n ``` **My email dir is:** `/var/vmail/mydomain.com/user` ### Solution Then changed it on `application.ini`: ``` defaults.mailbox.maildir = "maildir:/var/vmail/%d/%u:LAYOUT=fs" defaults.mailbox.homedir = "/var/vmail/" ``` Then logged in MySQL: ``` mysql vimbadmin -u vimbadmin -p ``` And executed: ``` mysql> select maildir from mailbox; +---------------------------------------------------------------------+ | maildir | +---------------------------------------------------------------------+ | maildir:/srv/vmail/mydomain.com/user/mail:LAYOUT=fs | ... mysql> UPDATE mailbox SET maildir = REPLACE(maildir, '/srv/', '/var/'); mysql> UPDATE mailbox SET maildir = REPLACE(maildir, '/mail', ''); mysql> select maildir from mailbox; +---------------------------------------------------------------------+ | maildir | +---------------------------------------------------------------------+ | maildir:/var/vmail/mydomain.com/user:LAYOUT=fs | ... ``` Executed again: ``` sudo ./vimbtool.php -d -a mailbox.cli-get-sizes Module: Controller: mailbox Action: cli-get-sizes Processing mydomain.com... - user@mydomain.com [Mail Size: 1306624] [Home Size: 3230674944] ``` Restarted `sudo service php-fpm restart` and was now getting the value on the front: <img width="1056" alt="Screen Shot 2021-06-14 at 8 01 41" src="https://user-images.githubusercontent.com/1060579/121896414-e1eecc80-cce6-11eb-9f61-11ae1b4d43b4.png"> <img width="562" alt="Screen Shot 2021-06-14 at 8 02 12" src="https://user-images.githubusercontent.com/1060579/121896418-e31ff980-cce6-11eb-80c6-b9809a8b2cb8.png"> ### Conclusion I hope this helps someone to double check all the config about your data directories and would be nice that in the future ViMbAdmin displayed a message like "Can't find directory [dir], check your configuration". Regards.
kerem closed this issue 2026-02-26 09:36:56 +03:00
Author
Owner

@barryo commented on GitHub (Apr 1, 2022):

Thanks for that - should be super helpful to anyone searching for this.

<!-- gh-comment-id:1086282634 --> @barryo commented on GitHub (Apr 1, 2022): Thanks for that - should be super helpful to anyone searching for this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#229
No description provided.