From 4a528463dac7a07d22044dd0c7083c8426694471 Mon Sep 17 00:00:00 2001 From: Juan Luis Baptiste Date: Fri, 22 May 2015 23:45:58 -0500 Subject: [PATCH] Also set mydestination. --- run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run.sh b/run.sh index 2d8ea38..71a12a9 100644 --- a/run.sh +++ b/run.sh @@ -4,10 +4,15 @@ [ -z "${SMTP_USERNAME}" ] && echo "SMTP_USERNAME is not set" && exit 1 [ -z "${SMTP_PASSWORD}" ] && echo "SMTP_PASSWORD is not set" && exit 1 +#Get the domain from the server host name DOMAIN=`echo $SERVER_HOSTNAME |awk -F. '{$1="";OFS="." ; print $0}' | sed 's/^.//'` +#Comment default mydestination, we will set it bellow +sed -i -e '/mydestination/ s/^#*/#/' /etc/postfix/main.cf + echo "myhostname=$SERVER_HOSTNAME" >> /etc/postfix/main.cf echo "mydomain=$DOMAIN" >> /etc/postfix/main.cf +echo 'mydestination=$myhostname' >> /etc/postfix/main.cf echo 'myorigin=$mydomain' >> /etc/postfix/main.cf echo "relayhost = [$SMTP_SERVER]:587" >> /etc/postfix/main.cf echo "smtp_use_tls=yes" >> /etc/postfix/main.cf