Subject: /usr/pkgsrc/mail/nullmailer
To: None <tech-pkg@netbsd.org, schmonz@netbsd.org>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-pkg
Date: 11/24/2007 11:07:48
Hi,

I was noticing a problem for a while now with nullmailer not trying to
send mail when I sent it, but it was sending mail when I went online with
ppp

I finally tracked this down to the fact that my ppp/ip-up script was
pulling the trigger manually (echo -n . >>/var/spool/nullmailer/trigger)
as 'root', but nullmailer-send could not do it as 'nullmailer' because the
INSTALL script makes the fifo mode 0600 as root .. it seems that
SPECIAL_PERMS applies before the INSTALL script is run..

The patch below solves this, is it ok?

I'm not sure if there is a better way to make a fifo, or if there is a
different target that it could be made at (pre-post-install ? :)

iain

Index: INSTALL
===================================================================
RCS file: /cvsroot/pkgsrc/mail/nullmailer/INSTALL,v
retrieving revision 1.1
diff -u -r1.1 INSTALL
--- INSTALL	20 Aug 2005 02:20:45 -0000	1.1
+++ INSTALL	24 Nov 2007 10:46:10 -0000
@@ -1,10 +1,15 @@
 # $NetBSD: INSTALL,v 1.1 2005/08/20 02:20:45 schmonz Exp $

 VARBASE=@VARBASE@
+NULLMAILER_USER=@NULLMAILER_USER@
+NULLMAILER_GROUP=@NULLMAILER_GROUP@
+
+TRIGGER=${VARBASE}/spool/nullmailer/trigger

 case "${STAGE}" in

 POST-INSTALL)
-	mkfifo ${VARBASE}/spool/nullmailer/trigger
+	mkfifo -m 0600 ${TRIGGER} &&					\
+	chown ${NULLMAILER_USER}:${NULLMAILER_GROUP} ${TRIGGER}
 	;;
 esac
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/nullmailer/Makefile,v
retrieving revision 1.28
diff -u -r1.28 Makefile
--- Makefile	4 Jul 2007 20:54:45 -0000	1.28
+++ Makefile	24 Nov 2007 10:46:10 -0000
@@ -44,8 +44,6 @@
 			${NULLMAILER_USER} ${NULLMAILER_GROUP} 4555
 SPECIAL_PERMS+=		libexec/nullmailer/nullmailer-queue		\
 			${NULLMAILER_USER} ${NULLMAILER_GROUP} 4555
-SPECIAL_PERMS+=		${VARBASE}/spool/nullmailer/trigger		\
-			${NULLMAILER_USER} ${NULLMAILER_GROUP} 0600

 SUBST_CLASSES+=		paths
 SUBST_FILES.paths=	${WRKDIR}/mailer.conf