Adjust postfix configuration
authorMichael Prokop <mika@grml.org>
Fri, 21 Nov 2008 11:36:05 +0000 (12:36 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 21 Nov 2008 11:36:05 +0000 (12:36 +0100)
chroot-script
debian/changelog

index b5f1abe..072fb4c 100755 (executable)
@@ -253,6 +253,10 @@ hosts() {
      echo "Setting up /etc/hosts"
      echo "127.0.0.1       localhost  $HOSTNAME" > /etc/hosts
   fi
      echo "Setting up /etc/hosts"
      echo "127.0.0.1       localhost  $HOSTNAME" > /etc/hosts
   fi
+
+  if [ -n "$HOSTNAME" ] ; then
+     sed -i "s/grml/$HOSTNAME/g" /etc/hosts
+  fi
 }
 # }}}
 
 }
 # }}}
 
@@ -329,7 +333,14 @@ hostname() {
 
      # adjust postfix configuration
      if [ -r /etc/postfix/main.cf ] ; then
 
      # adjust postfix configuration
      if [ -r /etc/postfix/main.cf ] ; then
+        # adjust hostname related options:
         sed -i "s/grml/$HOSTNAME/g" /etc/postfix/main.cf
         sed -i "s/grml/$HOSTNAME/g" /etc/postfix/main.cf
+        sed -i "s/^myhostname = .*/myhostname = $HOSTNAME/" /etc/postfix/main.cf
+        sed -i "s/^mydestination = .*/mydestination = localdomain, localhost, localhost.localdomain, $HOSTNAME/" /etc/postfix/main.cf
+
+        # listen on loopback interface only:
+        sed -i "s/^inet_interfaces = .*/inet_interfaces = loopback-only/" /etc/postfix/main.cf
+        grep inet_interfaces /etc/postfix/main.cf || echo 'inet_interfaces = loopback-only' >> /etc/postfix/main.cf
      fi
   fi
 }
      fi
   fi
 }
index 4b938b9..78bfe51 100644 (file)
@@ -24,7 +24,9 @@ grml-debootstrap (0.23) unstable; urgency=low
     - do not create stage file at finalize()
   * Edit /etc/network/interfaces as well if the file exists already,
     we definitely need at least a loopback interface.
     - do not create stage file at finalize()
   * Edit /etc/network/interfaces as well if the file exists already,
     we definitely need at least a loopback interface.
-  * Adjust hostname in /etc/postfix/main.cf.
+  * Adjust postfix configuration:
+    - modify hostname related options in /etc/postfix/main.cf
+    - listen on loopback interface by default (thanks for suggestion, gebi)
   * Unify the --bootappend option, it's not --boot_append (thanks for
     the hint, Tong Sun).
   * Support execution of further scripts via options --scripts and
   * Unify the --bootappend option, it's not --boot_append (thanks for
     the hint, Tong Sun).
   * Support execution of further scripts via options --scripts and