stalwartlabs / mail-server

Secure & Modern All-in-One Mail Server (IMAP, JMAP, POP3, SMTP)
https://stalw.art
4.61k stars 177 forks source link

[enhancement]: Multiple paths in filesystem blob storage #646

Open andrenth opened 1 month ago

andrenth commented 1 month ago

Which feature or improvement would you like to request?

I'd like to see this feature: being able to specify multiple blob storage paths when using the filesystem backend.

Is your feature request related to a problem?

I'm having a problem with migrating my current Dovecot servers to Stalwart.

We have servers configured with multiple local disks used to store email data. In Dovecot, this works because there is a per-user mail_location setting which contains paths to the email and index data. We have an allocation system that ensures the usage of the multiple disks will be more or less even.

To put it more concretely, we set the mail_location according to this pattern: sdbox:/var/spool/imap/<disk>/<hash>/<account>, where <disk> is filled by the allocation system in order to ensure even account distribution.

I have thought about using the depth setting for that, by mounting each disk's filesystem in the directory corresponding to the first subdirectory "level", but there would need to be a setting that controls how many subdirectories are created, so that I could match it to the number of disks on each server.

This is the only feature blocking a migration to Stalwart for me.

Code of Conduct

mdecimus commented 1 month ago

You could create symlinks from the hashes to the available disks in your server.

andrenth commented 1 month ago

This can work but it's somewhat unsatisfying if the number of hash directories is not divisible by the number of disks.