setup_postfix.sh 824 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # run this as root/sudo on the Ubuntu VM to configure SMTP for password resets
  3. echo "🔧 Installing and Configuring Postfix for Local Food AI..."
  4. sudo apt-get update
  5. # Non-interactive installation of postfix configured for local delivery
  6. sudo DEBIAN_FRONTEND=noninteractive apt-get install -y postfix
  7. echo "🔒 Disabling external relay to maintain 100% Privacy-First Architecture..."
  8. # Ensure postfix only listens to localhost for security
  9. sudo postconf -e "inet_interfaces = loopback-only"
  10. sudo postconf -e "mydestination = localhost.localdomain, localhost"
  11. echo "🔄 Restarting Mail Service..."
  12. sudo systemctl restart postfix
  13. sudo systemctl enable postfix
  14. echo "✅ Success! The 'Forgot Password' feature in the Streamlit UI will now officially route emails to users via the internal Ubuntu backbone!"