Skip to content

Commit

Permalink
setup postfix hostname using conf file
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Aug 22, 2023
1 parent fe381bf commit b0e4340
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
23 changes: 4 additions & 19 deletions susemanager/bin/mgr-setup
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,10 @@ fi
}

setup_mail () {

# fix hostname for postfix
REALHOSTNAME=`hostname -f`
if [ -z "$REALHOSTNAME" ]; then
for i in `ip -f inet -o addr show scope global | awk '{print $4}' | awk -F \/ '{print $1}'`; do
for j in `dig +noall +answer +time=2 +tries=1 -x $i | awk '{print $5}' | sed 's/\.$//'`; do
if [ -n "$j" ]; then
REALHOSTNAME=$j
break 2
fi
done
done
fi
if [ -n "$REALHOSTNAME" ]; then
echo "$REALHOSTNAME" > /etc/hostname
fi
# bsc#979664 - SUSE Manager requires a working mail system
systemctl --quiet enable postfix 2>&1
systemctl restart postfix
postconf -e myhostname=$HOSTNAME
# bsc#979664 - SUSE Manager requires a working mail system
systemctl --quiet enable postfix 2>&1
systemctl restart postfix
}

setup_hostname() {
Expand Down
1 change: 1 addition & 0 deletions susemanager/susemanager.changes.mbussolotto.postfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- setup postfix hostname using conf file

0 comments on commit b0e4340

Please sign in to comment.