build files for making podman containers
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.
 
 

32 lines
711 B

#!/bin/sh
# fail immediately if any command fails
set -e
### 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}
chown vmail:vmail ${user}
cp -p ${user} /vol/mail/${user}/.dovecot.sieve
done