Line 98... |
Line 98... |
98 |
$SED "s/^MAIL_SMTP_IP=.*/MAIL_SMTP_IP=$smtp/" $CONF_FILE
|
98 |
$SED "s/^MAIL_SMTP_IP=.*/MAIL_SMTP_IP=$smtp/" $CONF_FILE
|
99 |
$SED "s/^MAIL_PORT=.*/MAIL_PORT=$port/" $CONF_FILE
|
99 |
$SED "s/^MAIL_PORT=.*/MAIL_PORT=$port/" $CONF_FILE
|
100 |
$SED "s/^MAIL_ADDR=.*/MAIL_ADDR=$mailAddr/" $CONF_FILE
|
100 |
$SED "s/^MAIL_ADDR=.*/MAIL_ADDR=$mailAddr/" $CONF_FILE
|
101 |
$SED "s/^MAIL_WHITEDOMAIN=.*/MAIL_WHITEDOMAIN=$whiteDomain/" $CONF_FILE
|
101 |
$SED "s/^MAIL_WHITEDOMAIN=.*/MAIL_WHITEDOMAIN=$whiteDomain/" $CONF_FILE
|
102 |
$SED "s/^MAIL_ADMIN=.*/MAIL_ADMIN=$adminMail/" $CONF_FILE
|
102 |
$SED "s/^MAIL_ADMIN=.*/MAIL_ADMIN=$adminMail/" $CONF_FILE
|
103 |
$SED "s/^#SMTP_IP=.*/SMTP_IP=$port/" $LOCAL_IPTABLE_FILE
|
103 |
$SED "s/^#SMTP_IP=.*/SMTP_IP=$smtpIP/" $LOCAL_IPTABLE_FILE
|
104 |
$SED "s/^#SMTP_PORT=.*/SMTP_PORT=$port/" $LOCAL_IPTABLE_FILE
|
104 |
$SED "s/^#SMTP_PORT=.*/SMTP_PORT=$port/" $LOCAL_IPTABLE_FILE
|
105 |
$SED "s/^#\$IPTABLES -A OUTPUT -p tcp -d \$SMTP_IP.*/\$IPTABLES -A OUTPUT -p tcp -d \$SMTP_IP --dport \$SMTP_PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT/" $LOCAL_IPTABLE_FILE
|
105 |
$SED "s/^#\$IPTABLES -A OUTPUT -p tcp -d \$SMTP_IP.*/\$IPTABLES -A OUTPUT -p tcp -d \$SMTP_IP --dport \$SMTP_PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT/" $LOCAL_IPTABLE_FILE
|
106 |
$SED "s/^#\$IPTABLES -A INPUT -p tcp -s \$SMTP_IP.*/\$IPTABLES -A INPUT -p tcp -s \$SMTP_IP --sport \$SMTP_PORT -m conntrack --ctstate ESTABLISHED -j ACCEPT/" $LOCAL_IPTABLE_FILE
|
106 |
$SED "s/^#\$IPTABLES -A INPUT -p tcp -s \$SMTP_IP.*/\$IPTABLES -A INPUT -p tcp -s \$SMTP_IP --sport \$SMTP_PORT -m conntrack --ctstate ESTABLISHED -j ACCEPT/" $LOCAL_IPTABLE_FILE
|
107 |
$SED "s/^relayhost =.*/relayhost = $smtp:$port/g" $POSTFIX_CONF_FILE
|
107 |
$SED "s/^relayhost =.*/relayhost = $smtpIP:$port/g" $POSTFIX_CONF_FILE
|
108 |
[ -d ${SASLPATH} ] || mkdir ${SASLPATH}
|
108 |
[ -d ${SASLPATH} ] || mkdir ${SASLPATH}
|
109 |
echo "[${smtp}]:${port} ${mailAddr}:${mailMdp}" > ${SASLPATH}/sasl_passwd
|
109 |
echo "[${smtpIP}]:${port} ${mailAddr}:${mailMdp}" > ${SASLPATH}/sasl_passwd
|
110 |
postmap ${SASLPATH}/sasl_passwd
|
110 |
postmap ${SASLPATH}/sasl_passwd
|
111 |
chmod -R 644 ${SASLPATH}
|
111 |
chmod -R 644 ${SASLPATH}
|
112 |
chown root:root ${SASLPATH}/sasl_passwd*
|
112 |
chown root:root ${SASLPATH}/sasl_passwd*
|
113 |
chmod 0600 ${SASLPATH}/sasl_passwd*
|
113 |
chmod 0600 ${SASLPATH}/sasl_passwd*
|
114 |
else
|
114 |
else
|