dovecot upgrade purposely breaks working configuration

Bug #581718 reported by Lionel Dricot on 2010-05-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dovecot (Ubuntu)
Medium
Unassigned

Bug Description

Upgrading a working dovecot from karmic to lucid.

Cannot log anymore to Imap with error :

May 17 15:10:27 localhost dovecot: dovecot: Relative home directory paths not supported (user <email address hidden>): maildir:/<email address hidden>

It appears to be an error introduced on purpose (!) :
http://hg.dovecot.org/dovecot-1.2/rev/dd49cf3fd2c9

Problems :

1) previously working configuration is not broken

2) no idea what means "relative home directory path" in this context

3) no idea on how to solve the problem

in my config, I've the location configured as :

mail_location = maildir:/home/mail/%u

Chuck Short (zulcss) wrote :

Thanks ill see if I can get this backported for lucid.

chuck

Changed in dovecot (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed

chuck : the link is *not* a patch to solve the issue. The link is a patch that introduced the issue itself.

The question is : what should people do if they have this error ? And why was this patch introduced ?

ok, it looks like the purpose of the patch is to avoid path starting by ".." and have every path hardcoded.

But, little problem : they did that by checking that the first letter of the home variable is "/".

I still don't understand how this "home" variable is built but, in the end, mine starts with "maildir:" (even if I remove that from the config file)

On 17.05.2010 15:15, Lionel Dricot wrote:

> mail_location = maildir:/home/mail/%u

Looking at the docs:

Upgrading Dovecot v1.1 to v1.2
==============================

  * Relative home directory paths are giving errors now. They were never
    supported, but earlier they just didn't usually cause problems.
     * If you were using e.g. 'mail_location = maildir:/var/mail/%h', just
       change it to 'mail_location = maildir:%h' and add '/var/mail/'
prefix to
       home dirs.
     * To get absolute home dir from relative path in LDAP, use
something like:
       'user_attrs = .., homeDirectory=home=/var/mail/%$'

So, your mail_location looks alright. Do you use %h anywhere?

On 17.05.2010 15:12, Lionel Dricot wrote:

> Upgrading a working dovecot from karmic to lucid.

http://wiki.dovecot.org/MailLocation

"Use only absolute paths. Even if relative paths would appear to work,
they might just as well break some day."

Unless we find that you are using only absolute paths, and dovecot is
complaining about relative paths, this is not a bug.

Changed in dovecot (Ubuntu):
status: Confirmed → Incomplete

I'm using absolute path.

The problem is that the path was given by LDAP with :

user_attrs = mailbox=home (this is what is recommended in the documentation)

It seems that, for whatever reason this string is passed directly to the code and used as "home". But because it starts with "maildir:", it fails the test "first character is /".

The workaround so far was to disable mailbox from ldap and use directly mail_location = maildir:/home/mail/%u

I've seen a similar symptom on dovecot mailing list and the dev reply something like "this is wrong, remove the maildir:". It's really a pitty because a lot of usecases are now broken because of a poor implementation of one very specific test. The error message is also not really informative.

Ante Karamatić (ivoks) wrote :

home isn't a mail_location path. It's home path. In your ldap mailbox should look like this:

/<email address hidden>

If it looks like:

maildir:/<email address hidden>

then you are using that wrong.

http://wiki.dovecot.org/UserDatabase/ExtraFields - those are extra fields that are supported.

Ante Karamatić (ivoks) wrote :

Marking bug as invalid since it shouldn't have wored anyway.

Changed in dovecot (Ubuntu):
status: Incomplete → Invalid

I don't set the "home" field manually. It's set by Mandriva Directory Server. I think that the error come from that mail and home are, on my config, un

I find it very wrong to consider that as a user fault because :

1) it was working previously and al least one existing configuration (mine) was working fine with it.

2) there's no rule that say that it's bad to return maildir:. It's just lazyness from the programmer : consider it user fault instead of correcting it.

3) the software understand perfectly what the user want without any possible confusion and decides arbitrarly to give an error

4) the error message is not related to that issue.

I understand perfectly how this bug can be considered as "user fault, not a bug" but IMHO just putting the head in the sand.

Well, in the end, I agree that it's a broader consideration (and less urgent ;-) )

Ante Karamatić (ivoks) wrote :

1) it was working by pure luck; it was never suposed to work
2) actually, there is; look at comment #6
3) for a reason - security
4) ??

It's not ignoring the issue. It's just that you are using 'mailbox' path, which starts with 'maildir:' as a home variable. That's just wrong, weather dovecot works or not. Your home isn't 'maildir:/home/user'. It's '/home/user'.

If you think that is wrong and that 'home' should be 'maildir:/home/user', bring this to upstream cause Ubuntu will not diverge on this one. It's just pointless. MDS doesn't set 'home' attribute wrong. Look at it in your LDAP - I'm sure it's just '/home/something'. Problem is that you linked 'mailbox' LDAP attribute with 'home' variable in dovecot in dovecot-ldap.conf.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers