Subject: postfix and fork errors in .forward/procmail
To: None <current-users@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: current-users
Date: 10/17/2006 12:00:09
--=-=-=
Content-Transfer-Encoding: quoted-printable


I'm running pretty-much current on i386 with procmail and postfix from
pkgsrc:

procmail-3.22nb2    Local mail delivery agent
postfix-2.3.3       Postfix SMTP server and tools

Someone got a bounce and I found this in the logs:

Oct 17 09:16:14 fnord postfix/local[28729]: 8D8825283: to=3D<gdt@ir.bbn.com=
>, relay=3Dlocal, delay=3D8.7, delays=3D8.6/0.01/0/0.04, dsn=3D5.3.0, statu=
s=3Dbounced (Command died with status 2: "/usr/pkg/bin/procmail  || exit 75=
". Command output: Cannot vfork )

Here is my .forward:

  "|/usr/pkg/bin/procmail  || exit 75"


I don't really understand why my system got into a 'cannot vfork' mode
(it seems to occasionally, even though I don't seem up against
per-user resource limits, global # processes, open files, or running
out of RAM/swap).  I am running gnome though, and have found multiple
copies of some daemons.

I looked in the postfix source and found that it seems to hit this in
global/pipe_command.c:

	    else {
		sp =3D sys_exits_detail(WEXITSTATUS(wait_status));
		dsb_unix(why, sp->dsn,
			 log_len ? log_buf : sp->text,
			 "Command died with status %d: \"%s\"%s%s",
			 WEXITSTATUS(wait_status), args.command,
			 log_len ? ". Command output: " : "", log_buf);
		return (PIPE_STAT_BOUNCE);
	    }

So I think it's forking /bin/sh to run the "procmail || exit 75"
compound command, and /bin/sh can't fork.  This turns into 550 via
sys_exits_fake.   It seems that random non-understood errors ought to
be 4xx.  I haven't looked in the in-tree postfix.

=2D-=20

    Greg Troxel <gdt@ir.bbn.com>

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFNP4M+vesoDJhHiURAk4nAJ4zGnIRTkRNRkwEwxNcUcde0ZCs4QCeIeie
5sqWBd4XN8eZXZCVxtNHJOM=
=1Dcg
-----END PGP SIGNATURE-----
--=-=-=--