Open main menu

Notes on using Postfix [1]. Quick and dirty procedure for setting up Postfix on a new machine that needs email.

Setting up Postfix

Add Postfix Mail Transfer Agent as satellite smarthosting through Google, install mail utilities, setup an alias for root's mail and test it all

  1.  sudo su -
    
  2.  apt-get install postfix
    
  3.  apt-get install bsd-mailx
    
  4. cat <<HERE | sudo tee /etc/postfix/main.cf > /dev/null
    # work-around for Digital Ocean's blocking of IPv6 for email
    smtp_bind_address = 0.0.0.0
    # satellite configuration
    smtp_use_tls = yes
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtp_sasl_tls_security_options = noanonymous
    
    HERE
    
  5.  echo "smtp.gmail.com me@example.com:PASSWORD" > /etc/postfix/sasl_passwd
    
  6.  postmap /etc/postfix/sasl_passwd
    
  7.  chmod 640 /etc/postfix/sasl_passwd*
    
  8.  chown postfix:postfix /etc/postfix/sasl_passwd*
    
  9.  /etc/init.d/postfix restart
    
  10.  echo "root: me@example.com" >> /etc/aliases && newaliases
    
  11.  echo test |mail -s "test mail sent to external" greg.rundlett@gmail.com
    
  12.  echo test |mail -s "test mail sent to root" root
    


References

  1. loosely following the info at http://braiden.org/?p=15