7

I've been using GNU/Linux for servers, mostly Debian. I am thinking of keeping my personal email on a centralized server. I have some GMail accounts, and a few from different domains from several web projects which are hosted at the corresponding website hosts.

I am buying a new PC to use as a home server for SVN, Web server, DNS, etc. I was thinking of taking advantage of the new hardware to centralize all my emails on one server.

I've had no experience whatsoever with e-mail servers. All I've done is use IMAP, SMTP, POP3, mostly over the internet, never locally. This question is quite wide, but let me explain what I would like to accomplish.

The main objective is keeping my emails locally: download via POP3 all of my emails from GMail and the different domains into one place. Then, I would also like to use some of these domains directly from my home server with a local SMTP. That is, send mails directly from my server, without having to go through a hosting account. I don't know if I'll use it for every account, but I would also like to have the option to use mail via IMAP.

Since I have no experience at all with mail servers, I know not much about options. The operative system will be Debian GNU/Linux Lenny.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
Fernando Briano
  • 470
  • 1
  • 8
  • 14

6 Answers6

10

Mail Server Options

If you can install and configure svn a web server and dns, you should not find it difficult at all to install your own mail server.

Since you're going to go with Gnu Linux/Debian Lenny, I'd suggest using Postfix and Dovecot as your Mail Server Software.

Postfix can handle your mail sending/recieving (smtp, tls etc.) Dovecot can manage your client connections (pop, imap)

Both systems support creation of virtual accounts so you can host email for your family and friends on their choice of domain names (or sub-domains within your domain)

There's plenty of guide/documentation online from the source(s) and interested admins.

There's advocates for other Open Source Mail Servers, exim etc, and it will just come down to picking one and installing it.

Rite of Passage

I have to agree with gyaresu that the question to ask is if the 'cost' / 'benefits' of running your own Mail Server is really worth it?

But, I also believe that joining the realm of the bled and tried sys admins you've really have to bleed some times and just install all these things and operate them.

Installing, configuring, tuning things are part of why you become a good system administrator so it comes as no surprise that you should want to run your own server. And, it is really fun to learn to do these things and have those blinking lights in the bedroom (or whereever the server is going to stay.)

Costs of Running your own mail server?

Although the physical assets and connection times are easy to quantify, we all soon find out that the human/time cost of operating your own servers can be drastic when you have other more interesting things in life to do.

It may not at first become obvious, but if a security vulnerability is discovered for your choice of OS, Mail Server (and all that other stuff on the machine) then time becomes your enemy and the highest cost item.

But as a means of learning more about networking (the smtp/pop3/imap stack) there's nothing better than actually running your own server.

In short, if you're interested in playing with your own mail server, go for it!! You can always take the 'blue' pill another day (or was that the 'red' pill?)

8-)

samt
  • 713
  • 4
  • 10
4

Email Server management is the mind killer.

Unless you have a need for privacy/secrecy then running a mail server is a PITA.

Email is such a 99.99% required uptime service these days that losing email for one or more of your important accounts is potentialy catastrophic.

That said, it's always worth having a spare domain name to use while learning new skills. So you could always just forward your gmail account to the server until it breaks.

My recommendation though is to get a free Google Apps account and take advantage of the excellent spam filtering & all around usefulness of IMAP/Calendar/Docs. It syncs with many handheld phones/devices and has a good record of uptime.

If you need privacy in your correspondence then look to the Firefox plugin FireGPG http://getfiregpg.org/ for encryption.

EDIT: Damn I sound like a grumpy whingebags... I've built a range of mail servers and although I'm not answering your question directly I still think you should question 'why' you want to host your own. Maintaining one is frustrating but learning is always worthwhile.

Gareth
  • 8,413
  • 13
  • 43
  • 44
  • 3
    I have to give my full agreement with this. I've spent years running mail servers, both for work, and for myself. After running my own e-mail server for 15 years, I recently had a catastrophic failure on my mail server which took it offline. During the downtime, I setup a Google Apps for Your Domain account as a temporary "keep the mail flowing" solution. After two weeks, I decided not to rebuild my mail server. If storing your e-mail locally is a requirement, it's not hard to sync IMAP from the Google Apps accounts to a local machine. – Christopher Cashell May 04 '09 at 06:25
2

I do something similar to what you are looking at. I run an openbsd server in my house. It runs dovecot to serve imap from a maildir in my home directory. I use fdm to periodically pull email from a gmail account and dump it in a particular maildir depending on some filtering criteria.

I use postfix as my smtp server (but will replace it with openbsd's smtpd when that's ready). It takes delivery for my domain and passes it to fdm (through my ~/.forward file) for filtering into the right folders as well.

Postfix also does smtp auth so that I can use it as a relay when I'm out of the house. For auth, it actually talks to dovecot, which I've configured with a password database (only has me in it).

Like gyaresu mentions, it's sort of an uptime problem. My power goes out often enough that I would never host important mail on it. If people need to be able to send me stuff, I always give them a different email address. However, for mailing lists and the like, it's awesome to have an imap server that I can manage myself. In fact, the mailing lists go to the mentioned gmail account and then get pulled, so I still get them all without inconveniencing the mailer if my server goes down.

There are services that will serve as a backup mx for you. Your dns record can point to them and mail servers will send there if yours is down temporarily and then they will be relayed when you come back up. For that to work of course, your dns can't be on the same machine as your mail server (as mine is).

Jeremy Huiskamp
  • 332
  • 3
  • 7
1

I just get all my mail forwarded to my Yahoo or GMail accounts, and then retrieve from there. Setting up a personal mail system can be a colossal waste of time (but that doesn't stop me from trying it every once in a while).

Kristopher Johnson
  • 315
  • 1
  • 6
  • 12
1

The way I used to handle my email before I ran my own publicly visible SMTP server was as follows:

  • Run a mail server on my local Unix box. I used to use qmail initially as it's very easy to set up (compared to sendmail or exim, which were the only mainstream alternatives back them) but these days I use postfix. Get the mail server to deliver the incoming email to Maildir mailboxes on the local server.
  • Use fetchmail to feed the email from my ISP accounts into the above mail server
  • You'll also need either an MUA like mutt that can read your email directly out of a Maildir or a pop3/imap server to deliver emails to your mail clients

In your position I'd run a combination of postfix, dovecot (as an imap/pop3 server) and fetchmail for inbound emails and set up postfix to relay outbound emails via your ISPs outbound mail server. My mail setup is similar, but as my mail server receives its email directly I run amavisd-new with SpamAssassin and clamav to get rid of the obvious spam coming in.

Timo Geusch
  • 458
  • 1
  • 4
  • 9
0

You've got several different requests here, whether you realize it or not.

For storage, I recommend a Maildir setup so that something like courier-imap can serve your mail back out to you via IMAP.

You can pull your mail from other POP or IMAP sources into your Maildir using fetchmail.

Outbound is more problematic as I don't know of an SMTP-to-Gmail gateway. In general I like Postfix, though.

pjz
  • 10,497
  • 1
  • 31
  • 40