Skip to content

Commit 705a383

Browse files
committed
Simplify mailhelo.conf rebuilding/cleanup
Fixed hestiacp#1022
1 parent 1e69505 commit 705a383

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

func/rebuild.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,14 +527,9 @@ rebuild_mail_domain_conf() {
527527
# Setting HELO for mail domain
528528
if [ ! -z "$local_ip" ]; then
529529
IP_RDNS=$(is_ip_rdns_valid "$local_ip")
530+
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
530531
if [ ! -z "$IP_RDNS" ]; then
531-
if [ -f /etc/exim4/mailhelo.conf ] && [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
532-
sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
533-
else
534-
echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
535-
fi
536-
else
537-
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
532+
echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
538533
fi
539534
fi
540535

0 commit comments

Comments
 (0)