Email in Ubuntu 12.04?

March 1, 2014 1.1k views
Hi! I'm trying to install a mail server on my Ubuntu 12.04 droplet, but I honestly don't know how to do it. Which packages do I need? I've been experimenting a bit with postfix, I'm able to send mail to a gmail-address, but not to an email-address hosted at namecheap.com(says something about invalid HELO). Sorry for being such an amateur, haha. Thanks!
2 Answers
I don't recommend hosting a mailserver unless you're really familiar with how it works (which is why I use Google Apps for handling my email). Is there anything preventing you from using hosted email services such as google apps and outlook?
I assume you just want outgoing mail delivery for a web app. Incoming mail servers are a pain in the butt to run and the spam filtering is a full time job, so don't do it - host your email with gmail for business, or some other service that does all that junk for you.

OK, back to outgoing email and the HELO error:

I just went through this. "apt-get install postfix" takes you a large part of the way but mail servers will snigger behind your back until you take some steps...

1. Edit /etc/postfix/main.cf and change "myhostname" to a fully qualified domain name that is actually valid for the server. I suggest this be "www.mydomain.com", NOT just "mydomain.com", because we don't want to do anything that might confuse postfix into thinking it is the destination for incoming mail for the domain.

2. Change "mydestination" and REMOVE your domain name if it is listed. Otherwise postfix will refuse to reach out to other mailservers to deliver mail to addresses on your own company's domain. It'll try to deliver it to local accounts you don't have on the server.

3. Edit "/etc/mailname" and set it to your company's domain name. This ensures that email sent "from" utilities on your server, like cron, has a valid "from" address.

(Of course all this assumes that you have actually registered a domain name and that it actually points to your server, except for incoming mail which, again, you should point at gmail for business or another well-run incoming mail service.)

That should cover it!

Have another answer? Share your knowledge.