John Harper | 9 Feb 18:57 2007

auto-detection of user mailbox type - followup


Timo Sirainen wrote
> You can still change NAMESPACE_* environments. I don't remember how  
> exactly now, but you can do eg. "set > /tmp/sets" in the script, see  
> what it has set and modify them in the script.

in response to my query regarding setting the mail_location in
namespaces from a mail_executable script. The purpose of this is to be
able to select on a per-user basis whether they're using Maildir or
mbox format (I don't want to convert 12000 users all at once, and some
users have no need or desire to change formats - they still use
mail/elm etc) and also have the UW-IMAP compatibility namespaces to
take care of all the clients currently configured with imap server
directory = mail/.

This all works, with one small bug left. For reference, here's the gist:

In the dovecot.conf file place the usual namespace directives
following the Namespaces wiki:

namespace private {
            separator = /
            prefix = 
            inbox = yes
#for UW backwards compatibility:
namespace private {
            separator = /
(Continue reading)

Timo Sirainen | 15 Feb 13:14 2007

Re: auto-detection of user mailbox type - followup

On Fri, 2007-02-09 at 12:57 -0500, John Harper wrote:
> However, it appears that the root dir '~/mail' string is used at some
> point before the tilde-expansion takes place. I see a literal ~
> directory in the users home, with an empty mail directory
> inside.

Hmm. I thought I had fixed all such cases.

> After that it picks up the proper location and works
> correctly. I tried a %h and got a literal %h directory.

Yea, %h is expanded by master process.

> home=`/bin/pwd`
> if [ -f .procmailrc -a -d Maildir ]; then
>     MAIL="maildir:$home/Maildir"; export MAIL

Wouldn't $HOME work directly?