Email IMAP root path
NetManager has been around a long time and many features and improvements have been introduced. When new features come along, we need to ensure that existing installations are not adversely affected. Unfortunately, this means that some existing systems are not set up in the same way a new system would be and so are missing out on some benefits. A prime example is the location of users' email which is described in this page.
History and information
In 1997 when it first started, NetManager used the University of Washington IMAP server (UW IMAP). UW IMAP counts all mail folders for a user (except for INBOX) as being relative to the top level of that user's home area. So by default, if you create a mail folder called
MyFolder this will be stored as a single file called
MyFolder in the very top of your home area. Of course, people use their home areas for various things, notably storing general file such as images and documents. If left to its own devices, UW IMAP will think that all such files are mail folders even all those in sub-directories. For example, if you had a directory called Music with a thousand MP3s in it, your email client would try to present all of these MP3s as separate mail folders. This is clearly a bad idea.
To work around this limitation, it is conventional to store all mail folders in a subdirectory called
mail/ to the start of the folder path, i.e. what you see as
MyFolder is in fact
mail/MyFolder. This all works well until you try to use a different mail client (such as Thunderbird or Outlook) which isn't aware of this. Most clients do allow you to set the IMAP root path, though they often use different names. For instance, Thunderbird calls it the IMAP server path. Once set everything should be consistent. Unfortunately, setting the IMAP root path is easily forgotten as it is an extra manual step and this is downright inconvenient if you are using autoconfiguration/autodiscovery. If you use multiple email clients and one is using a root path and another is not, you will end up with folders visible in one, but not the other.
Nowaways, NetManager uses Dovecot as the IMAP server. Dovecot allows you to configure where it looks for mail folders (in UW IMAP it was fixed to the top of the home area) and, ideally, this should be set to
mail/mail so it would appear as though all your mail folders had disappeared. Similarly, if you don't have an ''IMAP root path' set, your mail will be at the top level, not in
As described above, ideally you do not want to have an IMAP root path set as it interferes with auto-configuration. Also, to take advantage of new features such as Shared Mailboxes and Public folders, you must not have an IMAP root path set.
Ideally, you should configure Dovecot to look in
- Ensure dovecot is enabled with
imap_server="dovecot"in your NetManager configuration file
imap_folderpath="mail"in your NetManager configuration file
build_serverto make the changes live
mailmoveto move mail folders from the top level into the
subscribeall -ato ensure that all mail folders are subscribed to and thus visible in the mail client
- Go round all email clients removing the IMAP root path. You may want to warn users prior to starting that their mail folders may appear to go missing temporarily.
mailmove will go through all files in the top of every user's home directory and check whether they are mail folders or not. If they are mail folders, the file will be moved into the
mail/MyFolder), it will be renamed by having
-1 added to the end (e.g.
Should be run after
imap_folderpath is set (so it knows where to move the mail to). If not set, it will report No mail to move as imap_folderpath is not set. If you want to run it beforehand, you'll need to specify the sub-directory to use. Example run:
netmanager 1# mailmove mail /usr/export/home/sborrill/Drafts -> /usr/export/home/sborrill/mail/Drafts /usr/export/home/sborrill/Sent Items -> /usr/export/home/sborrill/mail/Sent Items
subscribeall finds all mailboxes for each user and ensure that they are subscribed to. Use
subscribeall -a to do this for all users.
Syntax: subscribeall [-afhv] [<groupnames> ...] -a = Create subscriptions file for all users (otherwise just listed groups -h = this message -v = be verbose