postfix/rc.postfix

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@146 1 #!@l_prefix@/bin/openpkg rc
michael@146 2 ##
michael@146 3 ## rc.postfix -- Run-Commands
michael@146 4 ##
michael@146 5
michael@146 6 %config
michael@146 7 MTA_name="postfix"
michael@146 8 MTA_aliases_file="@l_prefix@/etc/postfix/aliases"
michael@146 9 MTA_aliases_update="cd @l_prefix@/etc/postfix && @l_prefix@/sbin/postalias aliases"
michael@146 10 postfix_enable="$openpkg_rc_def"
michael@146 11 postfix_log_prolog="true"
michael@146 12 postfix_log_epilog="true"
michael@146 13 postfix_log_numfiles="10"
michael@146 14 postfix_log_minsize="1M"
michael@146 15 postfix_log_complevel="9"
michael@146 16 postfix_sum_flags=""
michael@146 17
michael@146 18 %status -u @l_susr@ -o
michael@146 19 postfix_usable="no"
michael@146 20 postfix_active="no"
michael@146 21 @l_prefix@/sbin/postfix check >/dev/null 2>&1 && postfix_usable="yes"
michael@146 22 @l_prefix@/libexec/postfix/master -t >/dev/null 2>&1 || postfix_active="yes"
michael@146 23 echo "postfix_enable=\"$postfix_enable\""
michael@146 24 echo "postfix_usable=\"$postfix_usable\""
michael@146 25 echo "postfix_active=\"$postfix_active\""
michael@146 26
michael@146 27 %start -u @l_susr@
michael@146 28 rcService postfix enable yes || exit 0
michael@146 29 rcService postfix active yes && exit 0
michael@146 30 @l_prefix@/sbin/postfix start
michael@146 31
michael@146 32 %stop -u @l_susr@
michael@146 33 rcService postfix enable yes || exit 0
michael@146 34 rcService postfix active no && exit 0
michael@146 35 @l_prefix@/sbin/postfix stop
michael@146 36 sleep 2
michael@146 37
michael@146 38 %restart -u @l_susr@
michael@146 39 rcService postfix enable yes || exit 0
michael@146 40 rcService postfix active no && exit 0
michael@146 41 rc postfix stop start
michael@146 42
michael@146 43 %reload -u @l_susr@
michael@146 44 rcService postfix enable yes || exit 0
michael@146 45 rcService postfix active no && exit 0
michael@146 46 @l_prefix@/sbin/postfix reload
michael@146 47
michael@146 48 %daily -u @l_susr@
michael@146 49 rcService postfix enable yes || exit 0
michael@146 50
michael@146 51 # rotate summary logfile
michael@146 52 shtool rotate -f \
michael@146 53 -n ${postfix_log_numfiles} -s 0 \
michael@146 54 -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \
michael@146 55 @l_prefix@/var/postfix/log/postfix.sum
michael@146 56
michael@146 57 # generate summary logfile
michael@146 58 logfiles="@l_prefix@/var/postfix/log/postfix.log"
michael@146 59 if [ -f "@l_prefix@/var/postfix/log/postfix.log.0" ]; then
michael@146 60 logfiles="$logfiles @l_prefix@/var/postfix/log/postfix.log.0"
michael@146 61 fi
michael@146 62 @l_prefix@/sbin/pflogsumm -d yesterday -h 10 -u 10 -i \
michael@146 63 --iso_date_time --problems_first --smtpd_stats --verbose_msg_detail \
michael@146 64 ${postfix_sum_flags} \
michael@146 65 ${logfiles} >@l_prefix@/var/postfix/log/postfix.sum 2>/dev/null
michael@146 66
michael@146 67 # rotate logfile
michael@146 68 shtool rotate -f \
michael@146 69 -n ${postfix_log_numfiles} -s ${postfix_log_minsize} -d \
michael@146 70 -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \
michael@146 71 -P "$postfix_log_prolog" \
michael@146 72 -E "$postfix_log_epilog" \
michael@146 73 @l_prefix@/var/postfix/log/postfix.log
michael@146 74

mercurial