Recall at the end of the last post, I said you’d need a number of things:

  • A computer to run the email software and store emails.
  • A reliable Internet connection.
  • A static IP address, so computers on the internet can find you.
  • A domain name, so people on the internet can find you.
  • An operating system.
  • Mail Transfer Agent software, to exchange email with other mail servers.
  • Mail Delivery Agent software, to deliver mail to a local mailbox.
  • Mail User Agent software, to read your emails.

First things first, then: a computer.

There are two basic options: physical or virtual. If you’re a little fuzzy on what a “virtual computer” is, I’ll explain that presently.

The Physical Computer

Computer?

The simplest configuration is a physical computer. If you’re planning to run an email service out of your house, a physical computer must be involved.  I’m avoiding the word “server” here because that has the connotation of a big rack mount “data center” machine. A small, personal email service can be run on a very modest computer. For years, I ran my service on a used machine with a 1.3GHz Athlon and 768MB of memory. Before you head for the closet to dig out that Compaq luggable, though, there are some considerations:

  • The computer is expected to be running most of the time. You can actually get away with a surprising amount of downtime and not lose email[1], but the computer should be pretty reliable. Redundancy features increase reliability, but cost more.
  • The computer requires power and cooling. A data center-class server, particularly an old machine built before CPU frequency scaling became common, will noticeably increase your monthly power bill. If you have a place in your house that stays cool, like a dry basement, or if you just have adequate AC, you may not need to take special cooling precautions. But, air must circulate around the computer. If you put a computer in a closet, you will burn it up.
  • Computers make noise. You may not notice it during the day, when there is plenty of other ambient noise. But if you put a computer that makes even modest fan noise someplace where you can hear it when you’re trying to sleep, your wife will choke you[2].
  • The computer needs adequate storage, both in terms of capacity and reliability. How much is adequate capacity depends on your users. Sending[3] and receiving large attachments consumes storage, as do users that never clean out old emails. Adequate reliability depends on your tolerance for risk. You can get by with a single disk, but if your storage fails, you risk losing your mail store. Redundant storage is easy to set up and doesn’t require special hardware, but multiple disks cost more. In both cases, you need a robust backup scheme[4].

If you can swing it, I argue that a physical computer, in your house, maximizes your control and minimizes the number of outside parties that can interfere with your email service. If you can’t, for whatever reason, run your service from your house, you’re most likely left with the virtual computer option, unless you’re tight with the IT people where you work[5], or can afford to rent space in a co-location.

The Virtual Computer

I expect everyone generally understands the physical computer. You’ve got a CPU, some memory, some storage, and a network interface. When you install an operating system (OS) on a physical computer, the OS talks to the various devices, memory, storage, etc., over the computer’s internal communication channels. The OS knows how to make inquiries to determine what hardware is present. The various bits respond to these inquiries, and so the OS can learn what model disk controller, network interface, etc. are present.

A virtual computer (or virtual machine, a VM) exists in a “virtualization environment” that runs on the physical computer. That environment serves as a layer of abstraction from the hardware, and allows the creation of VMs that pretend to have the various hardware devices. When you install an OS on a VM, all the “devices” still respond to the same inquiries in the expected way, so the OS behaves like it’s installed on a physical computer. Typically, virtualization is used to chop a physical computer with lots of resources (CPU, memory, etc) into smaller VMs. If you’ll be renting a VM from some online provider, this is what you’ll get, a little slice of a big server. You don’t care about the details of the physical computer. You only need to specify the CPU, memory and storage your VM will need, which, aside from possibly storage, is not much. Power, cooling, hardware maintenance, etc., will all be handled by the VM provider.

Why Not Both?

Why not?

Even if you are able to host a physical computer, you may still want to run the email service in a VM. Why bother, when you can just run on the real hardware? There are a couple reasons:

  • Virtualization insulates the VM from changes in the underlying hardware. You can migrate a VM from one physical computer to another with little or no downtime for the VM. If you need to do hardware maintenance, or upgrade to a new computer, you can use the virtualization environment to migrate the VM, and the OS running on the VM needn’t be shut down, or even know about it.
  • Virtualization also makes it easy to isolate services. If you plan on running an email service, and a web site, and a file server, etc., you can use multiple VMs to put each service in a separate environment. This is primarily for security. All software has bugs, and sometimes those bugs result in vulnerabilities that can be exploited remotely. If one VM is compromised, then only one service is affected, limiting the damage.

Note, however, if you want to go this route, that some virtualization environments require hardware support. That is, the physical CPU must have certain features for the virtualization environment to run. Bear that in mind as you pick your computer.

What I Have Done

I opted for a second-hand Dell server from an online server refurbishing outfit. The server itself was pretty cheap. I actually bought two, to have the second for spare parts. This server is the heart of our home network[6], so the reliability features (dual power supplies, integrated hard disk enclosure and RAID controller, ECC memory) mean enough to me that I’m willing to eat the operating cost of powering the thing. I bought Dell because we used them for years at work, so I’m comfortable with the hardware, and Dell’s RAID controller has a powerful command line tool[7] to monitor and manage your storage.

Our internet service is via DSL. It’s not blazing fast, but it’s not bad, given how far out in the sticks we are. Our ISP offers a static IP address for a not completely horrible surcharge. It’s actually a bottom tier business product, so I also get the number for business tech support, which is nice. For reasons I will attempt to explain in Part 3, I actually have two static addresses[8].

I also went for virtualization. I have two domain names, one for each IP address, and I run email service and web sites for both, all isolated in separate VMs. The VMs are very modestly sized: one CPU, 1GB memory, 10GB storage for each. My user base is two people: myself and my wife, and she only gets email in the “primary” domain, so these VMs are plenty big.

Next time, I’ll digress a bit and talk about IP networking, so hopefully the stuff that comes later will make more sense.

[1] That is, not lose emails that others are trying to deliver to you.

[2] Or so I’m told.

[3] Assuming you automatically copy outgoing mail to a “Sent” folder.

[4] Watching a failure cascade in your RAID array is like getting kicked in the junk for a couple hours.

[5] They won’t mention your TFC email server if you don’t mention their pirate movie download server. Not that I would know.

[6] Seriously. Without this server, we’re down to cell phone hotspots.

[7] Written by sadists, but powerful and full-featured.

[8] IPv4 address space exhaustion? Don’t care.