uucpssh.org: UUCP e-mail for Linux fans

ArticleCategory: Hardware

AuthorImage:[Here we need a little image from you]

AboutTheAuthor:[A small biography about the author]

Guido really likes UUCP e-mail because it is a solution
that integrates perfectly with a Linux computer.

Abstract:

In the windows world incomming mails are received via POP3 or IMAP
and outgoing mails are sent directly via SMTP. This split setup
can cause all kind of headaches especially if you are using
different ISPs all the time.

UUCP is an old protocol but it is really a clever solution to send
and receive e-mail. On top of that uucpssh.org offers some really
flexible forwarding features.

ArticleIllustration:

ArticleBody:

Introduction

uucpssh.org offers a really good e-mail solution for Linux
users. It combines UUCP e-mail transport with the security of
SSH and offers on top of that some flexible forwarding options.

UUCP is very old protocol and was originally used to copy any type of files between Unix systems. Thus the name: "Unix to Unix Copy". These early computer systems were not permanently connected via a network. Instead dialup modem connections where used to exchange data in regular time intervals. UUCP is ideal
to transport things that have a "batch job" characteristic such as e-mail or news.

Today UUCP is no longer used for general file tranport. It is however still
very good for e-mail, especially if you are frequently on the move.
When you are connected to a wireless Lan at the air port you can
send and receive mails in exactly the same way as from your network
at home. You don't have to change a single configuration parameter.

The technical part

Now lets see how you configure e-mail over uucp trough an SSH tunnel.

For those who are now wondering how to configure this under XP or 98 or ...
You need Linux. It is a solution specifically for Linux or
Unix systems in general.

An e-mail system in general consists of MUAs (mail user agents), the
program where you type in the mail and read it, and MTAs (mail transport
agents) also known as mail-servers. Examples of MUAs are mutt, Kmail,
Thunderbird, etc... MTAs transport the mail from one computer to the
other. Since UUCP/SSH are a transport protocols it is clear that we
use UUCP/SSH in this solution to interconnect the MTAs.

In other words we will configure a local mail server on our Linux
computer to use UUCP instead of SMTP for both incomming and outgoing
e-mail.

UUCP is the transport and hides the fact from the MTA that we are
not always connected to the internet. It takes care of the transporting
of mails as a batch.

Finally SSH is the protocol we use to encapsulate UUCP and connect to uucpssh.org.

To use uucpssh.org UUCP e-mail you need to own a complete domain because
the routing is done on a per domain name basis. The local MTA on your Linux
machine will then sort the mail for the different users.

Since uucpssh.org sorts the mails only on a per domain basis
you have full flexibility when it comes to the user part (the stuff before the "@" sign).
You can create as many aliases and users as you like.

What's a MX domain?

A domain name is something like linuxfocus.org, that's probably clear to most
people. To have a domain you need a DNS server. The internet works at the protocol
level not with names but with numbers, IP addresses. A DNS server translates a name
into an IP address and then this number is used to establish the connection between
to hosts (e.g web servers or mail servers).

If you want to have to physically differnt hosts for web pages and ftp then you have
to give them different names. E.g linuxfocus.org and ftp.linuxfocus.org.
This is however not the case e-mail because there is a special DNS entry for mail called
MX (Mail Exchanger). You can have your webpages at one host (linuxfocus.org)
and you can have you e-mail at uucpssh.org and reach it also via linuxfocus.org (or something@linuxfocus.org).

In other words when you move to uucpssh.org then you move only the MX domain.

Setting it up, MTA part

We will start with the configuration of the MTA.
In this article we discuss exim, postfix and sendmail. Any of them is
good for UUCP.

Test the configuration with the command exim -bV and then
restart exim. (/etc/init.d/exim restart)

Sendmail

Sendmail uses a m4 pre-processor based configuration system.
The m4 configuration system might not be included in the same
package as sendmail it self. Check the CDs of your distribution
your might need to install a package called something like
"sendmail-cf".

Create a new sendmail-uucp.mc file in the cf directory for
sendmail (probably /usr/lib/sendmail-cf/cf):

Setting it up, UUCP part

The uucp software is available from http://www.airs.com/ian/uucp.html however check the CDs of your linux distribution first. All major distributions
have packages for it. If you stil want to install from the source then watch out. UUCP
(at least until version 1.07) uses some rather strange path naming conventions. It installs
e.g executables to /usr/lib/uucp. All packages from the distributions have fixed those problems.
Having said that: gentoo linux installs in version 1.06 the files to the right directories (/usr/bin, /usr/sbin, /etc/uucp) but the compiled in path is still wrong in a few cases.

I will further down describe a few tips how to debug problems with the uucp installation.

For the configuration of uucp you should have in the directory /etc/uucp/ at least the
following files:

config -- general configuration file (if all path are correctly comiled
into uucp then this file can be empty)

call -- "a password file" for uucp login to uucpssh.org

port -- config file for the type of connection to
use

sys -- defines all uucp systems that your system knows
of

In the uucp world every installation of uucp should have a name. This name is checked
when two uucp systems handshake at the beginning of their communication.
uucpssh.org is called uucpssh (all lower case) and your system name is what you define
when you create an account at uucpssh.org. In the example below it will be mailtux.

Now check your configuration by running the command "uuchk". Correct any syntax errors if
needed.

To forward mails to uucpssh.org we will use ssh as user uucp. Make sure there is a user
defined in /etc/passwd with the name uucp and that it has a valid home directory.
Check also that uucico has the s-bit set and belongs to the user uucp. The program, when
executed by any user must always run as if it was executed by the user uucp. The same
is valid for uux:

Testing

Send a mail to somebody outside of your host and check that it
is queued via uucp with the command

uustat -a

The mail should have ended up in the /var/spool/uucp/uucpssh/C./ and /var/spool/uucp/uucpssh/D./
directories.
Run

uulog -40

to see what happened. Check the log files in /var/log for your
mailer and /var/log/uucp for uucp. Those files can give you some clues if
things don't work. If the above did not work then the fault is somewhere
in the configuration of your MTA (mail server).

If above test was OK then test the SSH connection. Login as user uucp (su - uucp as root) and
run.

ssh uucp@main.uucpssh.org -v

Accept the server's RSA key and you should see a uucp prompt (something like "Shere...").

Finally we test the sending out of our queued uucp mail with the command:

/usr/sbin/uucico -x 11 -S uucpssh

The -x11 adds the maximum amount of debug information. If anything goes wrong
then you should find clues in /var/log/uucp/Debug.

To test incomming mails send a mail from outside to yourUserId@your.own.mail.domain
and then fetch the mails from uucpssh.org with the command:

/usr/sbin/uucico -x 11 -S uucpssh

Again check /var/log/uucp/Debug for problems. Incomming mails are first queued in
/var/spool/uucp/uucpssh/X./ and then automatically send to your MTA via the command
/usr/sbin/uuxqt and /usr/bin/rmail. gentoo linux had here a bug: It was looking for uuxqt
under /usr/lib/uucp/ and was expecting the configuration files in /usr/conf/uucp. I fixed
those gentoo specific faults by creating some softlinks.
Check the log of your MTA and you should see that the mail was received and delivered to you.

Daily use

Once installed correctly there is not much to do. You just run

/usr/sbin/uucico -S uucpssh
uulog -5

to exchange mail with the Internet. I prefer to have total
control over that and I run it manually via a script but you
can also add

/usr/sbin/uucico -S uucpssh

to /etc/ppp/ip-up and it will be executed every time you connect
to the Internet.