burnley
Regular Pleskian
Running 17.5.3 on CentOS 7 and starting from Namespaces - Dovecot Wiki I'm trying to find a way to reliably manage, on the same Plesk server, namespace/inbox/prefix configuration per domain. Why am I trying this? To basically scrap the old, Courier-IMAP artifacts for the new domains, while at the same time preserving the configuration intact for the existing domains. Using "INBOX." as a compatibility name isn't reliable, we don't know how various IMAP clients will react and last thing we want is to deal with support requests caused by this type of configuration. So here's what I did so far to test the mixed namespace configuration:
1. Created an alternate Dovecot configuration in /etc/dovecot-alt and a new systemd service unit that is using this alternate configuration. The new configuration uses different ports for imap, pop3 and sieve and few other different adjustments related to the inbox prefix configuration. NOTE: I'm not changing the separator, it's still "."
2. Configured the email clients to connect to the new port and to NOT use any inbox prefix.
Everything works flawlessly. Next, went and:
3. Adjusted .dovecot.sieve filters configuration and removed "INBOX." from fileinto command, e.g.:
fileinto "INBOX.Spam";
becomes:
fileinto "Spam";
And this is where I hit a snag, because the local delivery is configured in /var/qmail/mailnames/domain.com.au/user/.qmail as:
| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO"
To get dovecot-lda to use the alternate inbox prefix configuration I had to change the entry to:
| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO" -c /etc/dovecot-alt/dovecot.conf
Now everything works fine. Of course, the sieve filter rules generator (e.g Roundcube) isn't using prefix="INBOX." anymore.
Any now the questions:
1. Where is the .qmail configuration stored?
2. When is .qmail file rebuilt by Plesk for an existing mailbox?
3. Can I alter .qmail in a programmatic way? I'm thinking about using the event handler mechanism to adjust it on mailbox created / updated events after doing a per domain lookup that will return:
- If existing ("grandfathered") domain, "namespace/inbox/prefix = INBOX." => leave .qmail file alone
- Else, "namespace/inbox/prefix =" => update .qmail for the alternate configuration.
4. What other options do I have to achieve the inbox prefix configuration separation?
1. Created an alternate Dovecot configuration in /etc/dovecot-alt and a new systemd service unit that is using this alternate configuration. The new configuration uses different ports for imap, pop3 and sieve and few other different adjustments related to the inbox prefix configuration. NOTE: I'm not changing the separator, it's still "."
2. Configured the email clients to connect to the new port and to NOT use any inbox prefix.
Everything works flawlessly. Next, went and:
3. Adjusted .dovecot.sieve filters configuration and removed "INBOX." from fileinto command, e.g.:
fileinto "INBOX.Spam";
becomes:
fileinto "Spam";
And this is where I hit a snag, because the local delivery is configured in /var/qmail/mailnames/domain.com.au/user/.qmail as:
| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO"
To get dovecot-lda to use the alternate inbox prefix configuration I had to change the entry to:
| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO" -c /etc/dovecot-alt/dovecot.conf
Now everything works fine. Of course, the sieve filter rules generator (e.g Roundcube) isn't using prefix="INBOX." anymore.
Any now the questions:
1. Where is the .qmail configuration stored?
2. When is .qmail file rebuilt by Plesk for an existing mailbox?
3. Can I alter .qmail in a programmatic way? I'm thinking about using the event handler mechanism to adjust it on mailbox created / updated events after doing a per domain lookup that will return:
- If existing ("grandfathered") domain, "namespace/inbox/prefix = INBOX." => leave .qmail file alone
- Else, "namespace/inbox/prefix =" => update .qmail for the alternate configuration.
4. What other options do I have to achieve the inbox prefix configuration separation?