Subject: Mailing from within pkg-comp; advice appreciated
To: None <netbsd-help@netbsd.org>
From: Martijn van Buul <martijnb@atlas.ipv6.stack.nl>
List: netbsd-help
Date: 06/19/2006 09:06:36
Hey;

I just stumbled over a nasty problem. As some of you might know, I'm running
a pkgsrc bulk build on a semi-regular basis. I'm doing so on my main desktop,
and because the bulk-build system wipes out all installed packages (leaving
me with an unusable system for almost a week), I've been doing so in a 
pkg_comp chroot. This used to work just great, but not anymore: It's no
longer possible to mail from within a pkg_comp chroot, after sendmail has
been retired and postfix has taken over - and a bulk build process ends with
mailing the report to whatever mail address is specified (ie: mine) Instead of 
DTRT, postfix discovers that the mail system isn't running (Actually, it is - 
but outside the chroot) and decides to do a local maildrop. However, this 
won't work, as the target account (my own user) doesn't exist within the 
chroot, and it will fail. Creating a user inside the chroot won't work,
since then my mail would end up in the wrong place (inside the chroot, instead
if in my normal mailbox)

Any advice on how to get this working again would be appreciated. Some
caveats:

1) I do not want to run a mailer deamon inside the chroot, as I already have
   one running *outside* the chroot. 
2) Using one of the "simple" mail delivery daemons in pkgsrc won't work. 
   Although they would work (As far as I'm concerned, it would just relay
   everything to 127.0.0.1, where the postfix outside the chroot would pick
   it up), the bulk build system would remove this package during the build.
   I'll have to make do with what the base system provides.
3) Xen is no option; I'm running amd64, which doesn't support xen. Switching
   to i386 is no option either; it would defy the purpose of the bulk build
   (Somebody else is already doing a bulk build for current/i386)
4) null-mounting my mail spool dir so postdrop *can* access it seems like a
   recipe for disaster to me.

Right now, the only solution I see is putting a small delivery agent in 
/usr/local in the chroot (So mk/bulk/build.sh will leave it be) and scribble
an appropriate mailer.conf in the chrooted /etc. However, this doesn't strike
as a particulary elegant solution. Advice would be muchly appreciated.

Kind regards,

Martijn