From 3eb0a13b37f10c888cf13f4e23903bdba46cd071 Mon Sep 17 00:00:00 2001 From: egavard Date: Thu, 6 Aug 2015 10:54:22 +0200 Subject: [PATCH] Now using virtual file directly from /tmp/postfix folder. --- postfix/redirects.cf | 1 - postfix/virtual | 4 ++++ start-mailserver.sh | 10 ++-------- 3 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 postfix/redirects.cf create mode 100644 postfix/virtual 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