From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 7 Feb 2016 23:03:32 +0000 (+0100)
Subject: Replace hostname in postfix/main.cf with proper value on post-install.
X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/decks/balance?a=commitdiff_plain;h=0f88c7996bb09c5723e548af8e6d613b93217825;p=config

Replace hostname in postfix/main.cf with proper value on post-install.
---

diff --git a/jessie_postinstall.sh b/jessie_postinstall.sh
index 587f30b..98e8a81 100755
--- a/jessie_postinstall.sh
+++ b/jessie_postinstall.sh
@@ -182,6 +182,7 @@ if [ "$1" = "server" ]; then
     DEBIAN_FRONTEND=noninteractive apt-get -y install getmail4 procmail mutt \
         postfix maildrop
     cp config/systemfiles/main.cf /etc/postfix/main.cf
+    sed -i 's/HOSTNAME/'.$2.'/g' /etc/postfix/main.cf
     cp config/systemfiles/aliases /etc/aliases
     newaliases
     service postfix restart
diff --git a/systemfiles/main.cf b/systemfiles/main.cf
index bcb733c..f1a7a8d 100644
--- a/systemfiles/main.cf
+++ b/systemfiles/main.cf
@@ -7,7 +7,7 @@ mailbox_command = /usr/bin/maildrop
 smtpd_relay_restrictions = permit_mynetworks defer_unauth_destination
 
 # What domains to receive mail for: names of local server.
-mydestination = plomlompom.com, localhost
+mydestination = HOSTNAME, localhost
 
 # What clients to relay mail from: only local server.
 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128