aboutsummaryrefslogtreecommitdiffstats
path: root/mail/postfix28
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2009-05-26 21:36:08 +0800
committernetchild <netchild@FreeBSD.org>2009-05-26 21:36:08 +0800
commit188a5e041552dda4aa43d356f4491a1b79518beb (patch)
tree29b9a0758fa7934b52cdc9745d75fae429624554 /mail/postfix28
parent67538c2c77f4b4fa3680d0aa0563add66ab150f5 (diff)
downloadfreebsd-ports-gnome-188a5e041552dda4aa43d356f4491a1b79518beb.tar.gz
freebsd-ports-gnome-188a5e041552dda4aa43d356f4491a1b79518beb.tar.zst
freebsd-ports-gnome-188a5e041552dda4aa43d356f4491a1b79518beb.zip
- refactor the port to ease maintenance [1]
- update to 2.6.1 [1] - remove IGNORE in the VDA case, the patch is available now [2] [2] is from me (compile tested), maintainer informed. PR: 134728 [1] Submitted by: Yarema <yds@CoolRat.org> [1] Approved by: maintainer [1]
Diffstat (limited to 'mail/postfix28')
-rw-r--r--mail/postfix28/Makefile124
-rw-r--r--mail/postfix28/distinfo9
-rw-r--r--mail/postfix28/files/patch-conf::main.cf80
-rw-r--r--mail/postfix28/files/patch-conf::post-install11
-rw-r--r--mail/postfix28/files/patch-makedefs12
-rw-r--r--mail/postfix28/files/patch-src::global::mail_params.h38
-rw-r--r--mail/postfix28/files/pkg-install.in156
-rw-r--r--mail/postfix28/files/pkg-message.in (renamed from mail/postfix28/pkg-message)2
-rw-r--r--mail/postfix28/files/postfix.sh.in8
-rw-r--r--mail/postfix28/pkg-install167
-rw-r--r--mail/postfix28/pkg-plist62
11 files changed, 270 insertions, 399 deletions
diff --git a/mail/postfix28/Makefile b/mail/postfix28/Makefile
index aeeab324d49c..aa1888d89eb6 100644
--- a/mail/postfix28/Makefile
+++ b/mail/postfix28/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= postfix
-PORTVERSION= 2.6.0
+PORTVERSION= 2.6.1
PORTEPOCH= 1
CATEGORIES= mail ipv6
MASTER_SITES= ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
@@ -76,8 +76,8 @@ MLINKS= sendmail.1 mailq.1 \
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 +85,26 @@ MAKEFILEFLAGS+= DEBUG=
MAKEFILEFLAGS+= CC="${CC}" OPT="${CFLAGS}"
-SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
- TOUCH="${TOUCH}" \
- MKDIR="${MKDIR}"
-
.include <bsd.port.pre.mk>
+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 +123,7 @@ POSTFIX_AUXLIBS+= -L${LOCALBASE}/lib -lsasl2 -lpam -lcrypt
.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)
@@ -183,28 +196,48 @@ _REQUIRE+= ypserv
.endif
.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 +266,23 @@ pre-patch:
fi
.endif
- @${ECHO} "<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>" \
+ @${ECHO} '<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></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 +293,33 @@ pre-su-install:
@${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 <bsd.port.post.mk>
diff --git a/mail/postfix28/distinfo b/mail/postfix28/distinfo
index b68d507d61d9..9e834e84ef51 100644
--- a/mail/postfix28/distinfo
+++ b/mail/postfix28/distinfo
@@ -1,3 +1,6 @@
-MD5 (postfix/postfix-2.6.0.tar.gz) = 3674618dab2734f49182b8cba2f3186e
-SHA256 (postfix/postfix-2.6.0.tar.gz) = 8c323d200feba72121c302f15249d56c7521ade16cf5166fadf158e6818883bd
-SIZE (postfix/postfix-2.6.0.tar.gz) = 3324014
+MD5 (postfix/postfix-2.6.1.tar.gz) = 737bbc245da9c72c174893397f70ae86
+SHA256 (postfix/postfix-2.6.1.tar.gz) = ccad7fb855e31c57f3551244b76be5906fcdcde09d5a6ccd144ae144e1df203c
+SIZE (postfix/postfix-2.6.1.tar.gz) = 3324194
+MD5 (postfix/postfix-2.6.1-vda-ng.patch.gz) = 33d62623badc3f754ac9620e3ed2c3b8
+SHA256 (postfix/postfix-2.6.1-vda-ng.patch.gz) = cbc924891385b1ca7ca82b5bce89b9eadac53eca772c1291db1307b8a2eef720
+SIZE (postfix/postfix-2.6.1-vda-ng.patch.gz) = 12662
diff --git a/mail/postfix28/files/patch-conf::main.cf b/mail/postfix28/files/patch-conf::main.cf
deleted file mode 100644
index 14976bcaa09c..000000000000
--- a/mail/postfix28/files/patch-conf::main.cf
+++ /dev/null
@@ -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 --git a/mail/postfix28/files/patch-conf::post-install b/mail/postfix28/files/patch-conf::post-install
deleted file mode 100644
index 78401de5bdf3..000000000000
--- a/mail/postfix28/files/patch-conf::post-install
+++ /dev/null
@@ -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 --git a/mail/postfix28/files/patch-makedefs b/mail/postfix28/files/patch-makedefs
index 5b231457530b..98ef2a03dbc8 100644
--- a/mail/postfix28/files/patch-makedefs
+++ b/mail/postfix28/files/patch-makedefs
@@ -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 --git a/mail/postfix28/files/patch-src::global::mail_params.h b/mail/postfix28/files/patch-src::global::mail_params.h
deleted file mode 100644
index f9fa5f1248c4..000000000000
--- a/mail/postfix28/files/patch-src::global::mail_params.h
+++ /dev/null
@@ -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 --git a/mail/postfix28/files/pkg-install.in b/mail/postfix28/files/pkg-install.in
new file mode 100644
index 000000000000..63b35a634394
--- /dev/null
+++ b/mail/postfix28/files/pkg-install.in
@@ -0,0 +1,156 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/mail/postfix28/files/pkg-install.in,v 1.1 2009-05-26 13:36:08 netchild 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%%}
+DAEMONDIR=${DAEMONDIR:=${PREFIX}/libexec/postfix}
+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 ${DAEMONDIR}/post-install tempdir=/tmp \
+ daemon_directory=${DAEMONDIR} \
+ 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 --git a/mail/postfix28/pkg-message b/mail/postfix28/files/pkg-message.in
index 3b23f15a2cac..5bd796f3d3b2 100644
--- a/mail/postfix28/pkg-message
+++ b/mail/postfix28/files/pkg-message.in
@@ -18,7 +18,7 @@ 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
+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
diff --git a/mail/postfix28/files/postfix.sh.in b/mail/postfix28/files/postfix.sh.in
index 2b07d6c85c1d..04b59ff1ed2e 100644
--- a/mail/postfix28/files/postfix.sh.in
+++ b/mail/postfix28/files/postfix.sh.in
@@ -25,10 +25,10 @@ rcvar=${name}_enable
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 --git a/mail/postfix28/pkg-install b/mail/postfix28/pkg-install
deleted file mode 100644
index 52e768d500cd..000000000000
--- a/mail/postfix28/pkg-install
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# 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 --git a/mail/postfix28/pkg-plist b/mail/postfix28/pkg-plist
index a956a16ab2a3..f71fa439bcd7 100644
--- a/mail/postfix28/pkg-plist
+++ b/mail/postfix28/pkg-plist
@@ -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/trivial-rewrite
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/postmulti
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 @@ bin/mailq
%%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 @@ bin/mailq
%%PORTDOCS%%%%DOCSDIR%%/tlsmgr.8.html
%%PORTDOCS%%%%DOCSDIR%%/generic.5.html
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrm libexec/postfix
-@dirrm etc/postfix/dist
-@dirrmtry etc/postfix