From 0f88c7996bb09c5723e548af8e6d613b93217825 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 8 Feb 2016 00:03:32 +0100
Subject: [PATCH] Replace hostname in postfix/main.cf with proper value on
 post-install.

---
 jessie_postinstall.sh | 1 +
 systemfiles/main.cf   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

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
-- 
2.30.2