Mailboxes storage location and quota


#1

Hi There,

I would like to have the mailboxes database stored in a different Linux volume.

Where can I configure the new folder to point to a second mounted volume?

Also regarding storage, is it possible setting up maximum storage quota per mailbox? and what would be a rule of thumb for total storage size assuming XX mailboxes of around 20 to 50 GB?

Please advice.

Thanks


#2

MiaB does not support quota’s nor is it customizable wrt storage location.

Both are beyond the scope of this project.


#3

Actually the storage location is configurable by setting the STORAGE_ROOT environment variable to an alternate path before running Mail-in-a-Box’s setup.


#4

Thanks Josh, that is good to know.


#5

Hi Josh,
Thanks for the clarification.

I installed MIAB in a AWS server using the provided installation so I wasn’t able to define my own path for the mails folder. Could you please clarify how should I get access to the env variable during the installation or if I could do a manual installation. If so how.
Thanks


#6

No doubt an answer from @JoshData will be the way to follow but alternatively (meantime) you could try to copy the folder /home/user-data, keeping the default owner(s) & permissions of each folder & file inside to your custom location and then, create a symlink as /home/user-data politing it to your custom location to ‘symlink’ the default [STORAGE_ROOT] :

ln -s [DESTINATION_PATH] [ORIGIN_PATH] :

ln -s /your/custom/path/location/user-data /home/user-data

Hope this helps.


#7

Linking should work, but when dealing with cloud servers you can also just mount your storage in the right place. For instance on Linode I did something like this:

Become root, so I don’t have to type sudo a million times:

sudo -s

Create a filesystem for an external volume made available by Linode - the device path would be different for other cloud providers.

mkfs.ext4 /dev/disk/by-id/scsi-0Linode_Volume_userdata

Mount the new storage in a temporary location:

mkdir /mnt/temp
mount /dev/disk/by-id/scsi-0Linode_Volume_userdata /mnt/temp

Copy data from current storage to the new. I should say that I did this when no services were running on the machine. If you do this to a fully operational system, you should make sure that all services that work with the data are temporarily stopped.

cd /home/user-data
cp -av * .* /mnt/temp

Fix the top-level permissions of the mounted volume.

chown user-data.user-data /mnt/temp

Now move the old user-data out of the way and mount the new one in its place:

umount /mnt/temp
cd /home
mv user-data user-data.old
mkdir user-data
mount /dev/disk/by-id/scsi-0Linode_Volume_userdata user-data

Add a line to /etc/fstab to auto-mount the volume on reboot:

/dev/disk/by-id/scsi-0Linode_Volume_userdata /home/user-data ext4 defaults,noatime 0 2

And that’s it - now I have all data on the external volume. Can’t hurt to double-check things - permissions, for instance - and then restart services or the whole system. This is quite a standard way of handling things on Unix - nothing specific to MIAB here!


#8

Thank you guys, I appreciate your help.

I have one last question: Can I host more than one email domain in the same server or do I need to create a new server instance for each domain.

If I need a server instance per domain, in the case of several clients that are not too big I would consider using Docker container for that. Any one experienced this already?

Thanks again for your help, it is very much appreciated.


#9

You can host an unlimited number of domains (theoretically). I have found though that once you hit about 12 the admin page does not (seem to) work properly. This is due to a browser time-out while waiting for the status checks to complete.


#10

Thanks Alento for your prompt answer.

For other reders I would say It was rather simple. I just created a user with the second domain in the MIAB server and set up the public DNS MX record for second domain to point to the mail server and that’s it!!

Thanks again for the support.


#11

Thanks! This work fine for me. VPS on OVH with additional disk afther installation of MIAB


#12

With version 0.40 is this still a problem, I wonder? @alento


#13

No idea yet … the install with so many domains has not yet been upgraded.