Browse Source

Fix: mailhelo.conf is not always present

Robert Zollner 5 years ago
parent
commit
ed0f864ba5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      func/rebuild.sh

+ 2 - 2
func/rebuild.sh

@@ -528,13 +528,13 @@ rebuild_mail_domain_conf() {
         if [ ! -z "$local_ip" ]; then
             IP_RDNS=$(is_ip_rdns_valid "$local_ip")
             if [ ! -z "$IP_RDNS" ]; then
-                if [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
+                if [ -f /etc/exim4/mailhelo.conf ] && [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
                     sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
                 else
                     echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
                 fi
             else
-                sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf
+                sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
             fi
         fi