1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
#!/bin/sh
# Reports parameters that exist in postconf(1) output, but that are not
# documented in the postconf(5) manpage.
LANG=C; export LANG
LC_ALL=C; export LC_ALL
bin/postconf mail_version >/dev/null || exit 1
trap 'rm -f want.tmp have.tmp stoplist.tmp 2>/dev/null' 0 1 2 3 15
# Extract parameters from the postconf(5) manpage.
awk '/^%PARAM/ { print $2 }' proto/postconf.proto | sort > have.tmp || exit 1
# Build a stoplist for postconf(1) output.
# Eliminate unwanted dynamic parameter names for delivery agents. These
# names are prefixed by their master.cf service name (they must instead
# be documented with fake names that have the "transport_" prefix; that
# is implemented later in this script).
for xport in error lmtp local relay retry smtp virtual
do
cat <<EOF
${xport}_delivery_slot_cost
${xport}_delivery_slot_discount
${xport}_delivery_slot_loan
${xport}_destination_concurrency_failed_cohort_limit
${xport}_destination_concurrency_limit
${xport}_destination_concurrency_negative_feedback
${xport}_destination_concurrency_positive_feedback
${xport}_destination_rate_delay
${xport}_destination_recipient_limit
${xport}_extra_recipient_limit
${xport}_initial_destination_concurrency
${xport}_minimum_delivery_slots
${xport}_recipient_limit
${xport}_recipient_refill_delay
${xport}_recipient_refill_limit
${xport}_transport_rate_delay
EOF
done >stoplist.tmp
# Eliminate other unwanted per-service parameters.
#cat >>stoplist.tmp <<EOF
#EOF
# Eliminate unwanted auto-generated parameters that make no sense.
cat >>stoplist.tmp <<'EOF'
lmtp_tlsrpt_enable
lmtp_tlsrpt_skip_reused_handshakes
lmtp_tlsrpt_socket_name
EOF
# Build the list of parameter names that must have an entry in the
# postconf(5) manpage.
(
# First, extract parameters from postconf(1) output, using the stock
# configurations.
bin/postconf -dHc conf | grep -F -vx -f stoplist.tmp
# Next, require that all dynamically-generated parameter names for delivery
# agents are documented as transport_mumble.
cat <<EOF
transport_delivery_slot_cost
transport_delivery_slot_discount
transport_delivery_slot_loan
transport_destination_concurrency_failed_cohort_limit
transport_destination_concurrency_limit
transport_destination_concurrency_negative_feedback
transport_destination_concurrency_positive_feedback
transport_destination_rate_delay
transport_destination_recipient_limit
transport_extra_recipient_limit
transport_initial_destination_concurrency
transport_minimum_delivery_slots
transport_recipient_limit
transport_recipient_refill_delay
transport_recipient_refill_limit
transport_transport_rate_delay
EOF
# Require that other per-service parameters are documented.
cat <<EOF
transport_time_limit
EOF
) | sort >want.tmp || exit 1
# Report parameter names that have an implementation but no documentation.
comm -23 want.tmp have.tmp
|