From owner-freebsd-ports-bugs@FreeBSD.ORG Tue May 19 21:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6129C1065670 for ; Tue, 19 May 2009 21:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB728FC1D for ; Tue, 19 May 2009 21:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n4JLU2kZ017134 for ; Tue, 19 May 2009 21:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n4JLU2u0017133; Tue, 19 May 2009 21:30:02 GMT (envelope-from gnats) Resent-Date: Tue, 19 May 2009 21:30:02 GMT Resent-Message-Id: <200905192130.n4JLU2u0017133@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yarema Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FF81065680; Tue, 19 May 2009 21:20:12 +0000 (UTC) (envelope-from yds@dppl.net) Received: from crake.dppl.net (mail.dppl.net [216.182.10.231]) by mx1.freebsd.org (Postfix) with ESMTP id B4BBD8FC16; Tue, 19 May 2009 21:20:11 +0000 (UTC) (envelope-from yds@dppl.net) Received: by crake.dppl.net (Postfix, from userid 1001) id 12A981E08; Tue, 19 May 2009 17:12:21 -0400 (EDT) Message-Id: <20090519211221.12A981E08@crake.dppl.net> Date: Tue, 19 May 2009 17:12:21 -0400 (EDT) From: Yarema To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Beech Rintoul , Sahil Tandon Subject: ports/134728: Refactoring of the mail/postfix port to ease maintenance X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Yarema List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 21:30:03 -0000 >Number: 134728 >Category: ports >Synopsis: Refactoring of the mail/postfix port to ease maintenance >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 19 21:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Yarema >Release: FreeBSD 7.2-STABLE amd64 >Organization: NYCBUG.org >Environment: System: FreeBSD 7.2-STABLE amd64 >Description: This patch is mostly a refactoring of mail/postfix to make it simpler to maintain and to bring it closer in line with hier(7). Delete: files/patch-conf::main.cf files/patch-conf::post-install files/patch-src::global::mail_params.h pkg-install pkg-message Add: files/pkg-install.in files/pkg-message.in The deleted patch-* files are replaced with the ${REINPLACE} macro in the Makefile which performs the same edits as the patch files did and then some to bring the installed config and doc files closer to the way things are actually installed. The WITH_VDA section now uses ${PORTVERSION} instead of hardcoding. And the VDA_README is now installed when appropriate. The duplication of parameters to postfix-install in the do-install target and to libexec/postfix/post-install in the pkg-install script is replaced with compile time DEFs in the POSTFIX_CCARGS macro as per section 4.4 of the INSTALL documentation. Files previously installed in ${PREFIX}/etc/postfix/dist now go in ${EXAMPLESDIR} as per hier(7). To install and test the attached diff: cd /usr/ports/mail/postfix patch -p1 < path_to_diff/postfix.diff find . -type f \( -size 0c -o -name \*.orig \) -delete >How-To-Repeat: cd /usr/ports/mail/postfix && make install >Fix: diff -u -r -N postfix-2.6.0/Makefile postfix/Makefile --- postfix-2.6.0/Makefile 2009-05-19 03:42:00.000000000 -0400 +++ postfix/Makefile 2009-05-19 16:03:53.509256834 -0400 @@ -7,6 +7,7 @@ PORTNAME= postfix PORTVERSION= 2.6.0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= mail ipv6 MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \ @@ -76,8 +77,8 @@ bounce.8 trace.8 \ smtp.8 lmtp.8 -CONF1= access aliases canonical generic header_checks main.cf master.cf \ - relocated transport virtual +PORTEXAMPLES= access aliases canonical generic header_checks \ + main.cf master.cf relocated transport virtual .if !defined(DEBUG) MAKEFILEFLAGS+= DEBUG= @@ -85,14 +86,26 @@ MAKEFILEFLAGS+= CC="${CC}" OPT="${CFLAGS}" -SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ - TOUCH="${TOUCH}" \ - MKDIR="${MKDIR}" - .include +POSTFIX_CCARGS+= -DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \ + -DDEF_SAMPLE_DIR=\\\"${EXAMPLESDIR}\\\" \ + -DDEF_DAEMON_DIR=\\\"${PREFIX}/libexec/postfix\\\" \ + -DDEF_COMMAND_DIR=\\\"${PREFIX}/sbin\\\" \ + -DDEF_SENDMAIL_PATH=\\\"${PREFIX}/sbin/sendmail\\\" \ + -DDEF_NEWALIAS_PATH=\\\"${PREFIX}/bin/newaliases\\\" \ + -DDEF_MAILQ_PATH=\\\"${PREFIX}/bin/mailq\\\" \ + -DDEF_MANPAGE_DIR=\\\"${MANPREFIX}/man\\\" \ + -DDEF_README_DIR=\\\"${READMEDIR}\\\" \ + -DDEF_HTML_DIR=\\\"${READMEDIR}\\\" \ + -DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" \ + -DDEF_DATA_DIR=\\\"/var/db/postfix\\\" \ + -DDEF_MAIL_OWNER=\\\"postfix\\\" \ + -DDEF_SGID_GROUP=\\\"maildrop\\\" \ + -DALIAS_DB_MAP=\\\"hash:/etc/mail/aliases\\\" + # Default requirement for postfix rc script -_REQUIRE= LOGIN cleanvar +_REQUIRE= LOGIN cleanvar .if defined(WITH_PCRE) LIB_DEPENDS+= pcre.0:${PORTSDIR}/devel/pcre @@ -111,6 +124,7 @@ .if defined(WITH_DOVECOT) RUN_DEPENDS+= dovecot:${PORTSDIR}/mail/dovecot POSTFIX_CCARGS+= -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\" +_REQUIRE+= dovecot .endif .if defined(WITH_SASLKRB) @@ -185,26 +199,47 @@ .if defined(WITH_VDA) IGNORE= wait for a new VDA patch that works with 2.6.0 PATCH_SITES+= http://vda.sourceforge.net/VDA/ -PATCHFILES+= postfix-2.5.6-vda-ng.patch.gz +PATCHFILES+= postfix-${PORTVERSION}-vda-ng.patch.gz PATCH_DIST_STRIP= -p1 +PLIST_SUB+= VDA="" +.else +PLIST_SUB+= VDA="@comment " .endif .if defined(WITH_TEST) BINTEST= qmqp-sink qmqp-source smtp-sink smtp-source MANTEST= qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1 MAN1+= ${MANTEST} -PLIST_SUB+= SUB_TEST="" +PLIST_SUB+= TEST="" .else -PLIST_SUB+= SUB_TEST="@comment " +PLIST_SUB+= TEST="@comment " .endif .if defined(NOPORTDOCS) READMEDIR=no .else -READMEDIR=${PREFIX}/share/doc/postfix +READMEDIR=${DOCSDIR} .endif -SUB_LIST+= REQUIRE="${_REQUIRE}" +SUB_LIST+= REQUIRE="${_REQUIRE}" READMEDIR="${READMEDIR}" +SUB_FILES+= pkg-install pkg-message + +# sed script for files in ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man +REINPLACE= s!^PATH=.*!PATH=/bin:/sbin:/usr/bin:/usr/sbin:${PREFIX}/bin:${PREFIX}/sbin!;\ + s!(_directory = )/usr/!\1${PREFIX}/!g;\ + s!^(data_directory = /var/)lib/!\1db/!g;\ + s!^\#(mynetworks_style = host)!\1!g;\ + s!^(sendmail_path =)!\1 ${PREFIX}/sbin/sendmail!g;\ + s!^(newaliases_path =)!\1 ${PREFIX}/bin/newaliases!g;\ + s!^(mailq_path =)!\1 ${PREFIX}/bin/mailq!g;\ + s!^(setgid_group =)!\1 maildrop!g;\ + s!^(manpage_directory =)!\1 ${PREFIX}/man!g;\ + s!^(sample_directory =)!\1 ${EXAMPLESDIR}!g;\ + s!^((html|readme)_directory =)!\1 ${READMEDIR}!g;\ + \!^\#alias_database = dbm:/etc/mail/aliases$$!d;\ + s!/etc/aliases!/etc/mail/aliases!g;\ + s!(:|= )/etc/postfix!\1$$config_directory!g;\ + s!/etc/postfix!${ETCDIR}!g; pre-patch: .if defined(POSTFIX_OPTIONS) @@ -233,20 +268,23 @@ fi .endif - @${ECHO} "See header_checks.5.html" \ + @${ECHO} 'See header_checks.5.html' \ > ${WRKSRC}/html/body_checks.5.html - @${FIND} -P ${WRKSRC}/man -type f | ${XARGS} \ - ${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g" - @${FIND} -P ${WRKSRC}/README_FILES -type f | ${XARGS} \ - ${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g" - @${FIND} -P ${WRKSRC}/conf -type f | ${XARGS} \ - ${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g" + @${REINPLACE_CMD} -E -e 's![[:<:]]perl[[:>:]]!${PERL}!' \ + ${WRKSRC}/src/bounce/Makefile.in + @${REINPLACE_CMD} -E -e 's!^(#define DEF_SGID_GROUP[^"]+)"postdrop"$$!\1"maildrop"!' \ + ${WRKSRC}/src/global/mail_params.h + @${FIND} -X ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man \ + -type f -a ! \( -name INSTALL -o -name aliases \) | ${XARGS} \ + ${REINPLACE_CMD} -E -e '${REINPLACE}' post-patch: -# All files modified with ${FILESDIR}/patch-* to use !!PREFIX!! need REINPLACE. Put below. - @${REINPLACE_CMD} -e "s,!!PREFIX!!,${PREFIX},g" \ - ${WRKSRC}/conf/main.cf ${WRKSRC}/src/global/mail_params.h - @${REINPLACE_CMD} -e "s|perl|${PERL}|" ${WRKSRC}/src/bounce/Makefile.in +.if defined(WITH_VDA) + @${ECHO} '$$readme_directory/VDA_README:f:root:-:644' \ + >> ${WRKSRC}/conf/postfix-files + @${REINPLACE_CMD} -E -e '${REINPLACE}' \ + ${WRKSRC}/README_FILES/VDA_README +.endif do-configure: (cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \ @@ -257,49 +295,33 @@ @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: - cd ${WRKSRC}; ${SH} postfix-install -non-interactive install_root=/ tempdir=/tmp \ - config_directory=${PREFIX}/etc/postfix \ - data_directory=/var/db/postfix \ - daemon_directory=${PREFIX}/libexec/postfix \ - command_directory=${PREFIX}/sbin \ - queue_directory=/var/spool/postfix \ - sendmail_path=${PREFIX}/sbin/sendmail \ - newaliases_path=${PREFIX}/bin/newaliases \ - mailq_path=${PREFIX}/bin/mailq \ - mail_owner=postfix \ - setgid_group=maildrop \ - manpage_directory=${MANPREFIX}/man \ - sample_directory=${PREFIX}/etc/postfix \ - readme_directory=${READMEDIR} - + @cd ${WRKSRC} && ${SH} postfix-install -non-interactive install_root=/ tempdir=/tmp ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${PREFIX}/bin/rmail - ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MANPREFIX}/man/man1 - .for f in ${BINTEST} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin .endfor .for f in ${MANTEST} ${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MANPREFIX}/man/man1 .endfor - - @${MKDIR} ${PREFIX}/etc/postfix/dist -.for f in ${CONF1} - ${INSTALL_DATA} ${WRKSRC}/conf/${f} ${PREFIX}/etc/postfix/dist -.endfor - .if !defined(NOPORTDOCS) - ${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCSDIR} + ${INSTALL} -o ${DOCOWN} -g ${DOCGRP} -m 555 -d ${DOCSDIR} @cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.jpg *.png ${DOCSDIR} && \ ${ECHO_MSG} "Installed HTML documentation in ${DOCSDIR}" .endif +.if !defined(NOPORTEXAMPLES) + ${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m 555 -d ${EXAMPLESDIR} +.for f in ${PORTEXAMPLES} + ${INSTALL_DATA} ${WRKSRC}/conf/${f} ${EXAMPLESDIR} +.endfor + @${ECHO_MSG} "Installed configuration examples in ${EXAMPLESDIR}" +.endif post-install: @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL -# Fix compressed man pages - @${REINPLACE_CMD} -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${PREFIX}/libexec/postfix/postfix-files - @${RM} -f ${PREFIX}/libexec/postfix/postfix-files.bak + # Fix compressed man pages + @${REINPLACE_CMD} -i '' -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${PREFIX}/libexec/postfix/postfix-files @${CAT} ${PKGMESSAGE} .include diff -u -r -N postfix-2.6.0/files/patch-conf::main.cf postfix/files/patch-conf::main.cf --- postfix-2.6.0/files/patch-conf::main.cf 2008-02-29 20:44:30.000000000 -0500 +++ postfix/files/patch-conf::main.cf 1969-12-31 19:00:00.000000000 -0500 @@ -1,80 +0,0 @@ ---- conf/main.cf.orig 2007-12-18 11:50:25.000000000 -0200 -+++ conf/main.cf 2008-02-29 22:35:12.000000000 -0300 -@@ -33,19 +33,19 @@ - # The command_directory parameter specifies the location of all - # postXXX commands. - # --command_directory = /usr/sbin -+command_directory = !!PREFIX!!/sbin - - # The daemon_directory parameter specifies the location of all Postfix - # daemon programs (i.e. programs listed in the master.cf file). This - # directory must be owned by root. - # --daemon_directory = /usr/libexec/postfix -+daemon_directory = !!PREFIX!!/libexec/postfix - - # The data_directory parameter specifies the location of Postfix-writable - # data files (caches, random numbers). This directory must be owned - # by the mail_owner account (see below). - # --data_directory = /var/lib/postfix -+data_directory = /var/db/postfix - - # QUEUE AND PROCESS OWNERSHIP - # -@@ -244,7 +244,7 @@ - # - #mynetworks_style = class - #mynetworks_style = subnet --#mynetworks_style = host -+mynetworks_style = host - - # Alternatively, you can specify the mynetworks list by hand, in - # which case Postfix ignores the mynetworks_style setting. -@@ -615,37 +615,37 @@ - # sendmail_path: The full pathname of the Postfix sendmail command. - # This is the Sendmail-compatible mail posting interface. - # --sendmail_path = -+sendmail_path = !!PREFIX!!/sbin/sendmail - - # newaliases_path: The full pathname of the Postfix newaliases command. - # This is the Sendmail-compatible command to build alias databases. - # --newaliases_path = -+newaliases_path = !!PREFIX!!/bin/newaliases - - # mailq_path: The full pathname of the Postfix mailq command. This - # is the Sendmail-compatible mail queue listing command. - # --mailq_path = -+mailq_path = !!PREFIX!!/bin/mailq - - # setgid_group: The group for mail submission and queue management - # commands. This must be a group name with a numerical group ID that - # is not shared with other accounts, not even with the Postfix account. - # --setgid_group = -+setgid_group = maildrop - - # html_directory: The location of the Postfix HTML documentation. - # --html_directory = -+html_directory = no - - # manpage_directory: The location of the Postfix on-line manual pages. - # --manpage_directory = -+manpage_directory = !!PREFIX!!/man - - # sample_directory: The location of the Postfix sample configuration files. - # This parameter is obsolete as of Postfix 2.1. - # --sample_directory = -+sample_directory = !!PREFIX!!/etc/postfix - - # readme_directory: The location of the Postfix README files. - # --readme_directory = -+readme_directory = no diff -u -r -N postfix-2.6.0/files/patch-conf::post-install postfix/files/patch-conf::post-install --- postfix-2.6.0/files/patch-conf::post-install 2005-03-19 18:17:54.000000000 -0500 +++ postfix/files/patch-conf::post-install 1969-12-31 19:00:00.000000000 -0500 @@ -1,11 +0,0 @@ ---- conf/post-install.orig Thu Feb 24 08:06:08 2005 -+++ conf/post-install Sat Mar 5 11:53:42 2005 -@@ -185,7 +185,7 @@ - - umask 022 - --PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd -+PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin - SHELL=/bin/sh - IFS=" - " diff -u -r -N postfix-2.6.0/files/patch-makedefs postfix/files/patch-makedefs --- postfix-2.6.0/files/patch-makedefs 2007-10-22 14:39:39.000000000 -0400 +++ postfix/files/patch-makedefs 2009-05-11 17:26:46.000000000 -0400 @@ -1,12 +1,10 @@ ---- makedefs.orig 2007-03-24 10:30:18.000000000 -0300 -+++ makedefs 2007-10-22 16:18:48.000000000 -0200 -@@ -130,6 +130,10 @@ +--- makedefs.orig 2009-05-11 17:26:46.000000000 -0400 ++++ makedefs 2009-05-11 17:26:46.000000000 -0400 +@@ -144,6 +144,8 @@ ;; - FreeBSD.6*) SYSTYPE=FREEBSD6 + FreeBSD.7*) SYSTYPE=FREEBSD7 ;; -+ FreeBSD.7*) SYSTYPE=FREEBSD6 -+ ;; -+ FreeBSD.8*) SYSTYPE=FREEBSD6 ++ FreeBSD.8*) SYSTYPE=FREEBSD7 + ;; OpenBSD.2*) SYSTYPE=OPENBSD2 ;; diff -u -r -N postfix-2.6.0/files/patch-src::global::mail_params.h postfix/files/patch-src::global::mail_params.h --- postfix-2.6.0/files/patch-src::global::mail_params.h 2008-07-14 22:54:32.000000000 -0400 +++ postfix/files/patch-src::global::mail_params.h 1969-12-31 19:00:00.000000000 -0500 @@ -1,38 +0,0 @@ ---- src/global/mail_params.h.orig Mon Jun 30 18:57:48 2008 -+++ src/global/mail_params.h Mon Jun 30 19:00:05 2008 -@@ -67,7 +67,7 @@ - extern gid_t var_owner_gid; - - #define VAR_SGID_GROUP "setgid_group" --#define DEF_SGID_GROUP "postdrop" -+#define DEF_SGID_GROUP "maildrop" - extern char *var_sgid_group; - extern gid_t var_sgid_gid; - -@@ -241,7 +241,7 @@ - */ - #define VAR_DAEMON_DIR "daemon_directory" - #ifndef DEF_DAEMON_DIR --#define DEF_DAEMON_DIR "/usr/libexec/postfix" -+#define DEF_DAEMON_DIR "!!PREFIX!!/libexec/postfix" - #endif - extern char *var_daemon_dir; - -@@ -265,7 +265,7 @@ - */ - #define VAR_DATA_DIR "data_directory" - #ifndef DEF_DATA_DIR --#define DEF_DATA_DIR "/var/lib/postfix" -+#define DEF_DATA_DIR "/var/db/postfix" - #endif - extern char *var_data_dir; - -@@ -279,7 +279,7 @@ - */ - #define VAR_CONFIG_DIR "config_directory" - #ifndef DEF_CONFIG_DIR --#define DEF_CONFIG_DIR "/etc/postfix" -+#define DEF_CONFIG_DIR "!!PREFIX!!/etc/postfix" - #endif - extern char *var_config_dir; - diff -u -r -N postfix-2.6.0/files/pkg-install.in postfix/files/pkg-install.in --- postfix-2.6.0/files/pkg-install.in 1969-12-31 19:00:00.000000000 -0500 +++ postfix/files/pkg-install.in 2009-05-19 12:24:22.932201869 -0400 @@ -0,0 +1,153 @@ +#!/bin/sh +# +# $FreeBSD: ports/mail/postfix/pkg-install,v 1.27 2009/05/18 14:36:33 pav Exp $ +# + +# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it +# will make the port/package use defaults which make postfix replace +# sendmail as much as possible. + +PREFIX=${PKG_PREFIX:=%%PREFIX%%} +ETCDIR=${ETCDIR:=%%ETCDIR%%} +READMEDIR=${READMEDIR:=%%READMEDIR%%} +EXAMPLESDIR=${EXAMPLESDIR:=%%EXAMPLESDIR%%} +BATCH=${BATCH:=no} +POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no} + +if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then + DEFAULT_REPLACE_MAILERCONF=n +else + DEFAULT_REPLACE_MAILERCONF=y +fi + +if [ -x /usr/sbin/nologin ]; then + NOLOGIN=/usr/sbin/nologin +else + NOLOGIN=/sbin/nologin +fi + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" -a "${BATCH}" = "no" ]; then + read -p "${question} [${default}]? " answer + fi + if [ -z "${answer}" ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local question default answer + + question=$1 + default=$2 + while :; do + answer=$(ask "${question}" "${default}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +if [ "$2" = "PRE-INSTALL" ]; then + USER=postfix + UID=125 + GROUP=postfix + GID=125 + GROUP2=maildrop + GID2=126 + + if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then + echo "You already have a group \"${GROUP2}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then + echo "Added group \"${GROUP2}\"." + else + echo "Adding group \"${GROUP2}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then + echo "You already have user \"${USER}\" in group \"mail\", so I will use it." + else + echo "You need user \"${USER}\" added to group \"mail\"." + if yesno "Would you like me to add it" y; then + /usr/sbin/pw groupmod mail -m ${USER} || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi +fi + +if [ "$2" = "POST-INSTALL" ]; then + if [ -d ${EXAMPLESDIR} ]; then + for file in ${EXAMPLESDIR}/*; do + if [ ! -f ${ETCDIR}/${file#${EXAMPLESDIR}} ]; then + cp $file ${ETCDIR}/ + fi + done + fi + /bin/sh ${PREFIX}/libexec/postfix/post-install tempdir=/tmp upgrade-package +fi + +replace() { + local orig repl + + orig=$1 + repl=$2 + if [ -e ${orig} ]; then + /bin/mv -f ${orig} ${orig}.OFF + /bin/chmod 0 ${orig}.OFF + fi + if [ -e ${repl} ]; then + /bin/ln -s ${repl} ${orig} + fi +} + +if [ "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" ]; then + if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then + /bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old + echo "#" > /etc/mail/mailer.conf + echo -n "# Execute the Postfix sendmail program" >> /etc/mail/mailer.conf + echo ", named ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + echo "#" >> /etc/mail/mailer.conf + echo "sendmail ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + echo "send-mail ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + echo "mailq ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + echo "newaliases ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf + fi +fi diff -u -r -N postfix-2.6.0/files/pkg-message.in postfix/files/pkg-message.in --- postfix-2.6.0/files/pkg-message.in 1969-12-31 19:00:00.000000000 -0500 +++ postfix/files/pkg-message.in 2009-05-19 11:24:34.000000000 -0400 @@ -0,0 +1,25 @@ +To enable postfix startup script please add postfix_enable="YES" in +your rc.conf + +If you not need sendmail anymore, please add in your rc.conf: + +sendmail_enable="NO" +sendmail_submit_enable="NO" +sendmail_outbound_enable="NO" +sendmail_msp_queue_enable="NO" + +And you can disable some sendmail specific daily maintenance routines in your +/etc/periodic.conf file: + +daily_clean_hoststat_enable="NO" +daily_status_mail_rejects_enable="NO" +daily_status_include_submit_mailq="NO" +daily_submit_queuerun="NO" + +If you are using SASL, you need to make sure that postfix has access to read +the sasldb file. This is accomplished by adding postfix to group mail and +making the %%PREFIX%%/etc/sasldb* file(s) readable by group mail (this should +be the default for new installs). + +If you are upgrading from postfix version prior to 2.0, please see the README +files for recommended changes to your configuration. diff -u -r -N postfix-2.6.0/files/postfix.sh.in postfix/files/postfix.sh.in --- postfix-2.6.0/files/postfix.sh.in 2007-02-21 00:00:56.000000000 -0500 +++ postfix/files/postfix.sh.in 2009-05-19 10:54:01.000000000 -0400 @@ -25,10 +25,10 @@ load_rc_config $name -: ${postfix_enable="NO"} -: ${postfix_pidfile="/var/spool/postfix/pid/master.pid"} -: ${postfix_procname="%%PREFIX%%/libexec/postfix/master"} -: ${postfix_flags=""} +: ${postfix_enable:="NO"} +: ${postfix_pidfile:="/var/spool/postfix/pid/master.pid"} +: ${postfix_procname:="%%PREFIX%%/libexec/postfix/master"} +: ${postfix_flags:=""} start_cmd=${name}_start stop_cmd=${name}_stop diff -u -r -N postfix-2.6.0/pkg-install postfix/pkg-install --- postfix-2.6.0/pkg-install 2009-05-19 03:42:00.000000000 -0400 +++ postfix/pkg-install 1969-12-31 19:00:00.000000000 -0500 @@ -1,167 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/mail/postfix/pkg-install,v 1.27 2009/05/18 14:36:33 pav Exp $ -# - -# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it -# will make the port/package use defaults which make postfix replace -# sendmail as much as possible. - -PKG_PREFIX=${PKG_PREFIX:=/usr/local} -BATCH=${BATCH:=no} -POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no} - -if [ x${POSTFIX_DEFAULT_MTA} = xno ]; then - DEFAULT_REPLACE_MAILERCONF=n -else - DEFAULT_REPLACE_MAILERCONF=y -fi - -if [ -x /usr/sbin/nologin ]; then - NOLOGIN=/usr/sbin/nologin -else - NOLOGIN=/sbin/nologin -fi - -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local question default answer - - question=$1 - default=$2 - while :; do - answer=$(ask "${question}" "${default}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -if [ x"$2" = xPRE-INSTALL ]; then - USER=postfix - UID=125 - GROUP=postfix - GID=125 - GROUP2=maildrop - GID2=126 - - if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then - echo "You already have a group \"${GROUP2}\", so I will use it." - else - if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then - echo "Added group \"${GROUP2}\"." - else - echo "Adding group \"${GROUP2}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then - echo "You already have user \"${USER}\" in group \"mail\", so I will use it." - else - echo "You need user \"${USER}\" added to group \"mail\"." - if yesno "Would you like me to add it" y; then - /usr/sbin/pw groupmod mail -m ${USER} || exit - echo "Done." - else - echo "Please create it, and try again." - exit 1 - fi - fi -fi - -if [ x"$2" = xPOST-INSTALL ]; then - if [ -d ${PKG_PREFIX}/etc/postfix/dist ]; then - for file in ${PKG_PREFIX}/etc/postfix/dist/*; do - if [ ! -f ${PKG_PREFIX}/etc/postfix/${file#${PKG_PREFIX}/etc/postfix/dist} ]; then - cp $file ${PKG_PREFIX}/etc/postfix/ - fi - done - fi - - /bin/sh ${PKG_PREFIX}/libexec/postfix/post-install tempdir=/tmp \ - config_directory=${PKG_PREFIX}/etc/postfix \ - data_directory=/var/db/postfix \ - daemon_directory=${PKG_PREFIX}/libexec/postfix \ - command_directory=${PKG_PREFIX}/sbin \ - queue_directory=/var/spool/postfix \ - sendmail_path=${PKG_PREFIX}/sbin/sendmail \ - newaliases_path=${PKG_PREFIX}/bin/newaliases \ - mailq_path=${PKG_PREFIX}/bin/mailq \ - mail_owner=postfix \ - setgid_group=maildrop \ - manpage_directory=${PKG_PREFIX}/man \ - sample_directory=${PKG_PREFIX}/etc/postfix \ - readme_directory=no \ - upgrade-package -fi -# readme_directory is "no" above since the package will have correct perms -# already, and we don't know if they had PORTDOCS. - -replace() { - local orig repl - - orig=$1 - repl=$2 - if [ -e ${orig} ]; then - /bin/mv -f ${orig} ${orig}.OFF - /bin/chmod 0 ${orig}.OFF - fi - if [ -e ${repl} ]; then - /bin/ln -s ${repl} ${orig} - fi -} - -if [ x"$2" = xPOST-INSTALL -a -z "${PACKAGE_BUILDING}" ]; then - if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then - /bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old - echo "#" > /etc/mail/mailer.conf - echo -n "# Execute the Postfix sendmail program" >> /etc/mail/mailer.conf - echo ", named ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "#" >> /etc/mail/mailer.conf - echo "sendmail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "send-mail ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "mailq ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - echo "newaliases ${PKG_PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf - fi -fi diff -u -r -N postfix-2.6.0/pkg-message postfix/pkg-message --- postfix-2.6.0/pkg-message 2006-07-19 15:21:35.000000000 -0400 +++ postfix/pkg-message 1969-12-31 19:00:00.000000000 -0500 @@ -1,25 +0,0 @@ -To enable postfix startup script please add postfix_enable="YES" in -your rc.conf - -If you not need sendmail anymore, please add in your rc.conf: - -sendmail_enable="NO" -sendmail_submit_enable="NO" -sendmail_outbound_enable="NO" -sendmail_msp_queue_enable="NO" - -And you can disable some sendmail specific daily maintenance routines in your -/etc/periodic.conf file: - -daily_clean_hoststat_enable="NO" -daily_status_mail_rejects_enable="NO" -daily_status_include_submit_mailq="NO" -daily_submit_queuerun="NO" - -If you are using SASL, you need to make sure that postfix has access to read -the sasldb file. This is accomplished by adding postfix to group mail and -making the /usr/local/etc/sasldb* file(s) readable by group mail (this should -be the default for new installs). - -If you are upgrading from postfix version prior to 2.0, please see the README -files for recommended changes to your configuration. diff -u -r -N postfix-2.6.0/pkg-plist postfix/pkg-plist --- postfix-2.6.0/pkg-plist 2009-05-19 03:42:00.000000000 -0400 +++ postfix/pkg-plist 2009-05-19 12:10:49.163508264 -0400 @@ -1,28 +1,19 @@ -@unexec if cmp -s %D/etc/postfix/main.cf %D/etc/postfix/dist/main.cf; then rm -f %D/etc/postfix/main.cf; fi -@unexec if cmp -s %D/etc/postfix/master.cf %D/etc/postfix/dist/master.cf; then rm -f %D/etc/postfix/master.cf; fi -@unexec if cmp -s %D/etc/postfix/access %D/etc/postfix/dist/access; then rm -f %D/etc/postfix/access; fi -@unexec if cmp -s %D/etc/postfix/aliases %D/etc/postfix/dist/aliases; then rm -f %D/etc/postfix/aliases; fi -@unexec if cmp -s %D/etc/postfix/canonical %D/etc/postfix/dist/canonical; then rm -f %D/etc/postfix/canonical; fi -@unexec if cmp -s %D/etc/postfix/header_checks %D/etc/postfix/dist/header_checks; then rm -f %D/etc/postfix/header_checks; fi -@unexec if cmp -s %D/etc/postfix/relocated %D/etc/postfix/dist/relocated; then rm -f %D/etc/postfix/relocated; fi -@unexec if cmp -s %D/etc/postfix/transport %D/etc/postfix/dist/transport; then rm -f %D/etc/postfix/transport; fi -@unexec if cmp -s %D/etc/postfix/virtual %D/etc/postfix/dist/virtual; then rm -f %D/etc/postfix/virtual; fi -@unexec if cmp -s %D/etc/postfix/generic %D/etc/postfix/dist/generic; then rm -f %D/etc/postfix/generic; fi -etc/postfix/LICENSE -etc/postfix/TLS_LICENSE -etc/postfix/bounce.cf.default -etc/postfix/main.cf.default -etc/postfix/makedefs.out -etc/postfix/dist/main.cf -etc/postfix/dist/master.cf -etc/postfix/dist/access -etc/postfix/dist/aliases -etc/postfix/dist/canonical -etc/postfix/dist/header_checks -etc/postfix/dist/relocated -etc/postfix/dist/transport -etc/postfix/dist/virtual -etc/postfix/dist/generic +@unexec if cmp -s %D/%%EXAMPLESDIR%%/main.cf %D/%%ETCDIR%%/main.cf; then rm -f %D/%%ETCDIR%%/main.cf; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/master.cf %D/%%ETCDIR%%/master.cf; then rm -f %D/%%ETCDIR%%/master.cf; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/access %D/%%ETCDIR%%/access; then rm -f %D/%%ETCDIR%%/access; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/aliases %D/%%ETCDIR%%/aliases; then rm -f %D/%%ETCDIR%%/aliases; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/canonical %D/%%ETCDIR%%/canonical; then rm -f %D/%%ETCDIR%%/canonical; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/header_checks %D/%%ETCDIR%%/header_checks; then rm -f %D/%%ETCDIR%%/header_checks; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/relocated %D/%%ETCDIR%%/relocated; then rm -f %D/%%ETCDIR%%/relocated; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/transport %D/%%ETCDIR%%/transport; then rm -f %D/%%ETCDIR%%/transport; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/virtual %D/%%ETCDIR%%/virtual; then rm -f %D/%%ETCDIR%%/virtual; fi +@unexec if cmp -s %D/%%EXAMPLESDIR%%/generic %D/%%ETCDIR%%/generic; then rm -f %D/%%ETCDIR%%/generic; fi +%%ETCDIR%%/LICENSE +%%ETCDIR%%/TLS_LICENSE +%%ETCDIR%%/bounce.cf.default +%%ETCDIR%%/main.cf.default +%%ETCDIR%%/makedefs.out +@dirrmtry %%ETCDIR%% libexec/postfix/anvil libexec/postfix/bounce libexec/postfix/cleanup @@ -55,6 +46,15 @@ libexec/postfix/verify libexec/postfix/virtual libexec/postfix/tlsmgr +@dirrm libexec/postfix +bin/mailq +bin/newaliases +bin/qshape +bin/rmail +%%TEST%%bin/qmqp-sink +%%TEST%%bin/qmqp-source +%%TEST%%bin/smtp-sink +%%TEST%%bin/smtp-source sbin/postalias sbin/postcat sbin/postconf @@ -68,14 +68,6 @@ sbin/postqueue sbin/postsuper sbin/sendmail -%%SUB_TEST%%bin/qmqp-sink -%%SUB_TEST%%bin/qmqp-source -%%SUB_TEST%%bin/smtp-sink -%%SUB_TEST%%bin/smtp-source -bin/rmail -bin/qshape -bin/newaliases -bin/mailq %%PORTDOCS%%%%DOCSDIR%%/AAAREADME %%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README %%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README.html @@ -164,6 +156,7 @@ %%PORTDOCS%%%%DOCSDIR%%/ULTRIX_README %%PORTDOCS%%%%DOCSDIR%%/UUCP_README %%PORTDOCS%%%%DOCSDIR%%/UUCP_README.html +%%VDA%%%%PORTDOCS%%%%DOCSDIR%%/VDA_README %%PORTDOCS%%%%DOCSDIR%%/VERP_README %%PORTDOCS%%%%DOCSDIR%%/VERP_README.html %%PORTDOCS%%%%DOCSDIR%%/VIRTUAL_README @@ -244,6 +237,3 @@ %%PORTDOCS%%%%DOCSDIR%%/tlsmgr.8.html %%PORTDOCS%%%%DOCSDIR%%/generic.5.html %%PORTDOCS%%@dirrm %%DOCSDIR%% -@dirrm libexec/postfix -@dirrm etc/postfix/dist -@dirrmtry etc/postfix >Release-Note: >Audit-Trail: >Unformatted: