#!/bin/bash

: ${MAIL_SERVER=$MAIL_PORT_25_TCP_ADDR}


sed -i "s/relayhost =.*/relayhost = ${MAIL_SERVER}/" /etc/postfix/main.cf
sed -i "s/myhostname =.*/myhostname = `hostname`/" /etc/postfix/main.cf

exec /usr/lib/postfix/master -d -c /etc/postfix
