summaryrefslogtreecommitdiff
path: root/mail/postfix-current/files
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-07-31 05:53:44 +0000
committerjlam <jlam@pkgsrc.org>2004-07-31 05:53:44 +0000
commit5ce83e844570a11b71095bbe7281cd62a2d7a9de (patch)
tree97fb201c4c47dc3fce3b21e22164083f8115a833 /mail/postfix-current/files
parent4300b1944843b0a0e62ed10ad20f846ef7915557 (diff)
downloadpkgsrc-5ce83e844570a11b71095bbe7281cd62a2d7a9de.tar.gz
Minimize diffs with pkgsrc/mail/postfix to simplify maintenance of this
package.
Diffstat (limited to 'mail/postfix-current/files')
-rw-r--r--mail/postfix-current/files/mailer.conf14
-rw-r--r--mail/postfix-current/files/postfix.sh41
2 files changed, 42 insertions, 13 deletions
diff --git a/mail/postfix-current/files/mailer.conf b/mail/postfix-current/files/mailer.conf
index a607a042abd..7122137ea38 100644
--- a/mail/postfix-current/files/mailer.conf
+++ b/mail/postfix-current/files/mailer.conf
@@ -1,10 +1,10 @@
-# $NetBSD: mailer.conf,v 1.3 2004/03/06 15:08:32 grant Exp $
+# $NetBSD: mailer.conf,v 1.4 2004/07/31 05:53:44 jlam Exp $
#
# Use "postfix" as replacement for "sendmail".
#
-sendmail @@PREFIX@@/sbin/sendmail
-send-mail @@PREFIX@@/sbin/sendmail
-mailq @@PREFIX@@/sbin/sendmail
-newaliases @@PREFIX@@/sbin/sendmail
-hoststat @@PREFIX@@/sbin/sendmail
-purgestat @@PREFIX@@/sbin/sendmail
+sendmail @PREFIX@/sbin/sendmail
+send-mail @PREFIX@/sbin/sendmail
+mailq @PREFIX@/sbin/sendmail
+newaliases @PREFIX@/sbin/sendmail
+hoststat @PREFIX@/sbin/sendmail
+purgestat @PREFIX@/sbin/sendmail
diff --git a/mail/postfix-current/files/postfix.sh b/mail/postfix-current/files/postfix.sh
index 98a9f887c99..b289b6fbc4c 100644
--- a/mail/postfix-current/files/postfix.sh
+++ b/mail/postfix-current/files/postfix.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: postfix.sh,v 1.2 2004/03/07 10:14:40 grant Exp $
+# $NetBSD: postfix.sh,v 1.3 2004/07/31 05:53:44 jlam Exp $
#
# PROVIDE: mail
@@ -12,13 +12,14 @@
name="postfix"
rcvar=$name
-required_files="@PKG_SYSCONFDIR@/main.cf"
+postfix_command="@PREFIX@/sbin/${name}"
+: ${required_files=`@PREFIX@/sbin/postconf -h config_directory`/main.cf}
start_precmd="postfix_precmd"
-start_cmd="${name} "'${rc_arg}'
-stop_cmd=$start_cmd
-reload_cmd=$start_cmd
+start_cmd="postfix_op"
+stop_cmd="postfix_op"
+reload_cmd="postfix_op"
extra_commands="reload"
-spooletcdir="/var/spool/${name}/etc"
+: ${spooletcdir=`@PREFIX@/sbin/postconf -h queue_directory`/etc}
required_dirs=$spooletcdir
postfix_precmd()
@@ -37,5 +38,33 @@ postfix_precmd()
done
}
+postfix_op()
+{
+ case ${rc_arg} in
+ start)
+ for _f in $required_dirs; do
+ if [ ! -d "${_f}/." ]; then
+ warn "${_f} is not a directory."
+ if [ -z $rc_force ]; then
+ return 1
+ fi
+ fi
+ done
+ for _f in $required_files; do
+ if [ ! -r "${_f}" ]; then
+ warn "${_f} is not readable."
+ if [ -z $rc_force ]; then
+ return 1
+ fi
+ fi
+ done
+ ${postfix_command} ${rc_arg}
+ ;;
+ *)
+ ${postfix_command} ${rc_arg}
+ ;;
+ esac
+}
+
load_rc_config $name
run_rc_command "$1"