mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Added a check on needed files with specific message - #17
This commit is contained in:
parent
5b06f844ca
commit
c2c7ba70af
|
@ -1,5 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
die () {
|
||||
echo >&2 "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -f /tmp/postfix/accounts.cf ]; then
|
||||
echo "Regenerating postfix 'vmailbox' and 'virtual' for given users"
|
||||
echo "# WARNING: this file is auto-generated. Modify accounts.cf in postfix directory on host" > /etc/postfix/vmailbox
|
||||
|
||||
|
@ -23,13 +29,21 @@ do
|
|||
echo ${domain} >> /tmp/vhost.tmp
|
||||
done < /tmp/postfix/accounts.cf
|
||||
makeuserdb
|
||||
cat /tmp/vhost.tmp | sort | uniq >> /etc/postfix/vhost && rm /tmp/vhost.tmp
|
||||
else
|
||||
echo "==> Warning: '/tmp/postfix/accounts.cf' is not provided. No mail account created."
|
||||
fi
|
||||
|
||||
if [ -f /tmp/postfix/virtual ]; then
|
||||
# Copying virtual file
|
||||
cp /tmp/postfix/virtual /etc/postfix/virtual
|
||||
else
|
||||
echo "==> Warning: '/tmp/postfix/virtual' is not provided. No mail alias created."
|
||||
fi
|
||||
|
||||
echo "Postfix configurations"
|
||||
postmap /etc/postfix/vmailbox
|
||||
postmap /etc/postfix/virtual
|
||||
cat /tmp/vhost.tmp | sort | uniq >> /etc/postfix/vhost && rm /tmp/vhost.tmp
|
||||
touch /etc/postfix/vmailbox && postmap /etc/postfix/vmailbox
|
||||
touch /etc/postfix/virtual && postmap /etc/postfix/virtual
|
||||
|
||||
# Adding self-signed SSL certificate if provided in 'postfix/ssl' folder
|
||||
if [ -e "/tmp/postfix/ssl/$(hostname)-cert.pem" ] \
|
||||
|
|
Loading…
Reference in a new issue