I'm trying to understand how all the components of a mail server fit together.

  • I understand that the SMTP server is necessary to send emails.
  • In terms of accessing email, I'll setup a webmail client but do not need access through a desktop client.

So my question is: do I need an IMAP server in this case? or can the webmail client somehow link directly to the SMTP to send and read emails?


For setting up your email server and webmail, you need two things:

  • an SMTP server, to send out messages, as you said,
  • a way to read the received messages, that's the part you're actually asking for.

The webmail will not actually be receiving the messages, it will only read or fetch them from somewhere. It is the smtp server (usually the same as the one used to send) that will receive messages and store them somewhere (on disk, but could also be in some database) through the use of an MDA (Message Delivery Agent). Then you need a way for you webmail to access that somewhere.

Depending on your setup and the webmail client you want to use, there are various options:

  • IMAP is one of them, probably the most common and versatile,
  • POP3 is another one,
  • but you could also use direct access to the storage:
    • directly from the disk (provided your smtp server receiving messages is on the same host as your webmail),
    • from the DB storing the messages (if your SMTP server stores messages in DB, not very common).

If you don't want IMAP nor POP3, you could use the disk direct access solution, but you need a webmail software that can read either mbox or maildir email storage. Those are the 2 most popular ways of storing messages on a UNIX host. mbox is a single file containing all messages, maildir is a directory with subdirectories with each messages as a separate file. maildir format is the most common and powerful.

Such a webmail client is not very common, you'd probably have to develop it yourself (or a plugin for other existing webmail software). Still, there is one I know capable of doing that it is SqWebMail, included with courier email server suite.

DB message storage is a possibility, but probably only used in very large setup.

You might also be interested by this post on StackOverflow.


This is related to something I answered earlier today:

Mails are not receiving in Squirrelmail?

Except you're using Roundcube instead of Squirrelmail.

Also, take a look at:


as an overview of the various components of the mail system (i.e., MTA, MUA, MDA).

Roundcube, if I recall, is purely an IMAP client, maybe some POP3, I don't recall. In either case, you will need an IMAP server acting as the MDA.

That said, I can't think of any web-based mail client that will access the legacy mail spools off hand. It would be possible to write one, but that feels somewhat inflexible, given that we've already invented IMAP, which takes care of issues like simultaneous access on the spool file, etc. If you're running a for-real mail system in this day and age, you will want to use an MDA supporting something like IMAP.

There are also big, "groupware" systems like Horde or Zimbra. These will give you the whole mail system (plus other groupware applications) in one big package, so, in a sense, you'd only be installing one piece of software. But, under the hood, the internals will have the mail architecture concept I mentioned above, with an MTA -> MDA -> MUA.

  • I'm aware of Zimbra and don't want to go that monolithic route. I'd prefer to install as components so I can switch easily if needed in the future. Also Zimbra and other mail server suites probably have a lot more additional little things that I probably won't need. – sameold Aug 13 '12 at 1:25
  • In that case, just set up Dovecot, which, I think, is fairly lightweight. Yes, it's an extra component, but it's no an onerous requirement. – cjc Aug 13 '12 at 1:27

No. A client that receives via SMTP is not a client anymore but a server. While there's no technical reason you can't have an SMTP server with a web interface for accessing messages, this is not how clients work. Also bear in mind that SMTP is a push protocol, so while another server could certainly send messages on to your "client", that "client" could net fetch messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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