• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to edit Dovecot configuration

jproactive

New Pleskian
Server operating system version
Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-58-generic x86_64)
Plesk version and microupdate number
Plesk Obsidian Web Host Edition Version 18.0.54 Update #4
I have a fairly "clean" Plesk Obsidian installation, with Mail setup using the standard clicks under Domains (Roundcube, Dovecot, Postfix). In the default configuration, Dovecot uses mbox which doesn't let me have subfolders of Inbox. Instead, all the other standard boxes are children of Inbox (Sent, Drafts, Spam, Trash). I want to change this and read that I could switch Dovecot to use Maildir. However, I have no idea how to do this in Plesk.

Is it a matter of just editing a file in an SSH terminal? It seems like there should be a Dovecot configurator within Plesk as it is such a common thing to have installed.
 
In a default Plesk installation with Dovecot there are no issues creating subdirectories. At least on my test and production servers I see the Maildir format. Maybe Dovecot was already installed on your system before you installed Plesk? I've never done a conversion myself, so another party needs to answer your question how to do that.
 
@Peter Debik, thanks, that is helpful because you pointed out that I made a wrong assumption.
I decided to hunt for the config files and found that you're right. It is by default configured for maildir.
Code:
mail_location = maildir:/var/qmail/mailnames/%Ld/%Ln/Maildir:UTF-8
So the problem must be the namespace configuration:
Code:
namespace inbox {
  separator = .
  prefix = INBOX.
  inbox = yes

  mailbox Sent {
    auto = subscribe # autocreate and autosubscribe the Sent mailbox
    special_use = \Sent
  }
  mailbox Spam {
    auto = create # autocreate Spam, but don't autosubscribe
    special_use = \Junk
  }
  mailbox Drafts {
    auto = create
    special_use = \Drafts
  }
  mailbox Trash {
    auto = create
    special_use = \Trash
  }
}
However, this means I have to ask a different question ... or maybe do a different search first.

I think I also asked the question incorrectly - I can make subfolders of Inbox but everything's a subfolder of Inbox, which isn't what I want. I want Sent, etc to be separate. Fortunately, I only have one test mailbox so far, so I can experiment with this. I've attached some screenshots of what it looks like in
Thunderbird and Roundcube.

Thunderbird:
Thunderbird

Roundcube:
Roundcube mail.png

Roundcube settings:
Roundcube settings.png
 
I don't know whether I've done this right but I have a working solution. I created a new file
/etc/dovecot/conf.d/50-namespaces.conf
In this file, I copied the namespaces, except with prefix empty:
Code:
namespace inbox {
  separator = .
  prefix =
  inbox = yes

  mailbox Sent {
    auto = subscribe # autocreate and autosubscribe the Sent mailbox
    special_use = \Sent
  }
  mailbox Spam {
    auto = create # autocreate Spam, but don't autosubscribe
    special_use = \Junk
  }
  mailbox Drafts {
    auto = create
    special_use = \Drafts
  }
  mailbox Trash {
    auto = create
    special_use = \Trash
  }
}

I then ran
systemctl restart dovecot

And then I could create the structure I want (note the mailboxes In1, In2, Archive, Ar1 and Ar2), as in the screenshots.

Thunderbird:
Thunderbird-after.png

Roundcube:
Roundcube mail - after.png

Roundcube settings:
Roundcube settings - after.png
 
I think the real answer to my question is:
  • there isn't a way to edit all the Dovecot configuration in Plesk; including namespaces; file have to be created/edited using a terminal (Plesk has an SSH terminal in Tools & Settings if you're not sure how to set up remote SSH from your local machine)
  • the main config file is /etc/dovecot/dovecot.conf -- do not edit this file as it is updated when Dovecot is updated (read the top of the file for details)
  • editing the config is done by adding files in /etc/dovecot/conf.d
  • do not add config files in the range 10-20 and 90-95 because these are controlled by Plesk (read the bottom of dovecot.conf to see this)
  • the config files are processed in the order of the alphanumeric filename, hence the prefixes

After editing configuration, load the new config with:
systemctl restart dovecot
 
you will have problems because now plesk and e.g. spamassassin can no longer find the INBOX.spam folder.
 
Depending on which spam software you use. Spamassasin, Plesk email security, warden?
Look in the folder
/var/qmail/mailnames/example.com/johndoe/Maildir
What does it look like?
.sent
.trash
.spam
.folder1

or
.INBOX.sent
.INBOX.trash
.INBOX.spam
.INBOX.Folder1
 
@FuXXz, thanks for the details. I'm using Spamassassin (Plesk Email Security and Warden are not installed). The mail directories for all the users I've set up so far have directories:
.Drafts
.Sent
.Spam
.Trash
and also other directories (cur, new and tmp) and several files starting dovecot, as well as maildirsize and subscriptions.

The users who have extra folders also have directories like:
.INBOX.In1
.Archive
.Archive.Ar1

Now that I'm thinking about it, there is so little mail I can't be sure that Spamassassin is working, and I don't know how I would send some test spam, or if doing so is even a good idea.

Is there a way to reconfigure Spamassassin to work with this, or is there a correct way of achieving what I want as well as having Spamassassin work?
 
look in the /var/qmail/mailnames/example.com/johndoe
there is a .dovecot.sieve.log
what does it say?
 
i dont know the way to reconfigure spamassassin, and nobody can help you. I have now asked a total of 9 Linux admins
There aren't many professionals who know what they're doing.
It feels like a lot of people are just cooking things up with dovecot instead of mastering it :)
Especially when it comes to the topic of namespaces and the appearance of the folder in the client, at the latest with Outlook everyone capitulates
 
@FuXXz, as you predicted:
sieve: info: started log at 2023-12-22 16:57:07 +0000.
error: msgid=unspecified: failed to store into mailbox 'INBOX.Spam': Mailbox doesn't exist: INBOX.Spam.
sieve: info: started log at 2024-01-13 15:15:08 +0000.
error: msgid=unspecified: failed to store into mailbox 'INBOX.Spam': Mailbox doesn't exist: INBOX.Spam.
There isn't much spam at the moment as the server and domain are new, but this certainly confirms your diagnosis. I'm really grateful to you for pointing this out and spending the time making it clear. I will have to do some RTFM action, I think :) I'm usually quite persistent with problems like this but this one looks really really tough. If I solve it, I'll post here. In the meantime, I'll let my users know that the spam filter is not working. Fortunately, it's just a handful so far.

I've also been wondering whether to change the configuration back. Unfortunately, this would trash the mailboxes (it did when I changed it to the current settings) and this would affect a few people. Not too many that I can't handle it with a few extra hours' work ...

One last question, if I may (I won't be offended if you don't reply): is the problem only because `prefix` is blank, or is it that it must be `INBOX` to work with Plesk/Spamassassin/etc?
 
I have solve the Problem for me.
I can now create folders in the client under inbox and in the main level. The Folder spam, sent, trash etc have no Children, and it works with translated Folders in MS Outlook. in addition, plesk and spamassasis works.
I add you the configuration file which goes to /etc/dovecot/conf.d
you only have to delete The lines with the german translation
 

Attachments

  • 99-customization.zip
    560 bytes · Views: 15
Back
Top