blob: 8a27d6dbf97080a6669c1c802659b59668875476 (
plain)
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
|
#!/bin/sh -e
#-----------------------------------------------------------------------------
#
# $Sendmail: update_smrsh,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
#
# Update MDA programs used by Sendmail for Debian
#
# Copyright (c) 2002-@SM_CPYRT@ Richard Nelson. All Rights Reserved.
#
# Notes (to all):
# * The entries in /etc/mail/smrsh are used by the feature(smrsh) and
# sensible-mda.
#
# Notes (to self):
# *
#
#-----------------------------------------------------------------------------
set -e;
# flag used to indicate a dataset has been moved, may need another update
changed=0;
new=1;
def_progs="\
@libexecdir@/mail.local \
@libexecdir@/sensible-mda \
/usr/bin/vacation \
/usr/bin/procmail \
/usr/bin/maildrop \
/usr/bin/deliver \
";
echo " ";
echo "Checking for installed MDAs...";
#------------------------------------------------------------------------------
# /etc/mail/smrsh is where the links to MDAs and authorized forwarding progs
if [ ! -e @sysconfdir@/mail/smrsh ]; then
changed=1;
new=1;
fi;
chown root:root @sysconfdir@/mail/smrsh;
chmod 02755 @sysconfdir@/mail/smrsh;
#------------------------------------------------------------------------------
# Iterate over the default list of programs and create any missing items
for file in $def_progs; do
ppath=$(dirname "$file");
pname=$(basename "$file");
# the file doesn't exist, see if we can remove its link
if [ ! -e $file ]; then
# let have there own version eh?
if [ -e @sysconfdir@/mail/smrsh/$pname ]; then
true;
# no, if its a danglink symlink, drop it
elif [ -L @sysconfdir@/mail/smrsh/$pname ]; then
echo "Removing link for no longer extant program ($pname)";
rm @sysconfdir@/mail/smrsh/$pname;
fi;
# the file exists, see if we need to add its link
elif [ ! -e @sysconfdir@/mail/smrsh/$pname ]; then
echo "Adding link for newly extant program ($pname)";
ln -sf $file @sysconfdir@/mail/smrsh/$pname;
changed=1;
fi;
done;
#------------------------------------------------------------------------------
exit $changed;
|