25

I am looking for a simple way to install a mail server on my Ubuntu server. I would like to be able to receive and send emails though a webmail (e.g. roundcube).

I have a domain name. The web server already works without any problem.

When I googled "simple method to install mail server on Ubuntu", I arrive on blogs with literally hundreds of steps to install a mail server:

  1. A Mailserver on Ubuntu 12.04: Postfix, Dovecot, MySQL
  2. Creating a Mail Server on Ubuntu
  3. Postfix

But, for sure I will make a mistake, if I follow those tutorials, and it will be very very time consuming. Most of the steps look very easy to automate, though.

I've try several install methods:

sudo apt-get install dovecot-postfix

sudo tasksel install mail-server

But from there, I have no idea how to add email accounts, and test if it actually works.

Do you know if there is an automated way to install a mail server?

EDIT - NEW ANSWER

Mail-In-A-Box

A very interesting open source project that turns a ubuntu machine into an email server:

https://github.com/JoshData/mailinabox

Tim
  • 33,500
oli
  • 293

8 Answers8

14

This is the best/simple method.

sudo apt-get install postfix

That's it a mail server is installed.

Now administrating that mail server is a whole different story.

By default postfix will deliver and relay for all local user accounts. That should get you started. If you want something more complex then you REALLY REALLY need to read, study, learn, apprentice, etc. Mail servers are very very complex to setup correctly. Even when setup correctly they take constant supervision and monitoring. If your doing anything more then local delivery then I 100% recommend that you do not setup your own mail server.

Do not forget to setup DNS and SPF records if your going to be sending emails to non-local addresses. This is a bare minimum and will not result in deliverable mail to most ISPs.

Again, I strongly urge you to read, and fully understand what you are doing before you even attempt to run a public mail server. Keep in mind, that (at least in the US) you can be fined per email, for emails sent from your server incorrectly. This is rare but has happened. A more common effect is that you get blacklisted, shunned, and marked as a generally evil person and are banned from ever running an email server again (this happens quite frequently).

If your going to run a public server make sure you speak with your ISP/Hosting first. You will need, at a minimum a static IP and their permission. Most ISPs will block you 100% from every getting back on the internet for running an incorrectly configured mail server for an extended period of time.

I add all these warnings so that you know, local delivery, intranet delivery, your fine. Remote delivery, know what you are doing before you even attempt it. Incorrectly configured mail servers can bring on a whole world of disaster if not handled correctly.

coteyr
  • 18,724
9

Zimbra is a great and easy to setup mailserver with collaboration, it might be a bit heavy for some people's needs, but the first time I installed it I had it up and running in under 30 min. It even has paid support, if you really need it.

Neojames
  • 1,744
4

If you are new to email server but still want to set up one. You can check out my blog page Tiny VPS Postfix.

It is a good starting point to learn, and you can expend the configuration for full setup in future.

What it does

  • Send/Receive mail for your domain
  • Forward all incoming email to another email address according to configuration.

What it does not

  • NO local account, all username@your-domain.com are configure for forwarding
  • NO webmail. You will be using third party email service (eg. Yahoo, GMail, etc)

IF this is what you want, THEN I will copy the instruction over here. ELSE I will just leave this answer as is.

John Siu
  • 2,581
  • 1
  • 20
  • 24
4

Mail-In-A-Box

A very interesting open source project that turns a ubuntu machine into an email server:

https://github.com/JoshData/mailinabox

oli
  • 293
2

I use the all-encompassing WEBMIN. Found here

It has different modules that you can incorporate (or not) into managing your server. These modules ie: Apache, RAID, Sendmail and the like are a plug-in for Webmin and therefore become manageable when installed. Webmin can also manage your current installations and reports.

This simple application is the administrators backbone for setting up VOIP, Mail, DATABASE, cloud, firewall and more.

You can keep it simple or roll with the big boys with this.

Any well played system administrator has used this or something like it. This IS the front-end GUI to A Mailserver on Ubuntu 12.04: Postfix, Dovecot, MySQL etc. enter image description here

Ringtail
  • 16,285
2

You should also consider one of the inspirations for "mailinabox," Drew Crawford's post on how to NSA-proof your email in 2 hours.

rfreytag
  • 123
1

This is not short but you won't find anything short. It is easy to follow and very easy to administer as the users, domains, forward tables will be virtual in MySQL. Mail users doesn't need a system account to login to POP or IMAP. Works with StartTLS or SSL.

It guides you to build the mysql queries and to hook them in postfix to use mysql as virtual backend and to install antivirus, anti-spam filters and webmail (SquirrelMail). There are various versions of the guide for different releases of Ubuntu.

http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-ubuntu-12.04-lts.

laurent
  • 6,899
-1

Ubuntu help / MailServer https://help.ubuntu.com/community/MailServer

Ubuntu official documentation is most of the time, easy enough.