1

Topic: Migrate to sdbox and add alt-storage to dovecot

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer?Downloadable installer
- Linux/BSD distribution name and version: CentOS Linux release 7.7.1908 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro?No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I wanted to migrate some maildir accounts to sdbox using dsync and take advantage of Dovecots alt-storage option.
I understand that I need to modify users mailbox location and format in SQL table mailbox
Can anyone tell me the best way to specify the alt-storage path for dovecot in the mailbox table?

Thank you

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Migrate to sdbox and add alt-storage to dovecot

The "vmail.mailbox" table doesn't have a column to store such meta data, you have to update dovecot.conf directly.

3

Re: Migrate to sdbox and add alt-storage to dovecot

jwelstead wrote:

It appears the mails under this directory are being stored as sdbox correctly however the vmail.mailboxfolder sql setting  is being ignored.

Could you please show me the full content of /etc/dovecot/dovecot-mysql.conf? (Remove SQL password before pasting).

4

Re: Migrate to sdbox and add alt-storage to dovecot

Sorry, I had found the error in that file.
It had Maildir hardcoded in the concat statement instead of the mailbox sql field.
I have changed it to:
user_query = SELECT \
            '%u' AS master_user, \
            CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
            CONCAT(mailbox.mailboxformat, ':', mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir, '/', mailbox.mailboxfolder) AS mail, \

If i add a column to mailbox table, "dboxaltstor varchar(50),default NULL"
and only populate it for dbox users like ":ALT=/nfsmnt/%d/%n"
Is it ok to append it to the above statement in order to achieve the alternate storage?
I tried to add it to dovecot.conf but the sql overides the parameter

5

Re: Migrate to sdbox and add alt-storage to dovecot

I did a little testing and it appears to work as long as the altstore field does not contain variables such as "%d or %n"

6

Re: Migrate to sdbox and add alt-storage to dovecot

jwelstead wrote:

I tried to add it to dovecot.conf but the sql overides the parameter

You can add the "ALT=" in dovecot.conf, parameter "mail_location =".

7

Re: Migrate to sdbox and add alt-storage to dovecot

jwelstead wrote:

I did a little testing and it appears to work as long as the altstore field does not contain variables such as "%d or %n"

"%d" and "%n" should be supported by Dovecot. sad
You'd better report this bug to Dovecot team.

8

Re: Migrate to sdbox and add alt-storage to dovecot

Thank you
Coffees are on me!!

9

Re: Migrate to sdbox and add alt-storage to dovecot

jwelstead wrote:

Thank you
Coffees are on me!!

Thank you for the coffee. smile
But did you report this bug to Dovecot mailing list?