configure Ubuntu to send mail (as an SMTP client using postfix)

    1. We will start with a trusty DigitalOcean instructional – at least step 1 of that instructional.
      sudo apt-get install mailutils
    2. I want to send mail using mailgun, which allows for ports 25, 587 and 465 (SSL/TLS). I’ll use 587 which is called submission in postfix terminology, I guess due to 587 being the proper port for TLS email submission. Because I want to use encryption (SASL) (or whatever), I need to setup Postfix accordingly. I changed my Postfix config file as such
       ubuntu@machine_name:~$ sudo nano /etc/postfix/main.cf
      #various stuff above
      relayhost = [smtp.mailgun.org]:submission
      mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
      mailbox_size_limit = 20000000
      recipient_delimiter = +
      inet_interfaces = all
      inet_protocols = all
      smtp_sasl_auth_enable = yes
      smtp_tls_security_level = encrypt
      smtp_sasl_security_options=noanonymous
      smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

      Some of these settings are related to the DigitalOcean instructional, such as custom mailbox_size_limit. Make sure all the smtp settings are there

Continue reading “configure Ubuntu to send mail (as an SMTP client using postfix)”