3. eximand procmail

3.1. About exim - mail transport agent

eximis a mail transfer agent (MTA).

The Exim manual describes exim like this. exim “contains facilities for verifying incoming sender and recipient addresses, for refusing mail from specified hosts, networks, or senders, and for controlling mail relaying”. and the Debian Reference. It sounds complicated! This is where Debian comes to the rescue. You install exim from a Debian package (.deb file). exim is probably already configured and working.

The inetd.conf file starts exim running every time you boot your computer (see Exim's README.Debian file).

You may find the newbieDoc article “A simple configuration of Exim” useful.

3.2. About procmail - mail delivery agent

procmail is an enhanced MDA with many extra features. procmail can deliver mail from exim (the configuration is in /etc/exim/exim.conf).

Like exim, procmail is probably already configured and running on a standard Debian installation (see figure 4).

3.3. Local mail

The local mail system is available to all local users (all those who login to your computer). In a standard Debian installation there is always an account for the Root user. There should be at least on other account for a normal user - your account. (You should never use the Root account unless it is absolutely necessary.)

Time for a quick test! You will need a mail user agent (MUA) to send and receive messages. You could use mutt, but mail. To run mail from the command line.

Send yourself a message using mail. Enter a subject and a short message, but do not worry about sending a carbon copy (Cc:). Use the 'enter' key for each new line, and 'control' key + 'd' key to end each section.

$ mail local-user 
Subject: local message
hello
ctrl-D
Cc:
ctrl-D
$ 
   

Now check that the message has reached you local mailbox. Look inside the /var/mail/local-user file using the cat command.

$ cat /var/mail/local-user
From local-user@local-host Wed Feb 04 12:11:46 2004 
Return-path: <local-user@local-host> 
Envelope-to: local-user@local-host 
Received: from local-user by local-host with local (Exim 3.35 #1 (Debian))
     id 1AoLsg-0000in-00
     for <local-user@local-host>; Wed, 04 Feb 2004 12:11:46 +0000
To: <local-user@local-host> 
Subject: local message 
Message-Id: <E1AoLsg-0000in-00@local-host>
From: local-user <local-user@local-host>
Date: Wed, 04 Feb 2004 12:11:46 +0000
Status: O
hello
$  
   

Read the message using mail. Use the 'enter' key to open the message and enter 'q' to quit.

$ mail 
Mail version 8.1.2 01/15/2001.  Type ? for help. 
"/var/mail/local-user": 1 message 1 new 
>N  1 local-user@local-host      Wed Feb 04 12:11   14/394   local message 
hello
& q
Saved 1 message in /home/local-user/mbox
$
   

Mail stores messages in the /home/local-user/mbox file. You can check this too.

$ cat /home/local-user/mbox
   

3.4. .forward file

eximis probably already configured to run procmail automatically on your computer. If not, or if you just want to be sure, you can put a hidden file in the root of your home directory which invokes procmail. The file is called .forward. The initial dot means that the file is hidden.

The .forward file has only one line with a pipe character followed by the absolute path to the procmail binary file.

 |/usr/bin/procmail
   

Create the file in a text editor and save it as /home/local-user/.forward. The /home/local-user/.forward file invokes procmail automatically as soon as mail arrives.

The /home/local-user/.forward file must be world readable. To be sure, change the permissions to 0644.

$ chmod -v 0644 /home/local-user/.forward
mode of `/home/local-user/.forward' changed to 0644 (rw-r--r--)