Bug 30751 - postfix (and postfix-current) install script
Summary: postfix (and postfix-current) install script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: dwcjr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-23 06:20 UTC by Yen-Ming Lee
Modified: 2001-09-24 01:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yen-Ming Lee 2001-09-23 06:20:00 UTC
After install postfix (or postfix-current), postfix-script will check if all
directrories exists or create them, at this time postfix-script will source
install.cf which generated by INSTALL.sh.

But during installing procedure, we didn't run INSTALL.sh, so that install.cf
doesn't exist. then postfix-script will create spool directories with default
owner and group, postfix:wheel, which should be postfix:maildrop if everything
goes well.

Since installing procedure install postfix-script-sgid as postfix-script, 
we should run INSTALL.sh first, or just put a default install.cf into
/usr/local/etc/postfix, so that postfix-script can source install.cf and
chgrp /var/spool/postfix/maildrop correctly.

With wrong group of /var/spool/postfix/maildrop, postfix/postdrop will
always complain like this:
Sep 23 08:58:29 utopia postfix/postdrop[83962]: warning: mail_queue_enter: create file maildrop/44847.83962: Permission denied
Sep 23 08:58:39 utopia postfix/postdrop[83962]: warning: mail_queue_enter: create file maildrop/44847.83962: Permission denied
Sep 23 09:00:09 utopia postfix/postdrop[83962]: warning: mail_queue_enter: create file maildrop/44847.83962: Permission denied
Sep 23 09:14:40 utopia postfix/postdrop[83962]: warning: mail_queue_enter: create file maildrop/44847.83962: Permission denied
Sep 23 09:15:20 utopia postfix/postdrop[83960]: warning: mail_queue_enter: create file maildrop/979716.83960: Permission denied

BTW, INSTALL.sh will update symbolic link and manpage as well.

Fix: 

I suggest to run INSTALL.sh or put a default install.cf in post-install section
or ${PKGINSTALL} script
How-To-Repeat: 
# cd /usr/ports/mail/postfix-current; make all
[skipped]
# make install
===>  Installing for postfix-20010808_3
postfix:*:1002:
You already have a group "postfix", so I will use it.
maildrop:*:1003:
You already have a group "maildrop", so I will use it.
postfix:*:10001:1002::0:0:Postfix Mail System:/nonexistent:/nonexistent
You already have a user "postfix", so I will use it.
Installed HTML documentation in /usr/local/share/doc/postfix
Installed text documentation in /usr/local/share/doc/postfix
--------------------------------------------------
- To replace your existing sendmail with postfix -
- type "make replace"                            -
--------------------------------------------------
===>   Generating temporary packing list
postfix/postfix-script: warning: creating missing Postfix maildrop directory
.: Can't open /usr/local/etc/postfix/install.cf: No such file or directory
postfix/postfix-script: warning: creating missing Postfix pid directory
postfix/postfix-script: warning: creating missing Postfix incoming directory
postfix/postfix-script: warning: creating missing Postfix active directory
postfix/postfix-script: warning: creating missing Postfix bounce directory
postfix/postfix-script: warning: creating missing Postfix defer directory
postfix/postfix-script: warning: creating missing Postfix deferred directory
postfix/postfix-script: warning: creating missing Postfix flush directory
postfix/postfix-script: warning: creating missing Postfix saved directory
postfix/postfix-script: warning: creating missing Postfix corrupt directory
postfix/postfix-script: warning: creating missing Postfix public directory
postfix/postfix-script: warning: creating missing Postfix private directory
===>   Compressing manual pages for postfix-20010808_3
===>   Registering installation for postfix-20010808_3
===>  SECURITY NOTE:
      This port has installed the following binaries which execute with
      increased privileges.
3356979  130 -r-xr-sr-x    1 root             maildrop            66296   9/23 13:02 /usr/local/sbin/postdrop

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.postfix.org/

# ls -la /var/spool/postfix
total 14
drwxr-xr-x  14 root     wheel  512   9/23 13:02 .
drwxr-xr-x  13 root     wheel  512   9/23 13:02 ..
drwx------   2 postfix  wheel  512   9/23 13:02 active
drwx------   2 postfix  wheel  512   9/23 13:02 bounce
drwx------   2 postfix  wheel  512   9/23 13:02 corrupt
drwx------   2 postfix  wheel  512   9/23 13:02 defer
drwx------   2 postfix  wheel  512   9/23 13:02 deferred
drwx------   2 postfix  wheel  512   9/23 13:02 flush
drwx------   2 postfix  wheel  512   9/23 13:02 incoming
drwx-wx--T   2 postfix  wheel  512   9/23 13:02 maildrop
drwxr-xr-x   2 postfix  wheel  512   9/23 13:02 pid
drwx------   2 postfix  wheel  512   9/23 13:02 private
drwxr-xr-x   2 postfix  wheel  512   9/23 13:02 public
drwx------   2 postfix  wheel  512   9/23 13:02 saved
Comment 1 dwcjr 2001-09-23 06:33:36 UTC
> I suggest to run INSTALL.sh or put a default install.cf in post-install section
> or ${PKGINSTALL} script
I'd like to go for the second option, can you send me a patch?

-- 
David W. Chapman Jr.
dwcjr@inethouston.net	Raintree Network Services, Inc. <www.inethouston.net>
dwcjr@freebsd.org	FreeBSD Committer <www.FreeBSD.org>
Comment 2 Pete Fritchman freebsd_committer freebsd_triage 2001-09-23 08:41:12 UTC
Responsible Changed
From-To: freebsd-ports->dwcjr

Over to maintainer
Comment 3 Yen-Ming Lee 2001-09-23 13:06:41 UTC
On Sun, Sep 23, 2001 at 12:33:36AM -0500, David W. Chapman Jr. wrote:
> > I suggest to run INSTALL.sh or put a default install.cf in post-install section
> > or ${PKGINSTALL} script
> I'd like to go for the second option, can you send me a patch?

please check the following two patches, postfix.diff and postfix-current.diff

==== begin of postfix.diff
diff -ruN /usr/ports/mail/postfix/Makefile postfix/Makefile
--- /usr/ports/mail/postfix/Makefile	Sat Sep 15 00:03:31 2001
+++ postfix/Makefile	Sun Sep 23 20:02:16 2001
@@ -7,7 +7,7 @@
 
 PORTNAME=	postfix
 PORTVERSION=	20010228.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
 		ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/%SUBDIR%/ \
@@ -39,7 +39,7 @@
 	sample-filter.cf sample-flush.cf sample-local.cf sample-misc.cf \
 	sample-rate.cf sample-regexp.cf sample-relocated.cf \
 	sample-resource.cf sample-rewrite.cf sample-smtp.cf \
-	sample-smtpd.cf sample-transport.cf sample-virtual.cf
+	sample-smtpd.cf sample-transport.cf sample-virtual.cf install.cf
 
 BIN1=	bounce cleanup error flush lmtp local master pickup \
 	pipe qmgr showq smtp smtpd spawn trivial-rewrite
@@ -76,6 +76,9 @@
 .if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
 .include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
 .endif
+
+post-extract:
+	@${CP} ${FILESDIR}/install.cf ${WRKSRC}/conf
 
 post-patch:
 	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
diff -ruN /usr/ports/mail/postfix/files/install.cf postfix/files/install.cf
--- /usr/ports/mail/postfix/files/install.cf	Thu Jan  1 08:00:00 1970
+++ postfix/files/install.cf	Sun Sep 23 20:01:21 2001
@@ -0,0 +1,5 @@
+sendmail_path=/usr/sbin/sendmail
+newaliases_path=/usr/bin/newaliases
+mailq_path=/usr/bin/mailq
+setgid=maildrop
+manpages=!!PREFIX!!/man
diff -ruN /usr/ports/mail/postfix/pkg-plist postfix/pkg-plist
--- /usr/ports/mail/postfix/pkg-plist	Wed Jun  6 05:40:44 2001
+++ postfix/pkg-plist	Sun Sep 23 20:02:37 2001
@@ -1,6 +1,7 @@
 @unexec if cmp -s %D/etc/postfix/main.cf %D/etc/postfix/sample-main.cf; then rm -f %D/etc/postfix/main.cf; fi
 @unexec if cmp -s %D/etc/postfix/master.cf %D/etc/postfix/sample-master.cf; then rm -f %D/etc/postfix/master.cf; fi
 etc/postfix/LICENSE
+etc/postfix/install.cf
 etc/postfix/postfix-script
 etc/postfix/sample-access
 etc/postfix/sample-aliases
==== end of postfix.diff


==== begin of postfix-current.diff
diff -ruN /usr/ports/mail/postfix-current/Makefile postfix-current/Makefile
--- /usr/ports/mail/postfix-current/Makefile	Sat Sep 15 00:03:31 2001
+++ postfix-current/Makefile	Sun Sep 23 19:52:20 2001
@@ -7,7 +7,7 @@
 
 PORTNAME=	postfix
 PORTVERSION=	20010808
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/ \
 		ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/%SUBDIR%/ \
@@ -40,7 +40,7 @@
 	sample-qmqpd.cf \
 	sample-rate.cf sample-regexp.cf sample-relocated.cf \
 	sample-resource.cf sample-rewrite.cf sample-smtp.cf \
-	sample-smtpd.cf sample-transport.cf sample-virtual.cf
+	sample-smtpd.cf sample-transport.cf sample-virtual.cf install.cf
 
 BIN1=	bounce cleanup error flush lmtp local master nqmgr pickup \
 	pipe qmgr qmqpd showq smtp smtpd spawn trivial-rewrite virtual
@@ -76,6 +76,9 @@
 .if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
 .include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
 .endif
+
+post-extract:
+	@${CP} ${FILESDIR}/install.cf ${WRKSRC}/conf
 
 post-patch:
 	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
diff -ruN /usr/ports/mail/postfix-current/files/install.cf postfix-current/files/install.cf
--- /usr/ports/mail/postfix-current/files/install.cf	Thu Jan  1 08:00:00 1970
+++ postfix-current/files/install.cf	Sun Sep 23 19:49:23 2001
@@ -0,0 +1,5 @@
+sendmail_path=/usr/sbin/sendmail
+newaliases_path=/usr/bin/newaliases
+mailq_path=/usr/bin/mailq
+setgid=maildrop
+manpages=!!PREFIX!!/man
diff -ruN /usr/ports/mail/postfix-current/pkg-plist postfix-current/pkg-plist
--- /usr/ports/mail/postfix-current/pkg-plist	Wed Sep  5 12:02:26 2001
+++ postfix-current/pkg-plist	Sun Sep 23 18:55:35 2001
@@ -2,6 +2,7 @@
 @unexec if cmp -s %D/etc/postfix/master.cf %D/etc/postfix/sample-master.cf; then rm -f %D/etc/postfix/master.cf; fi
 bin/rmail
 etc/postfix/LICENSE
+etc/postfix/install.cf
 etc/postfix/postfix-script
 etc/postfix/sample-access
 etc/postfix/sample-aliases
==== end of postfix-current.diff

-- 
 Yen-Ming Lee [§õ«Û©ú]          | http://www.leeym.com/

"HP/UX is the worst OS for the hacker."	-- Mark Abene
Comment 4 dwcjr freebsd_committer freebsd_triage 2001-09-23 18:52:23 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 5 Yen-Ming Lee 2001-09-24 01:14:24 UTC
There are duplicated lines in {postfix,postfix-current}/files/install.cf,
please check it again.

--
 Yen-Ming Lee [§õ«Û©ú]          | http://www.leeym.com/

"Laziness, Impatience and Hubris", the three great virtues of a programmer
                                                 --Larry Wall