How do I set up my Ubuntu VPS to send outgoing mail?

Max Cantor picture Max Cantor · Oct 13, 2008 · Viewed 13.7k times · Source

My VPS provider (Slicehost) doesn't provide an SMTP server. I use Google Apps to send and receive mail for my domains, but I want to be able to programmatically send e-mail.

I've been Googling this issue on and off for many months, and I just can't seem to get a clear picture of what I need to do. Do I just need an MTA like postfix? Do I configure it as a "satellite", or an "internet" site? Do I need to make any DNS changes? If I want to programmatically receive e-mail someday, are there any configuration options I should be careful about tinkering with? Also, if my VPS host did provide an SMTP server, what wouldn't I need to do, that I'm doing now?

Thank you!

Edit: A quick synopsis of my findings:

  • Update /etc/hosts and /etc/hostname to reflect the FQDN (for example, mail.domain.com or sub.domain.com instead of slicename)
    • Reboot and verify with hostname -f
  • Set up reverse DNS (which is owned by whoever owns the IP pool) to point at the same FQDN
    • Check that the RDNS has propogated with dig -x server.ip.address
  • sudo aptitude install postfix telnet mailx
    • Use internet site setting
    • Set FQDN to whatever was chosen above
  • Test with mail [email protected]

Answer

Scott Bennett-McLeish picture Scott Bennett-McLeish · Oct 13, 2008

Have you looked here, seems to me that there is plenty of information to get started. I found mail-server-slice-setup to be quite informative.