Mailing List Archive

patch - os x leopard, netqmail-1.06, clean build, fix unable to exec qq
The following patch against netqmail-1.06 is for OS X leopard systems
with the apple developer tools installed. I have compiled, installed,
and run it on a MacOS 10.5.1 client system. So far, so good. Adios,
postfix!

Developer tools for leopard provides gcc 4.0.1. The files dns.c,
strerr_sys.c, and qmail.c are patched. Dns.c and strerror_sys.c are
patched for a clean build.

The patch to qmail.c replaces the vfork() on line 32 with fork() in
order to keep an execv() of bin/qmail-queue from failing. Thanks to
Steve and whomever suggested changing the call to vfork. Without this
change to qmail.c, local delivery errors can occur, as discussed
recently on this list (Jan 2008). Forwards and bounces will tickle
this bug, if unpatched or un-circumvented with

QMAILQUEUE="/var/qmail/bin/qmail-queue"

in your startup script.


diff -u netqmail-1.06.orig/dns.c netqmail-1.06/dns.c
--- netqmail-1.06.orig/dns.c 2007-11-30 14:22:54.000000000 -0600
+++ netqmail-1.06/dns.c 2008-01-16 13:18:55.000000000 -0600
@@ -2,6 +2,7 @@
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
+#include <nameser8_compat.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <errno.h>
Common subdirectories: netqmail-1.06.orig/old-patches and
netqmail-1.06/old-patches
Common subdirectories: netqmail-1.06.orig/other-patches and
netqmail-1.06/other-patches
diff -u netqmail-1.06.orig/qmail.c netqmail-1.06/qmail.c
--- netqmail-1.06.orig/qmail.c 2007-11-30 14:22:54.000000000 -0600
+++ netqmail-1.06/qmail.c 2008-01-28 10:55:26.000000000 -0600
@@ -29,7 +29,7 @@
if (pipe(pim) == -1) return -1;
if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }

- switch(qq->pid = vfork()) {
+ switch(qq->pid = fork()) { /* was vfork() - remove unable to exec qq error */
case -1:
close(pim[0]); close(pim[1]);
close(pie[0]); close(pie[1]);
diff -u netqmail-1.06.orig/strerr_sys.c netqmail-1.06/strerr_sys.c
--- netqmail-1.06.orig/strerr_sys.c 1998-06-15 05:53:16.000000000 -0500
+++ netqmail-1.06/strerr_sys.c 2008-01-16 13:19:28.000000000 -0600
@@ -1,7 +1,7 @@
#include "error.h"
#include "strerr.h"

-struct strerr strerr_sys;
+struct strerr strerr_sys = {0,0,0,0};

void strerr_sysinit()
{
Re: patch - os x leopard, netqmail-1.06, clean build, fix unable to exec qq [ In reply to ]
John Palkovic wrote:
> Developer tools for leopard provides gcc 4.0.1. The files dns.c,
> strerr_sys.c, and qmail.c are patched. Dns.c and strerror_sys.c are
> patched for a clean build.
>
>
>
I would suggest looking at qmail-rspawn.c, and qmail-lspawn.c as they
have similar calls with partial path names. I would expect them to fail
as well. I patched them on my system. It was not my idea to replace
vfork with fork though.

For those who like qmail-spamcontrol, I have submitted a "Macport" i.e.
Darwinports to them and it will be included shortly.

The same fix works for ezmlm-idx, which has the same qmail.c in it.

Steve
Re: patch - os x leopard, netqmail-1.06, clean build, fix unable to exec qq [ In reply to ]
On Jan 28, 2008 1:27 PM, Steve <compconsultant@yahoo.com> wrote:
> > Developer tools for leopard provides gcc 4.0.1. The files dns.c,
> > strerr_sys.c, and qmail.c are patched. Dns.c and strerror_sys.c are
> > patched for a clean build.
> >
> I would suggest looking at qmail-rspawn.c, and qmail-lspawn.c as they
> have similar calls with partial path names. I would expect them to fail
> as well. I patched them on my system. It was not my idea to replace
> vfork with fork though.

I'd rather leave them untouched. It's a minimal patch against
netqmail-1.06. I know not why the other vforks don't lead to errors.
Do you have evidence of any? I only see errors coming from line 32 of
qmail.c. I find that with this patch, local2local, local2forward, and
local2bounce, e.g.

echo to: nonexistent | /var/qmail/bin/qmail-inject

are working without errors showing up in the mail logfile and with the
message routed correctly to the proper endpoint as documented by 'man
dot-qmail'. Do you find otherwise?

-John

--
In mathematics you don't understand things. You just get used to them.
-- Johann von Neumann