Skip to content

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

@jdsampayo

Description

@jdsampayo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions