I found a solution to an earlier topic here Sent Mail and Sent folders which is unfortunately closed and not accepting replies.
The “Sent” and “Sent Mail” folders are deliberately created in /etc/dovecot/conf.d/15-mailboxes.conf.
# For \Sent mailboxes there are two widely used names. We'll mark both of
# them as \Sent. User typically deletes one of them if duplicates are created.
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
I wonder if there is standardization among brands and operating systems of devices which we use to access our email. I speak, of course, not of mail servers but of email clients like Microsoft’s Outlook app, Google’s Gmail app and Apple’s Mail app. It is these that have been unable to agree on the name of the folder to use for mail that we send to others.
If we use multiple operating systems to access mail from the same mailbox then there will be chaos about the folder in which outgoing mail is stored, unfortunately, unless the user is diligent enough to reconfigure defaults in some of the email clients that he uses.
You can configure what is referred to as “Special Folders” during Virtualmin installation, and for that matter afterwards (though changes made would not affect existing mailboxes).
Special Folders typically refers to “Sent”, “Spam”, and a few others.
As far as I know, you can also “map” Special Folders used within most email clients such as Outlook.
Since each email provider can setup Special Folders to their liking, the latter option is often preferred as it gives you back control.
If you’d like some specific instructions, I’d be happy to assist further just update the post indicating so, and the email client/version + operating system/version presently used.
It’s the “few others” I’m currently struggling with, specifically an “All Mail” virtual folder that can be used for searching, especially from phones. I’ve successfully set up Xapian indexes and I can search all folders from a phone by using a web browser and Roundcube (for example). But I’ve found that most phone mail apps can only search one folder at a time, so an “All Mail” view might be useful for those. The documentation (Virtual Plugin — Dovecot documentation) is very poor and so far I’ve been unsuccessful but I think it’s probably possible. If anyone has succeeded I’d be very interested.
I’m running Virtualmin 7.20.2 on Ubuntu 24.04.1 if that makes any difference.
I don’t believe “All Mail” fits the category of a Special Folder. I’ve only ever seen this type of feature in a few “Webmail” instances where they behind the scenes consolidate the contents of multiple folders for the purpose as suggested “search”. Also most email clients themselves have a built-in “search” feature which essentially searches every folder when used.
I think I’ve got it working now after a bit of trial and error. I’ll write it up in my VPS tutorial but essentially it’s a virtual folder that can be viewed and searched when you’re not sure which folder a message has ended up in, and Dovecot does consider that “special” (along with “Favourites” and “Important” and the like).
I’ve found that email clients vary widely in their support - some can only search one folder at a time or not at all, others search everything but too slowly or not deep enough to be useful and so on. See for example Virtual "all mails" folder in Dovecot to improve search | Cloudron Forum