diff --git a/postfix/redirects.cf b/postfix/redirects.cf deleted file mode 100644 index c29ec5cc..00000000 --- a/postfix/redirects.cf +++ /dev/null @@ -1 +0,0 @@ -user@domain.tld | otheruser@domain.tld,otheruser@otherdomain.tld \ No newline at end of file diff --git a/postfix/virtual b/postfix/virtual new file mode 100644 index 00000000..9fc19fb0 --- /dev/null +++ b/postfix/virtual @@ -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 \ No newline at end of file diff --git a/start-mailserver.sh b/start-mailserver.sh index dcac9d69..ba6ab200 100644 --- a/start-mailserver.sh +++ b/start-mailserver.sh @@ -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