Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have to develop a web mail client for one of our clients, and we're looking for an email server we can utilize that would possibly be able to interface with PHP.

We'll most probably host on Ubuntu Server edition with Apache, but obviously, writing the server itself would be reinventing the wheel, which we want to avoid at all costs.

Can anyone recommend an email server that we can use that is possibly administered by the command line in Ubuntu? We don't want a email server that is too tightly integrated with it's own UI, as we might even want to add administrative features for the server in the webmail application.

share|improve this question

migrated from Jan 11 '10 at 5:44

This question came from our site for professional and enthusiast programmers.

Do you really need/want/have to build a webmail from scratch ? (see my answer to this question :… ) – Pascal MARTIN Jan 10 '10 at 21:26
If I understand correctly, you are just looking for a Mail Server (like Exim), in which case this belongs to Serverfault. – Gordon Jan 10 '10 at 21:28
@Pascal Martin has a good point. There are so many very customizable good Open Source and commercial webmail solutions out there that writing one from scratch sounds strange. – Pekka 웃 Jan 10 '10 at 21:39
up vote 4 down vote accepted

ubuntu will use postfix by default (for the smtp mta), and dovecot for imap and pop. if your interface uses imap protocol underneath the hood, you'd be compatible with any imap server...

you could also use an open source webmail package like roundcube, squirrelmail or horde and extend/customize if for your needs

some more details on ubuntu's integration:

share|improve this answer

Are we talking about an MTA (SMTP server) or an IMAP/POP server? I recommend Postfix for mail delivery (MTA) and Dovecot for IMAP and POP. Both use the Maildir format, are high-performing and easy to work with. The manuals are extensive.

The easiest (and best?) solution is probably to write a webmail client that talks IMAP to the mail server. In that case, the servers behind the curtains are not so important as long as you can talk to them using IMAP and SMTP. A big advantage to this approach is that your server administrators can use standard tools and approaches to load-balancing and scaling.

share|improve this answer

Ubuntu have integrated / packaged together Dovecot and Postfix in a pretty simple way, I'd suggest you start there.

sudo apt-get install dovecot-postfix
share|improve this answer
We were burnt by doing it this way recently, dovecot-postfix adds a second Dovecot config file and sets Dovecot to no longer user the standard config file. We spent a long time editing the standard config file and wondering why nothing was changing. – kaerast Jan 11 '10 at 11:18

If you need to configure the mail server (sendmail, dovecot, postfix...) from your webmail application, you will typically need to modify some configuration files and restart the service. However, if you want to be able to modify the mail server by connecting to the mail server and issuing some commands, you can consider using Citadel which has a telnet service. You can issue command sequences through the telnet service to reconfigure the entire mail server on-the-fly.

share|improve this answer

I second Postfix + Dovecot. A couple of things which will help you understand the relationship between the MTA and your Web interface are Postfixadmin and Squirrelmail ( Postfixadmin is a PHP web interface for managing mailboxes in Postfix. Squirrelmail is a PHP webmail system. Both open source so you can take a look at the underlying code, and maybe use some of it in your app.

share|improve this answer

I recommend you to look at Atmail. They have either a web-mail only and a full e-mail server solution. Their web front end is written in PHP (Zend Framework). You could build the server with the same MTA software as they do. (I think it is Exim and Courier IMAP, but you have to check it.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.