So in my server I'm usually going against a problem, different emails clients call some special folders like Sent
and Trash
different names like Sent Items
and Deleted Items
.
My question is, can I in some way "alias" all those names and internally map them to a same Sent
folder on the server?
I managed to change my dovecot.conf
an include sections like:
mailbox Sent {
special_use = \Sent
auto=subscribe
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox "Sent Items" {
special_use = \Sent
}
Is this the right way to "fix" this annoying issue? It seems to work, at least there's no actually duplication on the server, but some emails clients may pick all the folders duplicated.
Thank you.
You can use the Mailbox alias plugin requiring Dovecot 2.1.10+ which creates symlinks on the filesystem level to provide one directory with more than one name. The both directories have the same content.
Example configuration where Sent and Trash are the real mailboxes for the aliases "Sent Items" and "Deleted Items":
Don't forget to create the mailboxes:
The other possibility is to create two different mailboxes as you mentioned, I copied a part of
conf.d/15-mailboxes.conf
Using this method, you have two different Sent-boxes. When the user deletes one of them, the other still exists unchanged.
There is no need to use the plugin. Go to your vmail directory, example:
then, if you want for example to have all messages stored into the
"Sent Messages"
folder to be stored into the"Sent"
folder instead, just move the files of"Sent Messages"
into"Sent"
through your client as first step.Then, in the
/var/vmail/example.com/exampleUser/mail
folder, remove the"Sent Messages"
hidden folder:Before sending any other email, proceed adding a symlink to the hidden folder
"Sent"
from"Sent Messages"
(long line here, if you copy and paste do it carefully):This should be working fine. Just repeat the same procedure if you want to have the
"Sent Items"
or"Mail Sent"
or any other folder symlinked to the"Sent"
one, or if you want any other solution with other folders pointing to other folders and keep the mails in just one of them.If you need to make dovecot and the client to use
"INBOX"
as the"Sent"
folder, you should create the symbolic link from the mail folder with the username (long line again):unless you didn't change it. Then edit in the
/etc/dovecot/conf.d/15-mailboxes.conf
the lines:or other equivalent to make them become:
As you can notice, two are the same now, so you can just delete one:
Then it should work fine. I've gone through this process because I wanted my sent emails to be in my inbox folder both from my laptop and my phone. The dovecot hack was enough for the laptop, but the phone kept using the
"Sent Messages"
folder, so I had to use the symlink trick. Be very careful in selecting the right"Sent"
or"Sent Messages"
or whatever folder to make the symlink to and from!I guess the plugin simply does a symlink itself, so you're just making similar stuff. With this technique you may merge all the folders you want and keep your clients work with no changes. :-)