fetchmail Il: Mail for your LAN
Now we go a step further and supply a whole network with mail.
We Create Our Own POP3 Server
We supplied all users on a local PC with mail in the last issue. Now we want to build up a mail server (protocol POP3) for a heterogeneous network. The way shown in the following picture is very useful for a small network which is not connected to the Internet all the time.
The network may
look like the following description:
At least one Linux computer
that is responsible for a periodic Internet connection and other
computers which are connected to this (WINDOWS, Macintosh, OS/2
and Linux).
Sign up your PC
Those users who
are also working at the central Linux PC that makes the Internet
connections (in the case that this PC is not only used as a
server but also as a client) write a configuration similar to the
first issue. You create .fetchmail;
add fetchmail -d 150 into /etc/ppp/ip-up and you are ready.
But now this computer must
also to be used for other users inside the network who are still
unknown (that means they have not been able to login until now).
Now we have to announce these users and the easiest way is using
yast. At Administration of the System
- Administration of the System
- Groupadministration
you have the
opportunity to create a new group. It makes sense to put all
users who just need a POP3 account into one group. We would
create a group called mailer if it does not already existed.
And now we announce the users. This also happens with yast at
- Administration of the System
- Useradministration
There you add a
new user.This happens in the same way as if you create users for
your local PC. The group they own is the group "mailer",
their home directory can be /tmp or /dev/null because they are
not allowed to put files on the server. The used login shell
should be /bin/passwd. This way the users do not have a direct
access to the system, just the ability to change the password if
they log in.
Now the users are
well known on the POP3-server and we are able to enter them into
the /root/.fetchmailrc
If you changed everything successfully we may start to edit the .fetchmailrc
file.
The /root/.fetchmailrc
| File /root/.fetchmailrc |
poll mail.server.de protocol pop3 user MrSmith to smith password cowboy poll mail.server2.de protocol pop3 user C3PO to starwars password lightsaber |
In this file you
entered all local users and now you add all other users who are
using the Linux computer as a POP3 server.
This way the mail will be downloaded with every Internet
connection for all users in the LAN and saved on the Linux
POP3-server until the user takes the mail away.
Client Configuration
Before the users get their mail, they have to configure Netscape, IE Outlook or whatever they use as a mail reader. The POP3-server is now the Linux -PC and they have to enter an IP number or the host name into the corresponding field. The password for your mail is now the password on the Linux POP3-server and also the user name. To get correct replies, you should enter your Internet e-mail-address in the "Reply-to address" field somewhere in your mail client (e.g. XXX@gmx.com).
This final configuration was the last step. Now you get your mail even if the Linux-PC is not connected to the Internet. You do not need to dial up a connection just because one single user wants to read his mail.
If the server pauses
In many private networks the server is switched off during night. Then you are no longer able to get your mail from another computer, especially not at a M$ PC. Linux offers a solution. You could avoid these kinds of problems if you install a POP3 server on your Linux client that looks for mail regularly at the central POP3 server and delivers it to the local users. The mail will be transported from server to server if a network connection exists. If the server is not active, the client will wait until the server will be available again and get the mail.
Therefore, you again need a .fetchmailrc that gets the mail from the central Linux POP3-server and delivers it to the local users. (Meanwhile, the con figuration of this file should be known). In addition, the fetchmail daemon has to be started during the boot process. This happens either with an entry in /sbin/ init.d/boot.local where you add the entry "fetchmail -d 150",or you write a init-script (this is the clearest way). In addition, you could use a cron-call to look for mail.
Now the mail will be exchanged between both Linux computers if both are on. The user can read his mail even it the Linux POP3-server is off.
Talkback Area
Enter Own Comment