AWS SES with exim4 on debian-based Linux

  1. apt-get install exim4
  2. dpkg-reconfigure exim4-config
    1. Select: internet site; mail is sent and received directly using SMTP
    2. IP-addresses to listen on for incoming SMTP connections:
      1. ; ::1 (it's the default anyways)
    3. Take most defaults
    4. Split configuration into small files?
      1. NO!
  3. lsof -nP -i :25
    1. Make sure you aren't allowing the world to connect!
      1. is good
  4. AWS -> SES
    1. Verified Senders
      1. Verify one of your existing email addresses
    2. SMTP Settings
      1. Create My SMTP Credentials
      2. Use downloaded credentials.csv file contents for below steps
  5. Edit /etc/exim4/exim4.conf.template
    1. Find ALREADY existing line "public_name = LOGIN"
      1. change to "public_name = OLD_LOGIN"
    2. Add below sections to existing sections in the file
    3. Use info from credentials.csv in place of pointy brackets, e.g. <aws_id> 
  6. service exim4 stop
  7. service exim4 start
  8. tail -F /var/log/exim4/mainlog
    1. Keep this running in another terminal while you do the below
  9. echo test001 | mail -r <email_you_verified_with_aws> -s "Test subject" <a_test_email_address>
    1. e.g. echo test001 | mail -r -s test
  10. See this to set the "From:" field to your verified user for every email sent from your system

begin routers

  driver = manualroute
  domains = ! +local_domains
  transport = ses_smtp
  route_list = *

begin transports

  driver = smtp
  port = 25
  hosts_require_auth = $host_address
  hosts_require_tls = $host_address

begin authenticators

  driver = plaintext
  public_name = LOGIN
  client_send = : <aws_id> : <aws_secret>


Popular posts from this blog

Debugging pfsense firewall rules clearly and easily

Direct ssh to a server via proxy using putty/plink on Windows

telnet vs netcat