head 1.20; access; symbols netbsd-10-0-RELEASE:1.19 netbsd-10-0-RC6:1.19 netbsd-10-0-RC5:1.19 netbsd-10-0-RC4:1.19 netbsd-10-0-RC3:1.19 netbsd-10-0-RC2:1.19 netbsd-10-0-RC1:1.19 netbsd-10:1.19.0.8 netbsd-10-base:1.19 netbsd-9-3-RELEASE:1.18.16.1 cjep_sun2x-base1:1.19 cjep_sun2x:1.19.0.6 cjep_sun2x-base:1.19 cjep_staticlib_x-base1:1.19 netbsd-9-2-RELEASE:1.18.16.1 cjep_staticlib_x:1.19.0.4 cjep_staticlib_x-base:1.19 netbsd-9-1-RELEASE:1.18.16.1 phil-wifi-20200421:1.19 phil-wifi-20200411:1.19 is-mlppp:1.19.0.2 is-mlppp-base:1.19 phil-wifi-20200406:1.19 netbsd-8-2-RELEASE:1.18 netbsd-9-0-RELEASE:1.18 netbsd-9-0-RC2:1.18 netbsd-9-0-RC1:1.18 phil-wifi-20191119:1.19 netbsd-9:1.18.0.16 netbsd-9-base:1.18 phil-wifi-20190609:1.18 netbsd-8-1-RELEASE:1.18 netbsd-8-1-RC1:1.18 pgoyette-compat-merge-20190127:1.18 pgoyette-compat-20190127:1.18 pgoyette-compat-20190118:1.18 pgoyette-compat-1226:1.18 pgoyette-compat-1126:1.18 pgoyette-compat-1020:1.18 pgoyette-compat-0930:1.18 pgoyette-compat-0906:1.18 netbsd-7-2-RELEASE:1.16 pgoyette-compat-0728:1.18 netbsd-8-0-RELEASE:1.18 phil-wifi:1.18.0.14 phil-wifi-base:1.18 pgoyette-compat-0625:1.18 netbsd-8-0-RC2:1.18 pgoyette-compat-0521:1.18 pgoyette-compat-0502:1.18 pgoyette-compat-0422:1.18 netbsd-8-0-RC1:1.18 pgoyette-compat-0415:1.18 pgoyette-compat-0407:1.18 pgoyette-compat-0330:1.18 pgoyette-compat-0322:1.18 pgoyette-compat-0315:1.18 netbsd-7-1-2-RELEASE:1.16 pgoyette-compat:1.18.0.12 pgoyette-compat-base:1.18 netbsd-7-1-1-RELEASE:1.16 matt-nb8-mediatek:1.18.0.10 matt-nb8-mediatek-base:1.18 perseant-stdc-iso10646:1.18.0.8 perseant-stdc-iso10646-base:1.18 netbsd-8:1.18.0.6 netbsd-8-base:1.18 prg-localcount2-base3:1.18 prg-localcount2-base2:1.18 prg-localcount2-base1:1.18 prg-localcount2:1.18.0.4 prg-localcount2-base:1.18 pgoyette-localcount-20170426:1.18 bouyer-socketcan-base1:1.18 pgoyette-localcount-20170320:1.18 netbsd-7-1:1.16.0.32 netbsd-7-1-RELEASE:1.16 netbsd-7-1-RC2:1.16 netbsd-7-nhusb-base-20170116:1.16 bouyer-socketcan:1.18.0.2 bouyer-socketcan-base:1.18 pgoyette-localcount-20170107:1.18 netbsd-7-1-RC1:1.16 pgoyette-localcount-20161104:1.18 netbsd-7-0-2-RELEASE:1.16 localcount-20160914:1.17 netbsd-7-nhusb:1.16.0.30 netbsd-7-nhusb-base:1.16 pgoyette-localcount-20160806:1.17 pgoyette-localcount-20160726:1.17 pgoyette-localcount:1.17.0.2 pgoyette-localcount-base:1.17 netbsd-7-0-1-RELEASE:1.16 netbsd-7-0:1.16.0.28 netbsd-7-0-RELEASE:1.16 netbsd-7-0-RC3:1.16 netbsd-7-0-RC2:1.16 netbsd-7-0-RC1:1.16 netbsd-5-2-3-RELEASE:1.14 netbsd-5-1-5-RELEASE:1.14 netbsd-6-0-6-RELEASE:1.16 netbsd-6-1-5-RELEASE:1.16 netbsd-7:1.16.0.26 netbsd-7-base:1.16 yamt-pagecache-base9:1.16 yamt-pagecache-tag8:1.16 netbsd-6-1-4-RELEASE:1.16 netbsd-6-0-5-RELEASE:1.16 tls-earlyentropy:1.16.0.24 tls-earlyentropy-base:1.16 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.16 riastradh-drm2-base3:1.16 netbsd-6-1-3-RELEASE:1.16 netbsd-6-0-4-RELEASE:1.16 netbsd-5-2-2-RELEASE:1.14 netbsd-5-1-4-RELEASE:1.14 netbsd-6-1-2-RELEASE:1.16 netbsd-6-0-3-RELEASE:1.16 netbsd-5-2-1-RELEASE:1.14 netbsd-5-1-3-RELEASE:1.14 netbsd-6-1-1-RELEASE:1.16 riastradh-drm2-base2:1.16 riastradh-drm2-base1:1.16 riastradh-drm2:1.16.0.16 riastradh-drm2-base:1.16 netbsd-6-1:1.16.0.22 netbsd-6-0-2-RELEASE:1.16 netbsd-6-1-RELEASE:1.16 khorben-n900:1.16.0.20 netbsd-6-1-RC4:1.16 netbsd-6-1-RC3:1.16 agc-symver:1.16.0.18 agc-symver-base:1.16 netbsd-6-1-RC2:1.16 netbsd-6-1-RC1:1.16 yamt-pagecache-base8:1.16 netbsd-5-2:1.14.0.28 netbsd-6-0-1-RELEASE:1.16 yamt-pagecache-base7:1.16 netbsd-5-2-RELEASE:1.14 netbsd-5-2-RC1:1.14 matt-nb6-plus-nbase:1.16 yamt-pagecache-base6:1.16 netbsd-6-0:1.16.0.14 netbsd-6-0-RELEASE:1.16 netbsd-6-0-RC2:1.16 tls-maxphys:1.16.0.12 tls-maxphys-base:1.16 matt-nb6-plus:1.16.0.10 matt-nb6-plus-base:1.16 netbsd-6-0-RC1:1.16 yamt-pagecache-base5:1.16 yamt-pagecache-base4:1.16 netbsd-6:1.16.0.8 netbsd-6-base:1.16 netbsd-5-1-2-RELEASE:1.14 netbsd-5-1-1-RELEASE:1.14 yamt-pagecache-base3:1.16 yamt-pagecache-base2:1.16 yamt-pagecache:1.16.0.6 yamt-pagecache-base:1.16 cherry-xenmp:1.16.0.4 cherry-xenmp-base:1.16 bouyer-quota2-nbase:1.16 bouyer-quota2:1.16.0.2 bouyer-quota2-base:1.16 matt-mips64-premerge-20101231:1.16 matt-nb5-mips64-premerge-20101231:1.14 matt-nb5-pq3:1.14.0.26 matt-nb5-pq3-base:1.14 netbsd-5-1:1.14.0.24 netbsd-5-1-RELEASE:1.14 netbsd-5-1-RC4:1.14 matt-nb5-mips64-k15:1.14 netbsd-5-1-RC3:1.14 netbsd-5-1-RC2:1.14 netbsd-5-1-RC1:1.14 netbsd-5-0-2-RELEASE:1.14 matt-nb5-mips64-premerge-20091211:1.14 matt-premerge-20091211:1.16 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.14 matt-nb4-mips64-k7-u2a-k9b:1.14 matt-nb5-mips64-u1-k1-k5:1.14 matt-nb5-mips64:1.14.0.22 netbsd-5-0-1-RELEASE:1.14 jym-xensuspend-nbase:1.16 netbsd-5-0:1.14.0.20 netbsd-5-0-RELEASE:1.14 netbsd-5-0-RC4:1.14 netbsd-5-0-RC3:1.14 netbsd-5-0-RC2:1.14 jym-xensuspend:1.14.0.18 jym-xensuspend-base:1.16 netbsd-5-0-RC1:1.14 mjf-devfs2-base2:1.14 netbsd-5:1.14.0.16 netbsd-5-base:1.14 matt-mips64-base2:1.14 matt-mips64:1.13.0.8 netbsd-4-0-1-RELEASE:1.13.2.1 wrstuden-revivesa-base-3:1.14 wrstuden-revivesa-base-2:1.14 wrstuden-fixsa-newbase:1.13.2.1 wrstuden-revivesa-base-1:1.14 yamt-pf42-base4:1.14 yamt-pf42-base3:1.14 hpcarm-cleanup-nbase:1.14 yamt-pf42-baseX:1.14 yamt-pf42-base2:1.14 wrstuden-revivesa:1.14.0.14 wrstuden-revivesa-base:1.14 yamt-pf42:1.14.0.12 yamt-pf42-base:1.14 mjf-devfs2:1.14.0.10 mjf-devfs2-base:1.14 keiichi-mipv6:1.14.0.8 keiichi-mipv6-base:1.14 mjf-devfs:1.14.0.6 mjf-devfs-base:1.14 matt-armv6-nbase:1.14 matt-armv6-prevmlocking:1.14 wrstuden-fixsa-base-1:1.13.2.1 netbsd-4-0:1.13.2.1.0.2 netbsd-4-0-RELEASE:1.13.2.1 cube-autoconf:1.14.0.4 cube-autoconf-base:1.14 netbsd-4-0-RC5:1.13.2.1 netbsd-4-0-RC4:1.13.2.1 netbsd-4-0-RC3:1.13.2.1 netbsd-4-0-RC2:1.13.2.1 netbsd-4-0-RC1:1.13.2.1 matt-armv6:1.14.0.2 matt-armv6-base:1.14 matt-mips64-base:1.13 hpcarm-cleanup:1.13.0.6 hpcarm-cleanup-base:1.14 netbsd-3-1-1-RELEASE:1.9 netbsd-3-0-3-RELEASE:1.9 wrstuden-fixsa:1.13.0.4 wrstuden-fixsa-base:1.13.2.1 abandoned-netbsd-4-base:1.10 abandoned-netbsd-4:1.10.0.2 netbsd-3-1:1.9.0.6 netbsd-3-1-RELEASE:1.9 netbsd-3-0-2-RELEASE:1.9 netbsd-3-1-RC4:1.9 netbsd-3-1-RC3:1.9 netbsd-3-1-RC2:1.9 netbsd-3-1-RC1:1.9 netbsd-4:1.13.0.2 netbsd-4-base:1.13 netbsd-3-0-1-RELEASE:1.9 netbsd-3-0:1.9.0.4 netbsd-3-0-RELEASE:1.9 netbsd-3-0-RC6:1.9 netbsd-3-0-RC5:1.9 netbsd-3-0-RC4:1.9 netbsd-3-0-RC3:1.9 netbsd-3-0-RC2:1.9 netbsd-3-0-RC1:1.9 netbsd-2-0-3-RELEASE:1.7 netbsd-2-1:1.7.0.6 netbsd-2-1-RELEASE:1.7 netbsd-2-1-RC6:1.7 netbsd-2-1-RC5:1.7 netbsd-2-1-RC4:1.7 netbsd-2-1-RC3:1.7 netbsd-2-1-RC2:1.7 netbsd-2-1-RC1:1.7 netbsd-2-0-2-RELEASE:1.7 netbsd-3:1.9.0.2 netbsd-3-base:1.9 netbsd-2-0-1-RELEASE:1.7 netbsd-2:1.7.0.4 netbsd-2-base:1.7 netbsd-2-0-RELEASE:1.7 netbsd-2-0-RC5:1.7 netbsd-2-0-RC4:1.7 netbsd-2-0-RC3:1.7 netbsd-2-0-RC2:1.7 netbsd-2-0-RC1:1.7 netbsd-2-0:1.7.0.2 netbsd-2-0-base:1.7 netbsd-1-6-PATCH002-RELEASE:1.6 netbsd-1-6-PATCH002:1.6 netbsd-1-6-PATCH002-RC4:1.6 netbsd-1-6-PATCH002-RC3:1.6 netbsd-1-6-PATCH002-RC2:1.6 netbsd-1-6-PATCH002-RC1:1.6 netbsd-1-6-PATCH001:1.6 netbsd-1-6-PATCH001-RELEASE:1.6 netbsd-1-6-PATCH001-RC3:1.6 netbsd-1-6-PATCH001-RC2:1.6 netbsd-1-6-PATCH001-RC1:1.6 fvdl_fs64_base:1.6 netbsd-1-6-RELEASE:1.6 netbsd-1-6-RC3:1.6 netbsd-1-6-RC2:1.6 netbsd-1-6-RC1:1.6 netbsd-1-6:1.6.0.2 netbsd-1-6-base:1.6 netbsd-1-5-PATCH003:1.4.4.1 netbsd-1-5-PATCH002:1.4.4.1 netbsd-1-5-PATCH001:1.4.4.1 netbsd-1-5-RELEASE:1.4.4.1 netbsd-1-5-BETA2:1.4.4.1 netbsd-1-5-BETA:1.4.4.1 netbsd-1-5-ALPHA2:1.4 netbsd-1-5:1.4.0.4 netbsd-1-5-base:1.4 minoura-xpg4dl:1.4.0.2 minoura-xpg4dl-base:1.4; locks; strict; comment @# @; 1.20 date 2023.12.25.08.37.08; author kre; state Exp; branches; next 1.19; commitid UETx56KNpwrT6PRE; 1.19 date 2019.08.09.10.05.44; author rin; state Exp; branches; next 1.18; commitid 5WK1Y3igxlIg0lyB; 1.18 date 2016.10.30.15.47.06; author riastradh; state Exp; branches 1.18.14.1 1.18.16.1; next 1.17; commitid SIV5XfAdulRVrbsz; 1.17 date 2015.07.23.17.12.16; author riz; state Exp; branches 1.17.2.1; next 1.16; commitid HlFLR3QflE89Squy; 1.16 date 2009.04.15.22.11.32; author perry; state Exp; branches; next 1.15; 1.15 date 2009.04.15.22.03.54; author perry; state Exp; branches; next 1.14; 1.14 date 2007.08.27.10.59.06; author pavel; state Exp; branches 1.14.18.1; next 1.13; 1.13 date 2006.09.07.15.26.08; author christos; state Exp; branches 1.13.2.1 1.13.4.1; next 1.12; 1.12 date 2006.09.07.14.16.55; author christos; state Exp; branches; next 1.11; 1.11 date 2006.09.05.22.10.51; author christos; state Exp; branches; next 1.10; 1.10 date 2006.06.18.14.05.34; author christos; state Exp; branches; next 1.9; 1.9 date 2004.08.13.18.08.03; author mycroft; state Exp; branches; next 1.8; 1.8 date 2004.04.08.06.15.27; author lukem; state Exp; branches; next 1.7; 1.7 date 2003.01.31.06.47.16; author lukem; state Exp; branches; next 1.6; 1.6 date 2002.02.12.02.19.27; author lukem; state Exp; branches; next 1.5; 1.5 date 2000.09.19.13.04.39; author lukem; state Exp; branches; next 1.4; 1.4 date 2000.05.13.08.45.08; author lukem; state Exp; branches 1.4.4.1; next 1.3; 1.3 date 2000.04.30.12.21.00; author lukem; state Exp; branches; next 1.2; 1.2 date 2000.04.27.20.58.26; author veego; state Exp; branches; next 1.1; 1.1 date 2000.04.26.05.28.04; author thorpej; state Exp; branches; next ; 1.18.14.1 date 2020.04.13.07.45.46; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.18.16.1 date 2020.06.20.16.41.57; author martin; state Exp; branches; next ; commitid B2WSDWWWsZWB2ZcC; 1.17.2.1 date 2016.11.04.14.42.41; author pgoyette; state Exp; branches; next ; commitid 2m1JRwYmpwPkOOsz; 1.14.18.1 date 2009.05.13.19.18.03; author jym; state Exp; branches; next ; 1.13.2.1 date 2007.08.28.13.40.51; author ghen; state Exp; branches; next ; 1.13.4.1 date 2007.09.03.06.57.51; author wrstuden; state Exp; branches; next ; 1.4.4.1 date 2000.10.02.01.09.25; author lukem; state Exp; branches; next ; desc @@ 1.20 log @ Do away with the obsolete text(1) -a operator, use sh && instead. Prefer sh ! operator over test's ! (less question what it means). A few minor formatting changes. @ text @#!/bin/sh # # $NetBSD: postfix,v 1.19 2019/08/09 10:05:44 rin Exp $ # # PROVIDE: mail # REQUIRE: LOGIN # we make mail start late, so that things like .forward's are not # processed until the system is fully operational $_rc_subr_loaded . /etc/rc.subr name="postfix" rcvar=$name postfix_command="/usr/sbin/${name}" required_files="/etc/${name}/main.cf" start_precmd="postfix_precmd" start_cmd="postfix_op" stop_cmd="postfix_op" reload_cmd="postfix_op" status_cmd="postfix_op" extra_commands="reload status" spooletcdir="/var/spool/${name}/etc" postconf="/usr/sbin/postconf" required_dirs=$spooletcdir _rebuild() { echo "${name}: rebuilding ${1} ($2 ${1}.db)" $($postconf -h newaliases_path) } postfix_precmd() { # As this is called after the is_running and required_dir checks # are made in run_rc_command(), we can safely assume ${spooletcdir} # exists and postfix isn't running at this point (unless forcestart # is used). # for f in localtime resolv.conf services; do if [ -f /etc/$f ]; then cmp -s /etc/$f ${spooletcdir}/$f || \ cp -p /etc/$f ${spooletcdir}/$f fi done OIFS="${IFS}" IFS="${IFS}," for f in $($postconf -hx alias_database); do IFS="${OIFS}:" set -- $f IFS="${OIFS}" case "$1" in hash) if [ -f "$2.db" ]; then if ! [ "$2" -ot "$2.db" ]; then _rebuild "$2" "out of date" fi else _rebuild "$2" "missing" fi ;; *) ;; esac done echo "Starting ${name}." } postfix_op() { ${postfix_command} ${rc_arg} } check_use_postfix() { _mta_path=$(awk '/^sendmail[ \t]/{print$2}' /etc/mailer.conf) _postfix_path="/usr/libexec/postfix/sendmail" _sendmail_path="/usr/libexec/sendmail/sendmail" if [ "${postfix}" != "check" ]; then echo "${postfix}" elif [ "${_mta_path}" = "${_postfix_path}" ]; then echo YES else echo "WARNING: default postfix not used as not selected in mailer.conf" >&2 if [ "${_mta_path}" = "${_sendmail_path}" ] && ! [ -x "${_mta_path}" ]; then echo "WARNING: mailer.conf points to the removed sendmail" >&2 echo "update /etc/mailer.conf to get a working mailer configuration" >&2 fi echo NO fi } # force re-evaluation of /etc/rc.conf and resetting of $sendmail _rc_conf_loaded=false _rc_d_postfix=check load_rc_config $name unset _rc_d_postfix postfix=$(check_use_postfix) run_rc_command "$1" @ 1.19 log @little bit verbose for slow machines @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.18 2016/10/30 15:47:06 riastradh Exp $ d56 1 a56 1 if [ ! "$2" -ot "$2.db" ]; then d88 2 a89 2 if [ "${_mta_path}" = "${_sendmail_path}" -a \ ! -x "${_mta_path}" ]; then @ 1.18 log @Handle variable expansion and comma/space separators in postconf. From Timo Buhrmester: https://mail-index.netbsd.org/tech-userlevel/2016/08/20/msg010301.html @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.17 2015/07/23 17:12:16 riz Exp $ d67 2 @ 1.18.16.1 log @Pull up following revision(s) (requested by rin in ticket #966): etc/rc.d/postfix: revision 1.19 little bit verbose for slow machines @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.18 2016/10/30 15:47:06 riastradh Exp $ a66 2 echo "Starting ${name}." @ 1.18.14.1 log @Mostly merge changes from HEAD upto 20200411 @ text @d3 1 a3 1 # $NetBSD$ a66 2 echo "Starting ${name}." @ 1.17 log @Implement "status" command for postfix - makes tools like ansible happier. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.16 2009/04/15 22:11:32 perry Exp $ d47 4 a50 3 for f in $($postconf -h alias_database); do OIFS="${IFS}" IFS="${IFS}:" @ 1.17.2.1 log @Sync with HEAD @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.18 2016/10/30 15:47:06 riastradh Exp $ d47 3 a49 4 OIFS="${IFS}" IFS="${IFS}," for f in $($postconf -hx alias_database); do IFS="${OIFS}:" @ 1.16 log @un-uppercase pseudodependency for the moment so as not to break pkgsrc @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.15 2009/04/15 22:03:54 perry Exp $ d21 2 a22 1 extra_commands="reload" @ 1.15 log @uppercase pseudodependency @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.14 2007/08/27 10:59:06 pavel Exp $ d6 1 a6 1 # PROVIDE: MAIL @ 1.14 log @Add some magic (similar to the one in rc.d/sendmail introduced with 2.0 release) to not start postfix if $postfix is not explicitely set and another mailer is selected in /etc/mailer.conf. Also print a warning if it happens because the mailer in rc.conf is the removed sendmail. This prevents starting two MTAs at once if one uses a custom MTA. As proposed on tech-userlevel, approved by martin. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.13 2006/09/07 15:26:08 christos Exp $ d6 1 a6 1 # PROVIDE: mail @ 1.14.18.1 log @Sync with HEAD. Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.16 2009/04/15 22:11:32 perry Exp $ @ 1.13 log @make postconf configurable @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.12 2006/09/07 14:16:55 christos Exp $ d72 24 d97 2 @ 1.13.4.1 log @Sync w/ NetBSD-4-RC_1 @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.13.2.1 2007/08/28 13:40:51 ghen Exp $ a71 24 check_use_postfix() { _mta_path=$(awk '/^sendmail[ \t]/{print$2}' /etc/mailer.conf) _postfix_path="/usr/libexec/postfix/sendmail" _sendmail_path="/usr/libexec/sendmail/sendmail" if [ "${postfix}" != "check" ]; then echo "${postfix}" elif [ "${_mta_path}" = "${_postfix_path}" ]; then echo YES else echo "WARNING: default postfix not used as not selected in mailer.conf" >&2 if [ "${_mta_path}" = "${_sendmail_path}" -a \ ! -x "${_mta_path}" ]; then echo "WARNING: mailer.conf points to the removed sendmail" >&2 echo "update /etc/mailer.conf to get a working mailer configuration" >&2 fi echo NO fi } # force re-evaluation of /etc/rc.conf and resetting of $sendmail _rc_conf_loaded=false _rc_d_postfix=check a72 2 unset _rc_d_postfix postfix=$(check_use_postfix) @ 1.13.2.1 log @Pull up following revision(s) (requested by pavel in ticket #845): etc/rc.d/postfix: revision 1.14 etc/defaults/rc.conf: revision 1.90 Add some magic (similar to the one in rc.d/sendmail introduced with 2.0 release) to not start postfix if $postfix is not explicitely set and another mailer is selected in /etc/mailer.conf. Also print a warning if it happens because the mailer in rc.conf is the removed sendmail. This prevents starting two MTAs at once if one uses a custom MTA. As proposed on tech-userlevel, approved by martin. @ text @d3 1 a3 1 # $NetBSD$ a71 24 check_use_postfix() { _mta_path=$(awk '/^sendmail[ \t]/{print$2}' /etc/mailer.conf) _postfix_path="/usr/libexec/postfix/sendmail" _sendmail_path="/usr/libexec/sendmail/sendmail" if [ "${postfix}" != "check" ]; then echo "${postfix}" elif [ "${_mta_path}" = "${_postfix_path}" ]; then echo YES else echo "WARNING: default postfix not used as not selected in mailer.conf" >&2 if [ "${_mta_path}" = "${_sendmail_path}" -a \ ! -x "${_mta_path}" ]; then echo "WARNING: mailer.conf points to the removed sendmail" >&2 echo "update /etc/mailer.conf to get a working mailer configuration" >&2 fi echo NO fi } # force re-evaluation of /etc/rc.conf and resetting of $sendmail _rc_conf_loaded=false _rc_d_postfix=check a72 2 unset _rc_d_postfix postfix=$(check_use_postfix) @ 1.12 log @- find the correct newaliases program from postconf (suggested by Geert Hendrickx) - only check for hash files. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.11 2006/09/05 22:10:51 christos Exp $ d23 1 d28 1 a28 1 $(postconf -h newaliases_path) d46 1 a46 1 for f in $(postconf -h alias_database); do @ 1.11 log @Find the alias file name from the postfix configuration. From our anonymous user. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.10 2006/06/18 14:05:34 christos Exp $ d24 5 a28 1 newaliases="/usr/bin/newaliases" d46 12 a57 6 dbfile="${f#*:}" if [ -f "${dbfile}.db" ]; then if [ ! "${dbfile}" -ot "${dbfile}.db" ]; then echo \ "${name}: ${dbfile} newer than ${dbfile}.db, running $newaliases" $newaliases d59 4 a62 5 else echo \ "${name}: ${dbfile}.db not present, running $newaliases" $newaliases fi @ 1.10 log @PR/33760: dieter roelants: a default install can't send mail due to missing aliases.db @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.9 2004/08/13 18:08:03 mycroft Exp $ d24 1 d41 9 a49 3 # check modifications on /etc/mail/aliases if [ -f "/etc/mail/aliases.db" ]; then if [ ! "/etc/mail/aliases" -ot "/etc/mail/aliases.db" ]; then d51 2 a52 2 "${name}: /etc/mail/aliases newer than /etc/mail/aliases.db, regenerating" /usr/bin/newaliases d54 1 a54 5 else echo \ "${name}: /etc/mail/aliases.db not present, generating" /usr/bin/newaliases fi @ 1.9 log @Add an _rc_subr_loaded variable, set to ":" by rc.subr. Scripts can use this for a speedup by doing: $_rc_subr_loaded . /etc/rc.subr @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.8 2004/04/08 06:15:27 lukem Exp $ d39 13 @ 1.8 log @Store the full path to the /usr/sbin/postfix in $postfix_command and use the latter postfix_op() to implement start/stop/reload. (We generally use full paths in rc.d scripts.) Problem noted by Bill Squier. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.7 2003/01/31 06:47:16 lukem Exp $ d11 1 a11 1 . /etc/rc.subr @ 1.7 log @Implement start_cmd as: start_cmd="${name} "'${rc_arg}' and stop_cmd & reload_cmd as: stop_cmd=$start_cmd reload_cmd=$start_cmd (Just to be tricky) @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.6 2002/02/12 02:19:27 lukem Exp $ d15 1 d18 3 a20 3 start_cmd="${name} "'${rc_arg}' stop_cmd=$start_cmd reload_cmd=$start_cmd d41 5 @ 1.6 log @populate /var/spool/postfix/etc with /etc/{localtime,resolv.conf,services}. per suggestion from perry. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.5 2000/09/19 13:04:39 lukem Exp $ d17 3 a19 3 start_cmd="${name} start" stop_cmd="${name} stop" reload_cmd="${name} reload" @ 1.5 log @- only perform the checkyesno on the variable named in $rcvar (rather than implicitly using $name if $rcvar isn't set), and always perform this check, even when using start_cmd (et al). this check is performed before the pidcmd is run, speeding up scripts that weren't going to be run anyway. this should speed up booting slow systems. - take advantage of the above and remove start_precmd="checkyesno foo" in scripts that use start_cmd. - explicitly set rcvar=foo in the rc.d/foo scripts which have an equivalent rc.conf entry - fix `rcvar' and `restart' when $rcvar isn't set. these above changes fix PR [bin/11027]. - when doing `force*', ignore the return value of *_precmd. this fixes PR [bin/10781]. - rename what sysdb provides from `databases' to `sysdb', to reflect the name of the script. - improve the comments in rc.subr @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.4 2000/05/13 08:45:08 lukem Exp $ d8 2 a9 4 # we could do this, but make mail start late, so that things like # .forward's are not processed until the system is fully operational ## REQUIRE: DAEMON d16 4 a19 3 start_cmd="postfix start" stop_cmd="postfix stop" reload_cmd="postfix reload" d21 18 @ 1.4 log @Use load_rc_config() (from rc.subr) instead of sourcing /etc/rc.conf. This allows us or a user to change the configuration file method in one place - rc.subr - without having to edit all of the rc.d/* files. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.3 2000/04/30 12:21:00 lukem Exp $ d16 1 a17 3 extra_commands="reload" start_precmd="checkyesno postfix" a18 2 stop_precmd=$start_precmd a19 2 reload_precmd=$start_precmd d21 1 @ 1.4.4.1 log @pull up rev 1.5 (approved by thorpej): - always use $rcvar to determine the name of the var to checkyesno - fix force* @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.5 2000/09/19 13:04:39 lukem Exp $ a15 1 rcvar=$name d17 3 d21 2 d24 2 a26 1 extra_commands="reload" @ 1.3 log @- use checkyesno in $start_precmd and change start_cmd to `postfix start' - use $extra_commands instead of passing "reload" to run_rc_command @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.2 2000/04/27 20:58:26 veego Exp $ a13 1 . /etc/rc.conf d28 1 @ 1.2 log @You need to add a xxx_precmd with a checkyesno yyy if you use a xxx_cmd in an rc.d script. @ text @d3 1 a3 1 # $NetBSD: postfix,v 1.1 2000/04/26 05:28:04 thorpej Exp $ d16 6 a21 5 postfix_start_precmd() { postfix start return 1 } start_precmd="postfix_start_precmd" d23 1 a23 1 stop_precmd="checkyesno postfix" d26 1 a26 1 reload_precmd="checkyesno postfix" d29 1 a29 4 name="postfix" required_files="/etc/${name}/main.cf" run_rc_command "$1" "reload" @ 1.1 log @Provide rc.d support for the Postfix mail system. Committed to the base because there is no support for packages in rc.d, and Postfix is supposed to become part of the base system anyhow. @ text @d3 1 a3 1 # $NetBSD$ d22 1 d25 1 @