summaryrefslogtreecommitdiff
path: root/mail/postfix-current/files
diff options
context:
space:
mode:
authorSahil Tandon <sahil@FreeBSD.org>2011-02-20 06:21:36 +0000
committerSahil Tandon <sahil@FreeBSD.org>2011-02-20 06:21:36 +0000
commitd188c90c0336647ed8b5fa49884445b33c78b3f9 (patch)
tree83fc5d6f563f22dff715baeede638ab6476b2541 /mail/postfix-current/files
parentDocument PivotX administrator password reset vulnerability. (diff)
Update to 2.9-20110219, update CONFLICTS, alphabetically
sort packing list, and tweak PKGNAMESUFFIX when INST_BASE is defined. Also, sync OPTIONS with mail/postfix to warn users trying to build this port with unsupported options. Finally, modify pkg-install script to check if Postfix is already enabled in mailer.conf. PR: ports/154495 Submitted by: ohauer Approved by: maintainer timeout
Notes
Notes: svn path=/head/; revision=269371
Diffstat (limited to 'mail/postfix-current/files')
-rw-r--r--mail/postfix-current/files/pkg-install.in32
1 files changed, 21 insertions, 11 deletions
diff --git a/mail/postfix-current/files/pkg-install.in b/mail/postfix-current/files/pkg-install.in
index 3e90b486cb71..b85eb41930a0 100644
--- a/mail/postfix-current/files/pkg-install.in
+++ b/mail/postfix-current/files/pkg-install.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/mail/postfix-current/files/pkg-install.in,v 1.1 2010-07-30 03:39:18 sahil Exp $
+# $FreeBSD: /tmp/pcvs/ports/mail/postfix-current/files/pkg-install.in,v 1.2 2011-02-20 06:21:36 sahil Exp $
#
# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it
@@ -13,6 +13,7 @@ DAEMONDIR=${DAEMONDIR:=%%DAEMONDIR%%}
READMEDIR=${READMEDIR:=%%READMEDIR%%}
BATCH=${BATCH:=no}
POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
+MC=/etc/mail/mailer.conf
if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then
DEFAULT_REPLACE_MAILERCONF=n
@@ -144,15 +145,24 @@ replace() {
}
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
+ egrep -q "^sendmail.*${PREFIX}/sbin/sendmail" ${MC} && \
+ egrep -q "^send-mail.*${PREFIX}/sbin/sendmail" ${MC} && \
+ egrep -q "^mailq.*${PREFIX}/sbin/sendmail" ${MC} && \
+ egrep -q "^newaliases.*${PREFIX}/sbin/sendmail" ${MC}
+ ret=$?
+ if [ ${ret} -ne 0 ]; then
+ if yesno "Would you like to activate Postfix in ${MC}" ${DEFAULT_REPLACE_MAILERCONF}; then
+ /bin/mv -f ${MC} ${MC}.old
+ echo "#" > ${MC}
+ echo -n "# Execute the Postfix sendmail program" >> ${MC}
+ echo ", named ${PREFIX}/sbin/sendmail" >> ${MC}
+ echo "#" >> ${MC}
+ echo "sendmail ${PREFIX}/sbin/sendmail" >> ${MC}
+ echo "send-mail ${PREFIX}/sbin/sendmail" >> ${MC}
+ echo "mailq ${PREFIX}/sbin/sendmail" >> ${MC}
+ echo "newaliases ${PREFIX}/sbin/sendmail" >> ${MC}
+ fi
+ else
+ echo "Postfix already activated in ${MC}"
fi
fi