diff options
author | Alexander Leidinger <netchild@FreeBSD.org> | 2009-05-26 13:36:08 +0000 |
---|---|---|
committer | Alexander Leidinger <netchild@FreeBSD.org> | 2009-05-26 13:36:08 +0000 |
commit | 3f5ac2708cac9595c27ef95c344165d0c781f0dd (patch) | |
tree | 91720f4ecf6f7957df559b33a7260e39e842fa85 /mail/postfix/files | |
parent | daed5513841f582ed15663a13eb5d4080605badf (diff) | |
download | ports-3f5ac2708cac9595c27ef95c344165d0c781f0dd.tar.gz ports-3f5ac2708cac9595c27ef95c344165d0c781f0dd.zip |
Notes
Diffstat (limited to 'mail/postfix/files')
-rw-r--r-- | mail/postfix/files/patch-conf::main.cf | 80 | ||||
-rw-r--r-- | mail/postfix/files/patch-conf::post-install | 11 | ||||
-rw-r--r-- | mail/postfix/files/patch-makedefs | 12 | ||||
-rw-r--r-- | mail/postfix/files/patch-src::global::mail_params.h | 38 | ||||
-rw-r--r-- | mail/postfix/files/pkg-install.in | 156 | ||||
-rw-r--r-- | mail/postfix/files/pkg-message.in | 25 | ||||
-rw-r--r-- | mail/postfix/files/postfix.sh.in | 8 |
7 files changed, 190 insertions, 140 deletions
diff --git a/mail/postfix/files/patch-conf::main.cf b/mail/postfix/files/patch-conf::main.cf deleted file mode 100644 index 14976bcaa09c..000000000000 --- a/mail/postfix/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/postfix/files/patch-conf::post-install b/mail/postfix/files/patch-conf::post-install deleted file mode 100644 index 78401de5bdf3..000000000000 --- a/mail/postfix/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/postfix/files/patch-makedefs b/mail/postfix/files/patch-makedefs index 5b231457530b..98ef2a03dbc8 100644 --- a/mail/postfix/files/patch-makedefs +++ b/mail/postfix/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/postfix/files/patch-src::global::mail_params.h b/mail/postfix/files/patch-src::global::mail_params.h deleted file mode 100644 index f9fa5f1248c4..000000000000 --- a/mail/postfix/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/postfix/files/pkg-install.in b/mail/postfix/files/pkg-install.in new file mode 100644 index 000000000000..5cd874c814ee --- /dev/null +++ b/mail/postfix/files/pkg-install.in @@ -0,0 +1,156 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/mail/postfix/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/postfix/files/pkg-message.in b/mail/postfix/files/pkg-message.in new file mode 100644 index 000000000000..5bd796f3d3b2 --- /dev/null +++ b/mail/postfix/files/pkg-message.in @@ -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 --git a/mail/postfix/files/postfix.sh.in b/mail/postfix/files/postfix.sh.in index 2b07d6c85c1d..04b59ff1ed2e 100644 --- a/mail/postfix/files/postfix.sh.in +++ b/mail/postfix/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 |