-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpostfix.sh
More file actions
executable file
·21 lines (21 loc) · 1004 Bytes
/
postfix.sh
File metadata and controls
executable file
·21 lines (21 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
echo "start postfix"
# Email with Posfix
#rm /etc/hostname
#rm /etc/hosts
echo "$HOSTNAME" > /etc/hostname
cat /root/deployment/config_files/etc_hosts.txt > /etc/hosts
sed -i "s/HOSTNAME_REP/$HOSTNAME/g" /etc/hosts
echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections
echo "postfix postfix/mailname string $HOSTNAME" | debconf-set-selections
echo "postfix postfix/destinations string localhost.localdomain, localhost" | debconf-set-selections
aptitude -y install postfix telnet mailx mailutils bsd-mailx
rm /etc/aliases
echo "root: $USER" >> /etc/aliases
newaliases
sed -i "s/myorigin/#myorigin/g" /etc/postfix/main.cf
echo 'myorigin = $mydomain' >> /etc/postfix/main.cf
sed -i "s/mydestination/#mydestination/g" /etc/postfix/main.cf
echo "mydestination = $POSTFIX_FIX, localhost.$POSTFIX_FIX, localhost" >> /etc/postfix/main.cf
sed -i "s/mynetworks/#mynetworks/g" /etc/postfix/main.cf
echo "mynetworks = 127.0.0.0/8" >> /etc/postfix/main.cf
/etc/init.d/postfix restart