create new tag
, view all tags
<refactoring in progress>

I finally have email setup on my Linux systems the way I want it. (I run a home LAN with Windows and Linux clients, and my setup includes an email server to serve clients on any of those machines.) I'm recording my experiences here.

Historically, when Dos/Windows started doing email, they took a much simpler approach than the traditional *nix approach. Here is some discussion about that.

You can make simpler setups in Linux, as simple as any in Windows, and, unless you have a special need or a desire to learn, I suggest you do so.

I have a fairly complex email setup. Here is why.

My main focus will be on my email setup, which, while fairly complex was fairly simple to install once I understood the right things.

Note: There are still [[][things I don't yet understand]].

<refactoring stopped here (temporarily)>

<second alternate approach (apparently I lost one last time Mozilla locked up)>

If you want to set up email in Linux, I recommend the following:

  • If you don't need any more than the "Windows style client" approach (using, of course, a Linux email client like kmail, sylpheed, mozilla, mahogany, netscape, Pine, or whatever) stick with that. Remember that many of those clients can filter mail for you, so you don't necessarily need the email server / procmail approach that I went for.

  • If you need something more than that, consider implementing what I implemented, but with the few modifications necessary to avoid the arcane things that I needed to do for my unusual circumstances. (I will mention those somehow somewhere.)

    • If you decide to do what I did (without the arcane stuff), choose a Linux distribution that can install and configure the necessary software for you during the normal installation. You might have to tweak a few things in the configuration, but that's a lot easier than compiling from source and configuring everything, or even installing from rpm or apt. I am using Mandrake 7.2 with the MandrakeFreq update on a low end box I've dedicated to using as my local server. This leaves me free to use my higher end machine for my Linux workstation, and lets me update that at will without risking my working email and Apache (TWiki) servers. The software I needed for my server configuration includes fetchmail, postfix, procmail, and an IMAP/POP server. (I am not 100% sure, but I think the IMAP/POP server installed by Mandrake 7.2 by default is the University of Washington IMAP server, which includes daemons for IMAP (imapd) and POP3 (ipop3d).)

    • The server makes use of some "infrastructure" that will almost certainly also be installed by default by your distro -- things like a network connection (whether dial up modem, DSL, cable modem, local connection, or whatever), a shell (I use bash, and wrote a script called from cron to fetch the mail every 10 minutes), cron, and so forth. It is not my intention to discuss much about how to get those things setup in this "series" of pages.

    • Just to be clear, I do not consider myself an expert in email on Linux (or really, much of anything else either). I managed to get this email server configuration working with a lot of help from others (finding resources via Google, asking questions on mail lists, etc.) and now am more certain about some things I was less certain about earlier. Where I am fairly certain of something, I am going back to correct earlier pages that I wrote about email. Here are some things I'm not very comfortable about:

      • I don't really know under what circumstances you'd want to use the canonical map capability of postfix.

      • I have a "theory" about why/when/how you'd want to set up a virtual email address / domain, but, as I did not have to do it, this is just "speculation". Here is my understanding: If you have another valid email domain and / or address, that does not correspond to the domain that you are setting up your email server, you can set get that email server to handle mail for that address / domain by treating it as a virtual address / domain. In order to do so, you will have to configure postfix appropriately (by setting things in the virtual (?) tables (?)) and by arranging to have MX records in appropriate DNS servers (out on the Internet) pointing to your server as the server that handles mail for those addresses. (I may touch on this more later.)

  • You do not have to have a registered FQDN (Fully Qualified Domain Name) to use a local email server. There is probably more than one way to do that (TIPMTOWTDI??). The way I did it was to:

  • Re the above, I have a slight worry that the configuration I describe works now and will only work as long as my ISP allows open relays. I don't know this for sure, I don't even know that he allows open relays for sure. I think that, if I run into a problem along these lines, I will need to revise my postfix configuration so that my email "envelope address" is "rhkramer@fast.net". Hmm, actually, I can check some of this now and see what my envelope address is recognized as. (It's time to take a break from this page anyway. wink )

  • I'm back! Looking at one of my outgoing mails, I see (among other "received" headers) the following, which makes me believe I will be OK (because the envelope sender is my official Internet address. Not sure what I did to make this happen, but at some point I'll hopefully figure that out. (Is it just that I specified that address as the from in my email clients? Doesn't sound right, but maybe.)

Received: from unknown (HELO System8.Home) ([]) (envelope-sender <rhkramer@fast.net>)
          by newmx2.fast.net (qmail-ldap-1.03) with SMTP
          for <blt-newuser@basiclinux.net>; 2 Sep 2002 11:35:17 -0000

<end second alternate approach>

Ok, I finally got my email server working, and now need to document it and remove the "cruft" from WikiLearn.

I'll start by giving an overview of my setup and making a list of all the pages I've already written about email -- many of which require rework or deserve deletion.

See AboutThesePages.


Overview (Outline)

Aside: I'm trying to figure out what kind of pages I need to explain email. I think I should have a page which contains something like the information in this overview, with links in appropriate paragraphs to pages which can provide more information where appropriate. So, maybe I start by rewriting the following on a page to be called Email<something> (or maybe leave it on this page).

  • Linux (typically a server) vs. Windows (typically a client) (but changing now)

  • Here is what I wanted in an email server: If you want something close, you can get a lot of help from these pages. If you want something significantly different, I think WikiLearn can still help, but you will have to modify some things with little or no guidance from me.
    • An email server on my LAN, with email clients possibly on that machine and others, so that I could:
      • Share one email account among my entire family (i.e., several users, several clients)
      • Sort incoming mail or duplicate it, so that mail that was clearly intended for a specific member of the family went to that person's user account only, and mail that was of more general interest went to multiple accounts.
      • Collect outgoing mail from all clients in one central location, so that, if I sent mail from different machines, I had a copy of each outgoing mail in one central location.
      • Do all of the above:
        • over a dial up account (I can use any kind of TCP/IP compatible Internet connection)
        • using my existing ISP with his POP and SMTP servers (he does not support IMAP)
        • without registering a domain
        • using existing email clients for those that prefer them, allowing others to use any email client that suits them
      • Related to above: I didn't originally intend to use IMAP, but I eventually decided to do so because:
        • Using IMAP, I can store all my mail on (the local) email server and access it from any client on the LAN (or on the Internet if I want to open up my network to that possibility -- I do not do that and do not immediately plan to do so so you won't find much guidance on that. You need to carefully consider the security issues.
        • Using IMAP does not preclude using POP3 on the same LAN. Many IMAP servers include POP3 (including the one I'm using -- is it Courier?). My wife's email client gets her mail via POP3 (and does not leave it stored on the email server) -- my email clients use IMAP and do leave the email stored on the email server. (Using an IMAP client vs. a POP3 client (as well as the change to having my mail presorted into folders by category) has necessitated some changes in my email habits.) BTW: I haven't found a good way to indicate the arrival of incoming mail -- I apparently don't know how to set up the kde application (kbiff??) to do this, and haven't tried any others so far.
    • Another aside: My email server gets the mail every 10 minutes from my ISP (as long as my gateway machine is running, which is basically during my waking hours). At some point my ISP may object to this and I may have to adjust that script. Currently it pings my ISP which confirms the connection is up or causes the autodialer to dial out. When the ping is successful, it runs fetchmail to get the mail, and then runs commands to check the postfix outgoing mail (defer?) queue, kick it, and recheck it. It records the results in a log and sends them in an email to me.

  • Should I mention my belief, that you should not have to RTFM to do this -- you should have to read as little as possible -- hopefully WikiLearn will be enough, or will point out the other things you do need to read.

  • An email server consists of several pieces of software -- in my case fetchmail, postfix, procmail and some ancillary stuff like xinetd (and a working TCP/IP network). The sketches (EmailOverviewSketch, EmailServerSketches) provide some (IMHO) helpful insite into how the pieces fit together (there are some errors or omissions).

  • Start by installing a "preconfigured" email server (by installing a Linux distribution that can install a working email server during installation of the distribution). It might do everything you need, or at least everything you need to start. (In my case it didn't, but it came close, closer than I realized). For your first email server, start this way and then tweak it if necessary to make it work. Later, if there is a good reason to do so, consider installing the software in a more "manual" method (possibly even compiling from source). In my case I installed the Mandrake 7.2 "MandrakeFreq" update on a P133 machine with 128 MB RAM, a 3.1 GB hard drive, and an ethernet card (System8 -- double check the specs). It is on my (manual) KVM switch so that I can connect a keyboard, mouse, and monitor to it but I'm certain that you could arrange things so such is not required after the initial installation and setup.

  • Consider installing things like servers and similar "infrastructure" on a slow, cheap machine with the intent that you'll put your workstation on your fast (possibly expensive) machine (with lots of memory) -- the advantage -- you won't have to reinstall the infrastructure if you want to upgrade your workstation to the next version of software -- leave your infrastructure running on the old machine -- only upgrade it at your convenience or to improve security or functionality (or when you get so good at it you can do it in your sleep).

  • Fetchmail required creating a .fetchmailrc file in the home directory of the user I'm running fetchmail on/as. ("keep" to preserve messages while troubleshooting)

  • IIRC (I will check), the only thing I had to do to make postfix work was set up the relay parameter. (And, for my special purposes, add the always_bcc parameter.)

  • Procmail is a longer story -- <later>. Procmail is a jack of many trades, and can be used in several ways in an email server setup. I use it two ways: It is my local MDA -- postfix sends local mail to it to be sorted into the proper user's local mailbox. And, I use it to sort mail from my local mailbox into category based folders.

  • I didn't need DNS! (Expound on what I did need in /etc/hosts or whatever (not much, IIRC).) I didn't need DNS because (1) my email clients address the email server by its TCP/IP address (192.168.x.x) and (2) my email server looks like another email client to my ISP rather than a full blown email server. If my email server was intended to serve as a full blown email server, I would need a registered domain name and MX records would have to exist in DNS servers (like at my ISP) to indicate that my domain address (rather than my ISP's domain address) is the address that will accept email for me. There are very few disadvantages to this situation (I can't arbitrarily create new email accounts), some advantages (no additional cost of registering a domain name or having it "parked" somewhere (if that's the right phrase, no need to change anything with my ISP.) If I did have my own domain name, I would not have to worry about changing email addresses if I change ISP's. But, I'd like to have my own domain name for a my websites hosted out on the Internet, and, AFAIK that would require two registered domain names as I don't know how (I don't think there is a way) to use one domain name for both a web site hosted out on the Internet and for email delivered to me. Or wait, I guess if whoever hosted my website allowed me to have email addresses using that domain name I could then treat that website as my ISP for email purposes (and maintaining a local ISP to provide my local connection to the Internet) -- I'll have to think about that some more.

See AboutThesePages.

<Currently, no significant content below this line.>




See ResourceRecommendations. Feel free to add additional resources to these lists, but please follow the guidelines on ResourceRecommendations including ResourceRecommendations#Guidelines_for_Rating_Resources.


  • (rhk) [[][]] --

Recommended for Specific Needs

  • (rhk) [[][]] --

Recommended by Others

  • (rhk) [[][]] --

No Recommendation

  • (rhk) [[][]] --

Not Recommended

  • (rhk) [[][]] --


  • () RandyKramer - 31 Aug 2002
  • <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>

[[Main.RandyKramer#31 Aug 2002][]]

Rants (Ignore)

See MyRantings.

Page Ratings

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2002-09-03 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look