86,7 → 86,11 |
$SED "/^\$IPTABLES -A INPUT -p tcp -s \$SMTP_IP/ s/^/#/g" $LOCAL_IPTABLE_FILE |
$SED "s/^relayhost =.*/relayhost =/" $POSTFIX_CONF_FILE |
elif [[ $TYPE_MAIL -eq 2 ]]; then # Enable mail service (relaying to an extern mail server) |
echo "relayhost = [${smtp}]:${port}" >> /etc/postfix/main.cf |
$SED "s/^MAIL=.*/MAIL=on/" $CONF_FILE |
$SED "s/^MAIL_TYPE=.*/MAIL_TYPE=2/" $CONF_FILE |
$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 |
$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 |
$SED "s/^relayhost =.*/relayhost = $smtp:$port/g" $POSTFIX_CONF_FILE |
elif [[ $TYPE_MAIL -eq 3 ]]; then # Enable mail service (using an email address) |
$SED "s/^MAIL=.*/MAIL=on/" $CONF_FILE |
$SED "s/^MAIL_TYPE=.*/MAIL_TYPE=3/" $CONF_FILE |
104,9 → 108,9 |
[ -d ${SASLPATH} ] || mkdir ${SASLPATH} |
echo "[${smtp}]:${port} ${mailAddr}:${mailMdp}" > ${SASLPATH}/sasl_passwd |
postmap ${SASLPATH}/sasl_passwd |
chmod -R 777 ${SASLPATH} |
#chown root:root ${SASLPATH}/sasl_passwd* |
#chmod 0600 ${SASLPATH}/sasl_passwd* |
chmod -R 644 ${SASLPATH} |
chown root:root ${SASLPATH}/sasl_passwd* |
chmod 0600 ${SASLPATH}/sasl_passwd* |
else |
echo "Erreur ! Aucun type de messagerie sélectionné !" |
exit 0 |