You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
#!/bin/sh
|
|
|
|
### Domains ###
|
|
# /vol/data/domains should contain the configuration parameters for myhostname and virtual_alias_domains
|
|
cat /vol/data/domains /etc/postfix/main.cf.part > /etc/postfix/main.cf
|
|
|
|
### Users ###
|
|
|
|
# copy users db to dovecot config
|
|
cp /vol/data/users /etc/dovecot/users
|
|
chown dovecot:dovecot /etc/dovecot/users
|
|
|
|
# copy users db to postfix config, but without passwords
|
|
cat /vol/data/users | cut -d':' -f1 | perl -pe 's/(.*)/\1 ./' > /etc/postfix/users
|
|
postmap /etc/postfix/users
|
|
|
|
### Aliases ###
|
|
|
|
# copy aliases to postifx config
|
|
cd /etc/postfix
|
|
cat /vol/data/aliases.d/*.list > aliases
|
|
postmap aliases
|
|
|
|
### Sieve ###
|
|
|
|
# copy users sieve to mail
|
|
cd /vol/data/sieve.d
|
|
for user in * ; do
|
|
mkdir -p /vol/mail/${user}
|
|
chown vmail:vmail /vol/mail/${user} ${user}
|
|
echo "Testing ${user}'s sieve script for compilation errors..."
|
|
sievec ${user} -d - > /dev/null
|
|
if [ $? -eq 0 ]; then
|
|
echo "No errors detected."
|
|
else
|
|
echo "Compilation errors detected in ${user}'s sieve script. Please correct any errors and run $(basename $0) again."
|
|
exit 2
|
|
fi
|
|
cp -p ${user} /vol/mail/${user}/.dovecot.sieve
|
|
done
|
|
|