• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question [Plesk 17.5.3] Dovecot integration: per-domain INBOX prefix configuration on the same server

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?
 
Why did you go down this route? Really just to get rid of the Courier-IMAP artifacts that Plesk uses by default?

I don't like the default namespace configuration for Dovecot on Plesk either. Like you said way too much hassle with al the different email clients. However I just used the alternative namespace example from the Namespaces - Dovecot Wiki page to solve this issue. Works fine for new and existing mailboxes. Haven't ran into any trouble with spam filtering either.

Code:
namespace inbox {
  separator = /
  prefix =
  inbox = yes
}
namespace compat {
  separator = .
  prefix = INBOX.
  inbox = no
  hidden = yes
  list = no
  alias_for =
}
 
Last edited:
Created this namespace configuration in /etc/dovecot/conf.d/99-cust-namespace.conf and restarted dovecot service.
Really seems to work fine, my Outlook test installations continued to work without any hickup.

I can now configure an account with and without the INBOX root folder path and it looks fine both ways.
It can also be changed on existing accounts in Outlook, no problem - except that Outlook resyncs the whole mailbox from the server and that can take some time.

But I also had to adjust the Roundcube configuration (I used the file /usr/share/psa-roundcube/config/config.inc.php for that) from:
Code:
$config['drafts_mbox'] = 'INBOX.Drafts';
$config['junk_mbox'] = 'INBOX.Spam';
$config['sent_mbox'] = 'INBOX.Sent';
$config['trash_mbox'] = 'INBOX.Trash';
to:
Code:
$config['drafts_mbox'] = 'Drafts';
$config['junk_mbox'] = 'Spam';
$config['sent_mbox'] = 'Sent';
$config['trash_mbox'] = 'Trash';
as else Roundcube did only show the generic folder icon for these "special" folders.
 
Back
Top