blob: 5bf33125836650c1b27a3230d2a3f933b8eca180 (
plain) (
blame)
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
|
# This source code is released into the public domain.
#
# The OpenDKIM internal.ldap file is just a list of prefixes, one per line.
OPENDKIM_FILE="/usr/local/etc/mail/internal.ldap"
OPENDKIM_TEMP="${OPENDKIM_FILE}.ldaptmp"
if [ ! -f "$OPENDKIM_FILE" ]; then
exit 0
fi
# OpenDKIM needs localhost in the internal host list or it won't sign
# locally-originated messages.
printf >"$OPENDKIM_TEMP" '127.0.0.0/8\n::1/128\n'
awk >>"$OPENDKIM_TEMP" <"$NETWORKS_FILE" '{ print $1 }'
if cmp -s "$OPENDKIM_TEMP" "$OPENDKIM_FILE"; then
rm "$OPENDKIM_TEMP"
exit 0
fi
printf '%s updated:\n\n' "$OPENDKIM_FILE"
diff "$OPENDKIM_FILE" "$OPENDKIM_TEMP"
printf '\n'
mv "$OPENDKIM_TEMP" "$OPENDKIM_FILE"
/usr/local/etc/rc.d/milter-opendkim reload
|