Mail for the Home Network LG #45

Mail for the Home Network

Mail for the home network sounds like a fairly simple project, but it is quite ambitious: say good-bye to the wife and kids for the better part of a week if this is new ground for you. Rest assured, the end results are worth it.

Disclaimer: This article provides information we have gleamed from reading the books, the HOWTOs, man pages, usenet news groups, and countless hours banging on the keyboard. It is not meant to be an all inclusive exhaustive study on the topic, but rather, a stepping stone from the novice to the intermediate user.  All the examples are taken directly from our home networks so we know they work.

How to use this guide:

  • Words encapsulated by square brackets like [Enter] indicate the depression of a key on the keyboard or a mouse button [Mouse1]
  • Words encapsulated by squiggly brackets like {your name here} indicate data that will/should be substituted with « real » data
  • Text depicted in italics are commands you, the user, should type at a prompt

Prerequisites: This guide assumes that you have the following things installed:

    1. You must have a legal domain name
    2. You must be using IP Masquerade to « hide » your machine from the internet
    3. And that you can consistently connect to the internet
  • SendMail
  • FetchMail
  • IMAP (pop3d)
  • ProcMail

What should home mail do? Before we go sprinting off into the guts of this project, lets consider what we want this mail system to do:

  • It should get our mail from the internet and serve it locally.
  • It should send our mail to the internet.
  • It should be a mail server for local mail (mail sent within our network). In a trivial example, Mom should be able to email Dad and the mail never leaves our home. More importantly, servers send messages to root, and we want these messages collected up and sent to only one person. Example: I have two servers and my own computer, I do not want to have to check 3 email accounts to see all the messages.
READ  3.2.2 Logging in

Home mail sounds like a simple concept, especially as many user email programs, like netscape, seem to handle all the necessary functions all by themselves. Unfortunately, there is a big difference between a user’s mail « system » and a network mail system. Your mail system will need at least five programs to function properly:

  • The program you use, as a user, to read and write your mail – xfmail, netscape, outlook, etc. We will not be covering these programs in this article – but they are the programs you know so well. When we are done, you will point these programs to the mail server on your network, instead of your ISP, to send and receive your mail.
  • The program that gets our mail from our ISP, and we want it to get the mail for all the family accounts. In this article we will be using fetchmail.
  • The program that transports the mail message from one computer to another. This program takes the mail from your mail reader, e.g. netscape, and either sends it to the internet or keeps it on our mail server. In this article we will be using the program sendmail. This will become our SMTP connection.
  • Sendmail and fetchmail do not store the mail on the hard drive, rather, they hand it off to another program that puts each user’s mail where it is suppose to go. In this article we will be using procmail.
  • The program that servers our mail when we connect to it with our user email program. In this article we will be using ipop3d. This will become our pop3 server.
READ  Linux Gazette MailBag LG #60

Install the programs. Before we get started, check to see that you have all the necessary programs installed.  Easiest way to check is to issue the whereis command:

whereis sendmail [Enter]

For those of you using RedHat, you can type:

rpm -qa|grep sendmail [Enter]

to see if any sendmail package is installed. Other distributions have a similar way of checking if a package is installed. Make sure you installed the sendmail-cf package as well.

procmail: Whatever version came with your distribution is fine.
ipop3d: Whatever version came with your distribution is fine. Note: most distributions put ipop3d in the imap package.
fetchmail: Fetchmail is a moving target and new versions come out frequently. We would suggest using version 5.0 or higher, though whatever came with your distribution is probably fine.
sendmail: Most distributions come with three sendmail packages: sendmail, sendmail-cf, and sendmail-doc. Install all three. We will be using sendmail version 8.9.3 in this article. If you are running anything less than version 8.9.2 we very strongly recommend you upgrade, both because of security reasons, and because most of the information presented here will not be useable with older versions.
m4: Whatever version came with your distribution should be fine.

Let’s get started! Do 10 sets of finger exercises, replace Zeppelin with a Mozart CD, and click on the links below. Note: follow them IN ORDER, as some programs rely on others!

Setting up dns for mail
Setting up procmail
Setting up sendmail
Setting up pop3
Setting up fetchmail
Some Final Thoughs

indexnew-4783993 homenew-6153080 back2-8462520 fwd-3762226