mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Merge pull request #26 from tbutter/master
forward only domains should be added to vhosts
This commit is contained in:
commit
80a4a8659a
|
@ -29,7 +29,6 @@ if [ -f /tmp/postfix/accounts.cf ]; then
|
|||
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
|
||||
|
@ -37,10 +36,20 @@ fi
|
|||
if [ -f /tmp/postfix/virtual ]; then
|
||||
# Copying virtual file
|
||||
cp /tmp/postfix/virtual /etc/postfix/virtual
|
||||
while IFS=$' ' read from to
|
||||
do
|
||||
# Setting variables for better readability
|
||||
domain=$(echo ${from} | cut -d @ -f2)
|
||||
echo ${domain} >> /tmp/vhost.tmp
|
||||
done < /tmp/postfix/virtual
|
||||
else
|
||||
echo "==> Warning: '/tmp/postfix/virtual' is not provided. No mail alias created."
|
||||
fi
|
||||
|
||||
if [ -f /tmp/vhost.tmp ]; then
|
||||
cat /tmp/vhost.tmp | sort | uniq > /etc/postfix/vhost && rm /tmp/vhost.tmp
|
||||
fi
|
||||
|
||||
echo "Postfix configurations"
|
||||
touch /etc/postfix/vmailbox && postmap /etc/postfix/vmailbox
|
||||
touch /etc/postfix/virtual && postmap /etc/postfix/virtual
|
||||
|
|
Loading…
Reference in a new issue