Mailboxes storage location and quota

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

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

Both are beyond the scope of this project.

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.

Thanks Josh, that is good to know.

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

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.

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!

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.

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.

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.

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

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

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

To answer your question the setup instructions are now showing on to do that:

Do keep in mind that this thread is over 2 years old. :open_mouth:

1 Like

Yes, I know but I wanted to post an answer so if someone else than me read this now it’s clear and less research for that person.

2 Likes

This doesn’t entirely work as /mnt/temp is left dangling.

At one point you simply created a new empty user-data directory and mounted it.

So delete it.

With the external storage, which was the entire point of this comment.

So what was the point of copying user-data to user-data.old

Is not the point of this to expand storage for existing mail users and to move it external ?

To move the directory out of the way so that the external storage device could be mounted at /home/user-data/

And it was not copied, it was moved.