Skip to content

Commit ed0f864

Browse files
committed
Fix: mailhelo.conf is not always present
1 parent 348d128 commit ed0f864

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

func/rebuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,13 @@ rebuild_mail_domain_conf() {
528528
if [ ! -z "$local_ip" ]; then
529529
IP_RDNS=$(is_ip_rdns_valid "$local_ip")
530530
if [ ! -z "$IP_RDNS" ]; then
531-
if [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
531+
if [ -f /etc/exim4/mailhelo.conf ] && [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
532532
sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
533533
else
534534
echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
535535
fi
536536
else
537-
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf
537+
sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
538538
fi
539539
fi
540540

0 commit comments

Comments
 (0)