How does email work in the unix/linux world?
Under Linux and Unix, every user has a local mailbox: a simple file in /var/spool/mail/. Users of the same machine can exchange mail messages among themselves or with the outside world, as well as receive mail messages directly on the machine. The software tasked with the distribution, sending, and reception of mail under MandrivaLinux is Postfix.
I will only speak here of local e-mail exchange: that is, among accounts on the same machine.
How to configure local e-mail
Local e-mail is correctly configured by default (if postfix has been installed) with one exception: emails for root. In fact, root is not permitted to receive e-mail: its mails must be redirected to the mailbox of the real administrator of the machine. That's because the mails it receives are generally important and sometimes urgent. Many applications expect that mails to root will be read regularly.
Configuring the root mail box
Edit the file /etc/postfix/aliases. It contains this section :
# CHANGE THIS LINE to an account of a HUMAN root: postfix
# CHANGE THIS LINE to an account of a HUMAN root: administrator,yoho,tonton
Specifying the host name
Postfix is quite stubborn and absolutely wants to know to what domain you belong in order to send and receive e-mail. It won't work without this information. A domain serves to identify you out on the Internet, but you don't need to use it for local mail. Therefore, we'll give postfix a false domain name, which will be just fine for it: "localdomain".
If you haven't already given your machine a hostname (in drakconf's "alter miscellaneous Internet settings"), then you have the default name which is "localhost". Otherwise, you've given a name of your choosing. Let's call this hostname "toto".
Edit the file /etc/postfix/main.cf so that it contains these three lines (leave all the other lines in place):
myhostname = toto.localdomain mynetworks_style = host inet_interface = localhost
- The first line tells postfix your machine's "fully qualified domain name" (FQDN), which is the concatenation of your machine name, a period, and your (false) domain.
- The second line tells postfix that it is only managing mail for this host and it does not provide for sending mail elsewhere.
- The third line restrains postfix to the "localhost" network interface: it won't be able to send or receive mail on the Internet (this provides an additional protection for your PC).
Apply the changes in postfix
Open two terminals as root:
In the first, type:
tail -f /var/log/syslog | grep postfix
In the second, type:
service postfix restart mail root
Some information will display on the other terminal: check that everything looks correct when you restart postfix. Also check that the mail has been correctly redirected (the address of the end user should appear).
Configuring KMail to read local mail
(Need to insert an image here: )
Under KMail, just create a new account of type "local". You can choose "FCNTL" or "None" as the locking mode (if you expect to receive local mails only occasionally, "None" will not pose a problem). You can also use a lock-file (the first option) but you will need to use msec to change the access rights on /var/spool/mail so that the world can write into it (and this is a bit risky to your security level...).
You can also create a destination file different from the mailbox, for example, "Local Mail" and specify in the account configuration that your local mails will arrive in this file.
Verify that you have correctly received the "test" mail produced above.
Configuring Thunderbird to read local mail
Under Thunderbird, the account type is called "Movemail". (addition of screen captures in progress...)
Verify that you have correctly received the "test" mail produced above.
Version 1.10 last modified by Arkub on 11/10/2007 at 12:46
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!