postfix, dovecot-lda, /run/dovecot/stats-writer socket permision and local user delivery, again
Hi!
There are many questions on the 'net about the same theme: lda(mjt): Error: net_connect_unix(/run/dovecot/stats-writer) failed: Permission denied
dovecot-lda is run from postfix as mailbox_command for local users.
There's even a suggestion on dovecot wiki to make dovecot-lda setgid (to mail) - for a different reason but people use this trick to shut this error message up. See eg the last message at https://forum.zentyal.org/index.php?topic=35236.0 which points to https://wiki2.dovecot.org/LDA/Postfix .
But the thing is: mail delivery stops right after making dovecot-lda setgid, like this:
Feb 22 00:06:46 tsrv dovecot: lda(mjt)<253650>:
Fatal: setresgid(914(dovecot),914(dovecot),8(mail)) failed with euid=1000(mjt):
Operation not permitted
why the hell lda tries to setuid to dovecot user? It will definitely unable to write to the maildir since it is owned by user mjt, not by user dovecot!
And I *only* made it setgid, not setuid.
How to use dovecot-lda together with postfix, after all?
Thanks,
/mjt
On 21/02/2022 23:24 Michael Tokarev mjt@tls.msk.ru wrote:
Hi!
There are many questions on the 'net about the same theme: lda(mjt): Error: net_connect_unix(/run/dovecot/stats-writer) failed: Permission denied
dovecot-lda is run from postfix as mailbox_command for local users.
There's even a suggestion on dovecot wiki to make dovecot-lda setgid (to mail) - for a different reason but people use this trick to shut this error message up. See eg the last message at https://forum.zentyal.org/index.php?topic=35236.0 which points to https://wiki2.dovecot.org/LDA/Postfix .
But the thing is: mail delivery stops right after making dovecot-lda setgid, like this:
Feb 22 00:06:46 tsrv dovecot: lda(mjt)<253650>
:
Fatal: setresgid(914(dovecot),914(dovecot),8(mail)) failed with euid=1000(mjt):
Operation not permittedwhy the hell lda tries to setuid to dovecot user? It will definitely unable to write to the maildir since it is owned by user mjt, not by user dovecot!
And I *only* made it setgid, not setuid.
How to use dovecot-lda together with postfix, after all?
Thanks,
/mjt
The most simple fix which usually works is
service stats { unix_listener stats-writer { mode = 0666 } }
Aki
22.02.2022 10:49, Aki Tuomi wrote:
The most simple fix which usually works is
service stats { unix_listener stats-writer { mode = 0666 } }
Yes, that obviously works, and this is what I ended up with, for now. My question was more about how it is SUPPOSED to be set up. It is restricted for a reason. For example, it'd be nice to have it chgrp to users, - but postfix does not do initgroups() so this wont work.
And the more interesting question is why sgid dovecot-lda does not work, why it tries to setUID (to wrong value!) when it gets sticky bit?
Thanks,
/mjt
participants (2)
-
Aki Tuomi
-
Michael Tokarev