mail server not working?

May 24, 2014 1.9k views
Hi all, first of all, allow me to clarify that I am so confused about setting up mail server. other than I want it to work correctly, I really wish to understand how things work here! my situation is: I have a website, the website send emails to users on signup. my website works locally perfectly, now am transforming it online.. and here where everything gets confusing! from my little experience and knowledge about servers, I believe I need to set up the following into my Ubuntu 14.04 server : - apache2 - php - mysql - vsftp - ssh - mail server these should all be configured for the web server. all in one server (droplet) what I did configure for mail server are: - postfix - dovecot - SSL - configured DNS (mail 50) - configured IPtables to allow traffic on smtp port and It did not work, I cant send or receive emails (i get reports of un-deliverable emails) My Inquiries: - What I do really need to install/configure in order to run mail server? - What does it mean to add "MX 50", and A record "mail" to DNS? - Do I need to configure FQDN? how? what is the hostnames I should use? - if we say, doesn't that mean there is hostname "mail" inside but my hostname is not called mail? do I have to create separate droplet with "mail" hostname? - do I need POP3? sorry for long talk, as you can see am so confused and in desperate help :) thanks,
4 Answers
Since you are really confused the easiest way I suggest is iRedMail. It will setup your mail server in no time without any cost. iRedMail supports for Ubuntu the release 12.04 and 12.10. See the link bellow on how to install.
by Bulat Khamitov
If you would like to create your own online e-mail system, you can use iRedMail. In this article we will explain how you can do it on your Ubuntu 12.04 virtual server.
Is it compatible with ubuntu 14.04?
Do i need to install it in the new droplet?

It's compatible with 14.04 — that's actually the recommended distro to use for Ubuntu, though there will be really no difference using a different version. You'll need to set it up on a new droplet if you're not entirely sure what you're doing, but after the initial set up you can go ahead and add the packages you need for your apps. Keep in mind that you'll need at least 1GB memory, so that's the $10 droplet. Additionally, if you're unable to modify your configs to work in conjunction with your web apps and mail server, it may be best to use two different droplets; one for your apps and one mail server. It'll make things a lot less confusing.

iRedMail comes fully ready-to-go other than a couple of minor things you need to do for DNS, and the default settings are only suitable for the amount of memory it recommends, so unless you're able to change configs to suit your needs, don't go with the 512MB droplet.

To answer a couple of your other questions:

1) Your MX and A records can be added through DigitalOcean. You would do something like:, as an A record point to your mail server's IP address (your droplet's IP). MX would be and the priority can be anything, but people generally use 5.

2) You can change your droplet's host name by doing,

# sudo nano /etc/hostname

# sudo nano /etc/hosts mail localhost localhost.localdomain

The above is detailed in the iRedMail documentation.

You can use any host name you want to, but you'll likely just want to use "mail." It doesn't matter what it is, as long as it's added in your DNS and points to your mail server IP address.
thanks for explanation.
if I want to embed both mail and web in one droplet, do u know which postfix, dovecot tutorial should I follow? I found more than one tutorial and don't know which suites my situation

thanks a lot!
Have another answer? Share your knowledge.