Electronic Mail

e-mail Electronic Mail Service

Table of Contents

E-mail may just be the lifeblood of the Internet, unless you’re younger than 25.

The Unix philosophy of specific tools, for specific purpose, improves quality as each tool can focus on a particular task. A standard Unix email server is thus a combination of task specific tools.

Serving Electronic Mail

Various tools are available for each major component of an industrial strength email service. Invariably the protocols implement support for standards such as POP3, and IMAP to allow email clients to retrieve email and SMTP for sending email messages.

E-Mail exchange messages between clients and servers, where your client tool maybe Microsoft Outlook, or Mozilla Thunderbird sending and recieving email from a Mail Server.

Your client in this transaction is the MUA - Mail User Agent, and the Server is the MTA - Mail Transfer Agent.

In these notes we’ll build a basic mail server, then extend it with some additional features that will give you more flexibility on how you can deploy your mail server.

  • Basic Mail Server
  • Virtual Accounts
  • Encryption
  • Web Mail clients
  • Verifying Service Delivery
  • Support Tools

Basic Mail Server

[ Basic Mail Server | Client Access]

The Basic Mail Server is thus a service that combines support for the above standards for email. The standards describe services managed for mail transfer (MTA) and for access by clients (MUAs)

The Mail Transfer Agent (Server)

Mail Server including MTAs

The Mail Server’s Mail Transfer Agent - MTA stores and forwards email between it’s clients, and other servers.

Delivery can be local (to local users) or external by forwarding the message to another MTA. OpenBSD’s base installation provides you with a full service MTA Sendmail. These documentation will primarily focus on another MTA.

  • Postfix (a well regarded mail server, included with the OpenBSD ports collection.)

For a comparison of MTA’s, consider reading MTA Comparison by Dan Shearer and Wikipedia’s entry Comparison of mail servers

Clients Access through POP3, IMAP Server

On the mail server, we must also install tools to support client connections to retrieve email. Users normally access their e-mail through desktop tools such as Microsoft Outlook and Mozilla Thunderbird or through a web interface.

Clients ‘send’ their e-mail to the MTA’s for delivery using the protocol SMTP.

Two standard protocols to retrieve e-mail from a server are POP3 and IMAP. OpenBSD base install provides popa3d but requires a separate tool for IMAP. These notes will focus on:

Virtual Accounts

[ Virtual Accounts | Client Access | Domains]


[ Encryption]

Web Mail clients

[ Web Client]

Verifying Service Delivery

[ Validating Service Delivery]

Support Tools

As shown in the above diagram, many tools (independent of the mail server) are required to ensure the mail delivery service works. Infrastructure systems include:

Domain Name Server (DNS)

[Ref: OpenBSD as a domain name server | Is my DNS a mess]

A key infrastructure for email delivery, is Domain Name Services (DNS). For mail destined outside, or coming from the outside we are dependent on the Global DNS.

Your MTA Mail Server will need connection to a DNS server, to find out where to send e-mails, and it needs to be listed on the DNS system (so other Mail Servers can forward e-mail to your server.)

Common Fault:

When you can ping your mail host, but can’t connect with SMTP, check your DNS setting (either /etc/resolv.conf or /var/spool/postfix/etc/resolv.conf)

Authentication Database

For a mail system servicing a small number of static users, it is sane to maintain user account details using text/hash database files (or the host system accounts.) Large installations, with a high frequency of user changes may benefit from flexibility through a database server.

GUI Management Tool

GUI toolses are always ’the cool thing to have’TM but comes with different concerns about their security level and whether it provides you with a more dangerous tool in the hands of the unlearned.

  • Postfixadmin is a wonderful Web GUI tool for managing your postfix/dovecot installation.