Skip to content

Instantly share code, notes, and snippets.

@dkittell
Created November 11, 2020 18:09
Show Gist options
  • Save dkittell/46c1e1403294a23cc3315cd14b723915 to your computer and use it in GitHub Desktop.
Save dkittell/46c1e1403294a23cc3315cd14b723915 to your computer and use it in GitHub Desktop.
# View current configuration
cat /etc/postfix/main.cf | grep inet_interfaces
# Backup current configuration to a date/time stamp formatted file
sudo cp /etc/postfix/main.cf /etc/postfix/main_`date +%Y_%m_%d_%H.%M.%S`.cf
# Make the change
sudo sed -i "s|inet_interfaces = all|inet_interfaces = 127.0.0.1|" /etc/postfix/main.cf
# Review the current configuration
cat /etc/postfix/main.cf | grep inet_interfaces
# Restart the service
sudo systemctl restart postfix
# Get the service status
sudo systemctl status postfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment