Now using virtual file directly from /tmp/postfix folder.

This commit is contained in:
egavard 2015-08-06 10:54:22 +02:00
parent b057ad2170
commit 3eb0a13b37
3 changed files with 6 additions and 9 deletions

View file

@ -1 +0,0 @@
user@domain.tld | otheruser@domain.tld,otheruser@otherdomain.tld

4
postfix/virtual Normal file
View file

@ -0,0 +1,4 @@
#Mail redirection from user@domain.tld to otheruser@domain.tld and otheruser@otherdomain.tld
user@domain.tld|otheruser@domain.tld,otheruser@otherdomain.tld
#Mail redirection from postmaster@domain.tld and hostmaster@domain.tld to user@domain.tld
user@domain.tld| postmaster,hostmaster

View file

@ -27,14 +27,8 @@ do
done < /tmp/postfix/accounts.cf
makeuserdb
#creating virtuals
while IFS=$'|' read -r from to
do
echo "from : '$from' aliases: '$to'"
# Let's go!
echo "$from\t$to" >> /etc/postfix/virtual
done < /tmp/postfix/redirects.cf
#creating virtuals and redirects
cp /tmp/postfix/virtual /etc/postfix/virtual
echo "Postfix configurations"
postmap /etc/postfix/vmailbox
postmap /etc/postfix/virtual