Skip to content

Instantly share code, notes, and snippets.

@dmitriysafronov
Last active November 5, 2016 15:32
Show Gist options
  • Save dmitriysafronov/e962fec446c342006f20c5e35ec97c2e to your computer and use it in GitHub Desktop.
Save dmitriysafronov/e962fec446c342006f20c5e35ec97c2e to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -z "$(hostname -d)" ]]; then
echo "Set up FQDN first!"
exit 0
fi
echo "postfix postfix/mailname string $(hostname -f)" | debconf-set-selections
echo "postfix postfix/destinations string \$myhostname, $(hostname -s), localhost" | debconf-set-selections
echo $(hostname -f) > /etc/mailname
postconf -e "myhostname= $(hostname -f)"
postconf -e "mydestination= \$myhostname, $(hostname -s), localhost"
postconf -e "compatibility_level= 2"
service postfix reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment