<div dir="ltr">I'm the FreeBSD port maintainer for dovecot and I just added this patch to the port in SVN. 489515.</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jan 6, 2019 at 11:39 AM Stephan Bosch <<a href="mailto:stephan@rename-it.nl">stephan@rename-it.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Op 06/01/2019 om 18:12 schreef John Fawcett:<br>
> On 06/01/2019 11:37, Stephan Bosch wrote:<br>
>> Op 06/01/2019 om 03:35 schreef John Fawcett:<br>
>>> On 06/01/2019 02:26, John Fawcett wrote:<br>
>>><br>
>>>> Can't see anything in the Dovecot 2.3.4 code that would give this<br>
>>>> problem, setting<br>
>>>><br>
>>>> stats_writer_socket_path =<br>
>>>><br>
>>>> will overwrite the default value and dovecot does not attempt to<br>
>>>> open a socket in that case.<br>
>>>><br>
>>>> Using your configuration (though not FreeBSD) I don't get the<br>
>>>> net_connect_unix error whether I use a blank setting or leave the<br>
>>>> default. In the case of leaving the default I do get an additional<br>
>>>> process (dovecot/stats). No errors on connecting to the imap service<br>
>>>> or by running preauth (with the dovecot daemon already running).<br>
>>>><br>
>>>> The net_connect_unix() error with a zero length socket name is<br>
>>>> inexplicable to me, unless it's got a non printing character in it<br>
>>>> or there is something different happening on FreeBSD.<br>
>>>><br>
>>>> One suggestion is to run with the default setting, but look at<br>
>>>> resolving the permission problem for the default socket creation at<br>
>>>> /var/run/dovecot/stats-writer rather than working round it.<br>
>>>><br>
>>>> John<br>
>>>><br>
>>> Just following up, I don't get the error when I run preauth as root with<br>
>>> -u parameter. I do get something similar when I run as the user (this<br>
>>> wil the socket path set to blank)<br>
>>><br>
>>> Centos 7:<br>
>>><br>
>>> Error: net_connect_unix() failed: Connection refused<br>
>>><br>
>>> FreeBSD 11.2:<br>
>>><br>
>>> Error: net_connect_unix() failed: No such file or directory<br>
>>><br>
>>> So it's close. If I get time I'll see if I can track it down.<br>
>> Does this fix it?<br>
>><br>
>> diff --git a/src/lib-master/master-service.c<br>
>> b/src/lib-master/master-service.c<br>
>> index 3de11fa1b..3c60a7a39 100644<br>
>> --- a/src/lib-master/master-service.c<br>
>> +++ b/src/lib-master/master-service.c<br>
>> @@ -341,7 +341,7 @@ master_service_init(const char *name, enum<br>
>> master_service_flags flags,<br>
>>          if ((flags & MASTER_SERVICE_FLAG_DONT_SEND_STATS) == 0) {<br>
>>                  /* Initialize stats-client early so it can see all<br>
>> events. */<br>
>>                  value = getenv(DOVECOT_STATS_WRITER_SOCKET_PATH);<br>
>> -               if (value != NULL)<br>
>> +               if (value != NULL && *value != '\0')<br>
>>                          service->stats_client =<br>
>> stats_client_init(value, FALSE);<br>
>>          }<br>
>><br>
>><br>
>> Regards,<br>
>><br>
>> Stephan.<br>
>><br>
> Hi Stephan<br>
><br>
> that fixes the issue that I reproduced. For the OP he will probably need<br>
> to wait for this to be picked up for FreeBSD ports.<br>
><br>
> This code seems safer than the original but it is still a mystery as to<br>
> why DOVECOT_STATS_WRITER_SOCKET_PATH is being put into the environment<br>
> as an empty string (changed behaviour reported by OP compared to 2.3.2.1_1).<br>
<br>
Behavior changed because the code I patched didn't exist in 2.3.2.1.<br>
<br>
Regards,<br>
<br>
Stephan.<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Larry Rosenman                     <a href="http://www.lerctr.org/~ler" target="_blank">http://www.lerctr.org/~ler</a><br><span>Phone: <span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice">+1 214-642-9640</span></span></span> (c)     E-Mail: </span><a href="mailto:larryrtx@gmail.com" target="_blank">larryrtx@gmail.com</a><br>US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106</div></div></div></div></div></div></div></div>