Hi Brutus,

On Friday, April 23, 2021 2:47:28 PM EEST Brutus <brutus....@googlemail.com> 
wrote:
> I'm running into the same error since upgrading to Dovecot 2.3.14 (from
> 2.2). Using `submission_host = localhost` is not possible for me, since
> I need a wrapped sendmail on the host.
> 
> Do you know of any other workarounds (besides downgrade and submission
> host)? And / or do you have some pointers on where to read more / track
> the progesss (if there is any)?


I've received the following from Dovecot's maintainers, which might have fixed 
the issue in recent versions:


On Friday, December 6, 2019 8:47:33 PM EEST Stephan Bosch <stephan@rename-
it.nl> wrote:
> On 03/11/2019 18:01, Delian Krustev via dovecot wrote:
> > On Saturday, November 2, 2019 10:40:45 PM EET Stephan Bosch 
<step...@rename-it.nl> wrote:
> >> I think we already know about this issue (tracked as DOP-942). It
> >> apparently happens because qmail masks the SIGCHLD signal while Dovecot
> >> doesn't unmask it before waiting for children.
> > 
> > You're right.
> > Isn't this a simple fix - a call to sigprocmask ?
> > 
> > This should not be a problem in qmail-lspawn/qmail-local as their code
> > has not been changed for years.
> > So there should have been a breaking change in Dovecot/Pigeonhole.
> 
> Does this fix it for you?
> 
> https://github.com/stephanbosch/dovecot-core/commit/f12062737aee89c2b41d3aa7
> 9044d003cc9337d2


I've not tested the provided patch as I've already had a solution and testing 
the patch required rebuilding Dovecot from source and distributing packages 
for the build.

What I've done before the patch was received was to invoke Dovecot's "deliver" 
as follows:

  sigchld_unblock /usr/lib/dovecot/deliver -e -a $ENV{EXT}@$ENV{HOST}

where "sigchld_unblock" is a simple wrapper which I've written:

$ cat sigchld_unblock.c

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

void die(msg)
char *msg;
{
    perror(msg);
    exit(1);
}

int main(argc, argv, env)
int argc;
char **argv;
char **env;
{
        char *cmd;
        sigset_t ss;

        if (
                sigemptyset( &ss ) ||
                sigaddset( &ss, SIGCHLD ) ||
                sigprocmask( SIG_UNBLOCK, &ss, NULL )
        )
                die("sigemptyset || sigaddset || sigprocmask");

        cmd = argv[1];
        argv++;

        execve( cmd, argv, env );

        die( cmd );

}



Best regards
--
Delian

Reply via email to