-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathconfig-fast.sh
More file actions
61 lines (47 loc) · 1.52 KB
/
config-fast.sh
File metadata and controls
61 lines (47 loc) · 1.52 KB
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
if [ -z "$1" ]; then
echo "You must provide your FQDN."
echo "Usage: $0 mx.mydomain.tld"
exit 1
fi
fqdn="$1"
echo Your fully qualified host name is "$fqdn".
echo Putting "$fqdn" into control/me...
echo "$fqdn" > QMAIL/control/me
chmod 644 QMAIL/control/me
( echo "$fqdn" | sed 's/^\([^\.]*\)\.\([^\.]*\)\./\2\./' | (
read ddom
echo Putting "$ddom" into control/defaultdomain...
echo "$ddom" > QMAIL/control/defaultdomain
chmod 644 QMAIL/control/defaultdomain
) )
( echo "$fqdn" | sed 's/^.*\.\([^\.]*\)\.\([^\.]*\)$/\1.\2/' | (
read pdom
echo Putting "$pdom" into control/plusdomain...
echo "$pdom" > QMAIL/control/plusdomain
chmod 644 QMAIL/control/plusdomain
) )
echo Putting "$fqdn" into control/locals...
echo "$fqdn" >> QMAIL/control/locals
chmod 644 QMAIL/control/locals
echo Putting "$fqdn" into control/rcpthosts...
echo "$fqdn" >> QMAIL/control/rcpthosts
chmod 644 QMAIL/control/rcpthosts
echo "Now qmail will refuse to accept SMTP messages except to $fqdn."
echo 'Make sure to change rcpthosts if you add hosts to locals or virtualdomains!'
########### smtpplugins
# install control/smtpplugins file if not existent (unable to read control crash otherwise)
echo "Adding control/smtpplugins sample file..."
cat > QMAIL/control/smtpplugins << EOF
# smtpplugins sample file
[connection]
[auth]
[helo]
[mail]
[rcpt]
[pass]
[data]
EOF
chown root:qmail QMAIL/control/smtpplugins
########### supervise
echo "Copying the supervise scripts in QMAIL/doc/example-supervise"
cp -rp $SRCDIR/scripts/example-supervise QMAIL/doc/