[Dovecot] Permission problem with LDA and dovecot 2.2.1

Tobi tobster at brain-force.ch
Thu May 9 14:14:59 EEST 2013


Am 09.05.2013 02:30, schrieb Ben Morrow:
> At  9PM +0200 on  8/05/13 you (Tobi) wrote:
>> Am 08.05.2013 19:21, schrieb Ben Morrow:
>>> At  6PM +0200 on  7/05/13 you (Tobi) wrote:
>>>> I tried with removing the base_dir definition from my config, restartet
>>>> dovecot and checked with the commands you provided below:
>>>> <<
>>>> root at nordkap:~# doveconf -d base_dir
>>>> base_dir = /usr/local/var/run/dovecot
>>>> root at nordkap:~# doveconf base_dir
>>>> base_dir = /usr/local/var/run/dovecot
>>>> root at nordkap:~# su vmail -s /bin/sh -c "doveconf base_dir"
>>>> base_dir = /usr/local/var/run/dovecot
>>>>    >>
>>>> for me it seems that all is build with /usr/local
>>> OK, that's odd. I was wondering if you had some permission problem which
>>> was stopping the lda from reading the config file, but apparently not.
>> Sorry my subject is a bit misleading ;-)
> I wasn't confused by the subject: IIRC if LDA can't read a config file,
> it will simply ignore it (on the grounds that it is often running as an
> ordinary user and so might not be supposed to), meaning that if the
> permissions on the config file were too restrictive the LDA running as
> vmail might not have seen the base_dir setting. Apparently that's not
> the case...
>
>> As I updated today to wheezy anyway I built dovecot again with the
>> following options:
>> <<
>> ./configure --prefix=/usr/local --localstatedir=/usr/local/var
>> --with-mysql --with-sql
>> make && make install
>>   >>
>> but as well with those after starting dovecot and postfix the errors of
>> the lda looking in /var/run occured again.
> OK... interesting choice, now you understand why /usr/local/var is not
> usually used, but anyway...
>
this localstatedir option was just a "test" to see if lda looks in the 
localstatedir specified with configure. At least in my case it is not. 
After that test I built again with localstatedir=/var (as suggested by 
Christian) and like that it works fine without the symlink
>>>> But after removing the symlink and restarting dovecot I get the errors again
>>>> <<
>>>> May  7 17:47:57 nordkap dovecot: lda: Error: userdb lookup:
>>>> connect(/var/run/dovecot/auth-userdb) failed: No such file or directory
>>>> May  7 17:47:57 nordkap dovecot: lda: Fatal: Internal error occurred.
>>>> Refer to server log for more information.
>>>>    >>
>>> Are you sure you're running the right copy of dovecot-lda? I think you
>>> mentioned xthread that you have a Debian-provided version installed as
>>> well?
>> Yes I had the version from apt as well, but removed it today after
>> upgrading to wheezy. The lda is called from postfix by these lines in
>> master.cf
>> <<
>> dovecot unix    -       n       n       -       -       pipe
>>    flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f
>> ${sender} -d ${user}@${nexthop}
>>   >>
>> so according to the path prefix it should be the correct copy of
>> deliver. Is there a switch to get the version from deliver? I tried the
>> usual -v and --version but no success. But even without the version I'm
>> 99.99873% sure that the correct binary is used :-)
> OK. So the next step is to try running deliver by hand, as vmail,
> feeding it a mail from stdin, to see if that fails the same way. If it
> does then I would next run it under strace, to see exactly what it's
> trying to do and what files it's looking at.
>
> You could also run ldd on deliver, just to make sure it's picking up the
> right versions of the dovecot libraries. The hardcoded base_dir path
> appears to be baked into libdovecot.so.0, so if you run
>
>      strings /path/to/libdovecot.so.0 | grep /var
As I actually built with localstatedir=/var all the paths are correct
<<
ldd /usr/local/libexec/dovecot/deliver
...
libdovecot.so.0 => /usr/local/lib/dovecot/libdovecot.so.0 
(0x00007fc41bcd9000)
...
 >>
and
<<
root at nordkap:~# strings /usr/local/lib/dovecot/libdovecot.so.0 | grep /var
/var/lib/dovecot/instances
/var/run/dovecot/config
/var/run/dovecot
/var/lib/dovecot
/var/run
/var/tmp
 >>
I will built dovecot again with localstatedir=/usr/local/var and 
re-check the paths with the commands above.

Thanks for all the help here, really a great list

tobi


More information about the dovecot mailing list