diff --git a/install/alternc.install b/install/alternc.install index 74bcc59d..a95a5243 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -484,10 +484,12 @@ fi ####################################################################### # populate alternc database with the mailname used by postfix to send mail for each vhost # -mailname=`cat /etc/mailname` -mysql_query "update variable SET value='"$mailname"' where name='mailname_bounce';" +# If mailname does not exist, create it. Fix #1495 +test -e "/etc/mailname" || hostname -f > "/etc/mailname" # Allow for all the users to view /etc/mailname chmod +r "/etc/mailname" +mailname=`cat /etc/mailname` +mysql_query "update variable SET value='"$mailname"' where name='mailname_bounce';" ####################################################################### # Save installed files to check them during next install