xref: /netbsd-src/external/ibm-public/postfix/dist/mantools/check-postlink (revision 059c16a85b0b39d60ad6d18f53c09510815afa2b)
1#!/bin/sh
2
3# Reports parameter names that have no postlink rules.
4
5LANG=C; export LANG
6LC_ALL=C; export LC_ALL
7
8trap 'rm -f postlink.tmp postconf.tmp stoplist.tmp 2>/dev/null' 0 1 2 3 15
9
10# Extract parameters from postlink script. This also produces names
11# of obsolete parameters, and non-parameter names such as SMTPD
12# access restrictions and mask names.
13
14sed -n '/[ 	].*href="postconf\.5\.html#/{
15	s/^[^#]*#//
16	s/".*//
17	p
18}' mantools/postlink | sort > postlink.tmp
19
20# Extract parameters from postconf output, using the stock configurations.
21
22bin/postconf -dHc conf | sort >postconf.tmp
23
24# Filter the postconf output through a stoplist. First, parameter
25# names prefixed by their service name.
26
27for xport in error lmtp local relay retry smtp virtual
28do
29   cat <<EOF
30${xport}_delivery_slot_cost
31${xport}_delivery_slot_discount
32${xport}_delivery_slot_loan
33${xport}_destination_concurrency_failed_cohort_limit
34${xport}_destination_concurrency_limit
35${xport}_destination_concurrency_negative_feedback
36${xport}_destination_concurrency_positive_feedback
37${xport}_destination_rate_delay
38${xport}_destination_recipient_limit
39${xport}_extra_recipient_limit
40${xport}_initial_destination_concurrency
41${xport}_minimum_delivery_slots
42${xport}_recipient_limit
43${xport}_recipient_refill_delay
44${xport}_recipient_refill_limit
45${xport}_transport_rate_delay
46EOF
47done >stoplist.tmp
48
49# Second, pseudo parameters, read-only parameters, etc.
50
51cat >>stoplist.tmp <<'EOF'
52stress
53EOF
54
55# Report names from postconf that have no rule in mantools/postlink.
56
57comm -23 postconf.tmp postlink.tmp | grep -F -vx -f stoplist.tmp
58