Acknowledgement sent
to Marcus Frings <[email protected]>:
New Bug report received and forwarded. Copy sent to Dovecot Maintainers <[email protected]>.
(Sat, 07 Jul 2018 10:57:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Apollon Oikonomopoulos <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Sun, 25 Nov 2018 18:33:05 GMT) (full text, mbox, link).
Control: tags -1 + moreinfo
Hi,
On 12:46 Sat 07 Jul , Marcus Frings wrote:
> Package: dovecot-core
> Version: 1:2.3.2-2
> Severity: normal
>
> Since dovecot 2.3 has entered sid, my nightly cron runs of doveadm (as
> user) produce the error message, which is shown in the subject.
>
> This has already been reported upstream:
> https://www.dovecot.org/list/dovecot/2018-January/110549.html
>
> (My situation is the same as described in the original upstream report!)
>
> A solution has also been provided by the developers:
> https://www.dovecot.org/list/dovecot/2018-January/110552.html
>
> Hence, please consider changing the socket permissions (as suggested by
> upstream) in the next package upgrade of dovecot.
Thanks for the report and apologies for the late response.
The issue described in the upstream mailing list is a bit different, as
it applies to dovecot 2.3.1. Dovecot 2.3.1 by default set the
stats-writer permissions to root:root, 0600. In 2.3.2 this was relaxed
to root:dovecot, 0660, which means that if you add your plain user to
the dovecot group, doveadm should work fine. Can you try this out? If it
works, I'll add a note in README.Debian about running doveadm as
non-root.
Thanks,
Apollon
Acknowledgement sent
to Marcus Frings <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Mon, 26 Nov 2018 10:39:06 GMT) (full text, mbox, link).
Hi Apollon,
On Sun, 25 Nov 2018 20:22:11 +0200, Apollon Oikonomopoulos
<[email protected]> wrote:
> The issue described in the upstream mailing list is a bit different,
> as it applies to dovecot 2.3.1. Dovecot 2.3.1 by default set the
> stats-writer permissions to root:root, 0600. In 2.3.2 this was
> relaxed to root:dovecot, 0660, which means that if you add your plain
> user to the dovecot group, doveadm should work fine. Can you try this
> out? If it works, I'll add a note in README.Debian about running
> doveadm as non-root.
I reverted my manual change of permissions
for /var/run/dovecot/stats-writer from 666 (suggested at the dovecot
mailing list) to 660 (Debian's current default) and added my
user to the dovecot group: I can confirm that running doveadm as normal
user now allows the nightly maintenance work (such as expunging mails).
Hence, it seems to work fine.
But do you think that this is the way to go (to add ordinary users to
the dovecot group)?
Best regards,
Marcus
Acknowledgement sent
to Apollon Oikonomopoulos <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Mon, 26 Nov 2018 11:00:07 GMT) (full text, mbox, link).
On 11:29 Mon 26 Nov , Marcus Frings wrote:
> Hi Apollon,
>
> On Sun, 25 Nov 2018 20:22:11 +0200, Apollon Oikonomopoulos
> <[email protected]> wrote:
>
> > The issue described in the upstream mailing list is a bit different,
> > as it applies to dovecot 2.3.1. Dovecot 2.3.1 by default set the
> > stats-writer permissions to root:root, 0600. In 2.3.2 this was
> > relaxed to root:dovecot, 0660, which means that if you add your plain
> > user to the dovecot group, doveadm should work fine. Can you try this
> > out? If it works, I'll add a note in README.Debian about running
> > doveadm as non-root.
>
> I reverted my manual change of permissions
> for /var/run/dovecot/stats-writer from 666 (suggested at the dovecot
> mailing list) to 660 (Debian's current default) and added my
> user to the dovecot group: I can confirm that running doveadm as normal
> user now allows the nightly maintenance work (such as expunging mails).
> Hence, it seems to work fine.
>
> But do you think that this is the way to go (to add ordinary users to
> the dovecot group)?
It all comes down to the following question: do we trust everyone on the
system to submit dovecot stats or not? For some people it might be okay
to just change permissions to 0666. OTOH, upstream seems to be more
conservative about this.
Regarding the dovecot group, upstream notes the following:
commit 5cf6951e37bd37bb11b3335a3dbd029065143454
Author: Timo Sirainen <[email protected]>
Date: Wed Feb 7 13:03:23 2018 +0200
master: Add default_internal_group setting, defaulting to "dovecot"
It's expected that this is the primary group of the default_internal_user.
This group will be used to provide access to sockets that are generally
required by all Dovecot processes, but aren't safe enough to be allowed
completely open access from untrusted processes.
So, it looks like the intention is precisely to allow more fine-grained
access control for certain sockets.
Finally, bear in mind that doveadm is an administrative tool and not
meant to be run by "regular" users. For instance, it will fail if the
user invoking it does not have read permissions on all files under
/etc/dovecot/conf.d.
Regards,
Apollon
Acknowledgement sent
to Marcus Frings <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Mon, 26 Nov 2018 12:45:02 GMT) (full text, mbox, link).
Hi Apollon,
On Mon, 26 Nov 2018 12:57:08 +0200, Apollon Oikonomopoulos
<[email protected]> wrote:
> On 11:29 Mon 26 Nov , Marcus Frings wrote:
> > But do you think that this is the way to go (to add ordinary users
> > to the dovecot group)?
>
> It all comes down to the following question: do we trust everyone on
> the system to submit dovecot stats or not? For some people it might
> be okay to just change permissions to 0666. OTOH, upstream seems to
> be more conservative about this.
>
> Regarding the dovecot group, upstream notes the following:
>
> commit 5cf6951e37bd37bb11b3335a3dbd029065143454
> Author: Timo Sirainen <[email protected]>
> Date: Wed Feb 7 13:03:23 2018 +0200
>
> master: Add default_internal_group setting, defaulting to
> "dovecot"
> It's expected that this is the primary group of the
> default_internal_user.
> This group will be used to provide access to sockets that are
> generally required by all Dovecot processes, but aren't safe enough
> to be allowed completely open access from untrusted processes.
>
> So, it looks like the intention is precisely to allow more
> fine-grained access control for certain sockets.
Yes, I agree and see your point. Thanks for the additional information
by providing the upstream commit notes with respect to this issue. So
maybe it's the best solution to add a few lines to README.Debian as you
initially suggested.
Best regards,
Marcus
Acknowledgement sent
to Josh Triplett <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Thu, 29 Aug 2019 00:45:03 GMT) (full text, mbox, link).
I ran into a similar issue here, whenever I ran the "deliver" process as
a user to deliver mail into IMAP folders (invoked from getmail).
"deliver" delivered the mail but then produces the error about writing
statistics, so getmail correctly concluded that the process errored.
I don't want to make statistics-writing available to all users. I don't
actually care about the statistics. So I figured out how to disable
statistics.
I found this commit in the changelog:
2017-12-22 13:27:48 +0200 Timo Sirainen <[email protected]> (aa572aa74)
lib-master: Hide connect(stats-writer) errors when running via CLI
Only hide errors that occur if the stats process isn't running, i.e. when
socket isn't found or there's no listener. This way e.g. permission errors
are still logged, which points to a wrong configuration.
So if the stats sockets don't exist at *all*, deliver won't complain.
To disable those stats sockets, add the following configuration to a
file in /etc/dovecot/conf.d/ :
service stats {
unix_listener stats-reader {
mode = 0
}
unix_listener stats-writer {
mode = 0
}
}
service old-stats {
fifo_listener old-stats-mail {
mode = 0
}
fifo_listener old-stats-user {
mode = 0
}
unix_listener old-stats {
mode = 0
}
}
(Per https://wiki2.dovecot.org/Services , setting mode to 0 disables the
socket entirely.)
Then restart dovecot, and then delete /run/dovecot/stats-* and
/run/dovecot/old-stats-*. You can then run deliver without errors.
Hope that helps.
Acknowledgement sent
to Josh Triplett <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Thu, 29 Aug 2019 01:03:05 GMT) (full text, mbox, link).
On Wed, Aug 28, 2019 at 05:43:27PM -0700, Josh Triplett wrote:
> So if the stats sockets don't exist at *all*, deliver won't complain.
>
> To disable those stats sockets, add the following configuration to a
> file in /etc/dovecot/conf.d/ :
Update: sadly this doesn't fully work, as it produces the following
spurious errors in the logs:
Aug 28 17:54:27 cloud dovecot[3168]: imap-login: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: stats: open(old-stats-user) failed: No such file or directory
Aug 28 17:54:28 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
Aug 28 17:54:28 cloud dovecot[3168]: auth-worker(3182): Error: stats: open(old-stats-user) failed: No such file or directory
Aug 28 17:54:28 cloud dovecot[3168]: imap: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
So while deliver has no problem ignoring such errors, the rest of
dovecot unfortunately doesn't like that configuration.
I'd like to have a "disable all stats" configuration, rather than having
to make a stats socket available to the user running deliver.
Acknowledgement sent
to Timo Sirainen <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Thu, 29 Aug 2019 10:18:03 GMT) (full text, mbox, link).
Subject: Re: Bug#903161: Same issue here; solution found
Date: Thu, 29 Aug 2019 13:08:32 +0300
On 29 Aug 2019, at 3.57, Josh Triplett <[email protected]> wrote:
>
> On Wed, Aug 28, 2019 at 05:43:27PM -0700, Josh Triplett wrote:
>> So if the stats sockets don't exist at *all*, deliver won't complain.
>>
>> To disable those stats sockets, add the following configuration to a
>> file in /etc/dovecot/conf.d/ :
>
> Update: sadly this doesn't fully work, as it produces the following
> spurious errors in the logs:
>
> Aug 28 17:54:27 cloud dovecot[3168]: imap-login: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: stats: open(old-stats-user) failed: No such file or directory
> Aug 28 17:54:28 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> Aug 28 17:54:28 cloud dovecot[3168]: auth-worker(3182): Error: stats: open(old-stats-user) failed: No such file or directory
> Aug 28 17:54:28 cloud dovecot[3168]: imap: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
>
> So while deliver has no problem ignoring such errors, the rest of
> dovecot unfortunately doesn't like that configuration.
>
> I'd like to have a "disable all stats" configuration, rather than having
> to make a stats socket available to the user running deliver.
Add to dovecot.conf: stats_writer_socket_path=
Acknowledgement sent
to Josh Triplett <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Thu, 29 Aug 2019 17:51:02 GMT) (full text, mbox, link).
Subject: Re: Bug#903161: Same issue here; solution found
Date: Thu, 29 Aug 2019 10:49:04 -0700
On Thu, Aug 29, 2019 at 01:08:32PM +0300, Timo Sirainen wrote:
> On 29 Aug 2019, at 3.57, Josh Triplett <[email protected]> wrote:
> >
> > On Wed, Aug 28, 2019 at 05:43:27PM -0700, Josh Triplett wrote:
> >> So if the stats sockets don't exist at *all*, deliver won't complain.
> >>
> >> To disable those stats sockets, add the following configuration to a
> >> file in /etc/dovecot/conf.d/ :
> >
> > Update: sadly this doesn't fully work, as it produces the following
> > spurious errors in the logs:
> >
> > Aug 28 17:54:27 cloud dovecot[3168]: imap-login: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> > Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> > Aug 28 17:54:27 cloud dovecot[3168]: auth: Error: stats: open(old-stats-user) failed: No such file or directory
> > Aug 28 17:54:28 cloud dovecot[3168]: auth: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> > Aug 28 17:54:28 cloud dovecot[3168]: auth-worker(3182): Error: stats: open(old-stats-user) failed: No such file or directory
> > Aug 28 17:54:28 cloud dovecot[3168]: imap: Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: No such file or directory
> >
> > So while deliver has no problem ignoring such errors, the rest of
> > dovecot unfortunately doesn't like that configuration.
> >
> > I'd like to have a "disable all stats" configuration, rather than having
> > to make a stats socket available to the user running deliver.
>
> Add to dovecot.conf: stats_writer_socket_path=
Interesting! I'll try that and see how it goes.
Acknowledgement sent
to Bjørn Mork <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Tue, 19 Nov 2019 15:27:03 GMT) (full text, mbox, link).
Subject: changing socket permissions seems to be the best solution for now
Date: Tue, 19 Nov 2019 16:11:55 +0100
I tried the different methods suggested in this bug report, but had
no success with any of them.
Using
stats_writer_socket_path=
causes "doveadm index" to fail with
bjorn@canardo:~$ doveadm index -q -u bjorn INBOX.Spam
doveadm(bjorn): Error: net_connect_unix() failed: Connection refused
This can probably be worked around. But I'd prefer too many hacks just
to make stuff work again...
For now I ended up using:
service stats {
unix_listener stats-writer {
mode = 0666
}
}
I don't want to add mail users to the dovecot group. It's unclear to me
what privileges this will result in now and in the future. And I don't
want to maintain yet another mail user group anyway.
This mess should really be sorted out. Either there should be a way to
easily disable the stats service, or using it should be allowed for all
currently unprivileged operations. By default.
Bjørn
Acknowledgement sent
to Milan <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Sun, 12 Apr 2020 13:57:02 GMT) (full text, mbox, link).
Acknowledgement sent
to sloth 96 <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dovecot Maintainers <[email protected]>.
(Sun, 08 May 2022 20:09:03 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.