How to put exim4 and uucp together
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

uucp is a traditional way to execute remote jobs (e.g. spool mails), and as
a lot of old things there are much more than one way to do it. However,
today, the ways to handle it have boiled down to more or less two different
ways.

Our recommendation is to use bsmtp/rsmtp wherever possible, because it
supports all kinds of mail addresses (also the empty ones in bounces), and
is also better from the security point of view.


A. On the sending side:

1. rmail with full addresses

rmail is the oldest way to transfer mail to a remote system. However, today
it is normally required to use addresses with full domains for that (well,
they look like any normal address for you, and we don't tell about the other
way to not confuse you ;). If you want this, you can use this transport:
rmail:
  debug_print = "T: rmail for $pipe_addresses"
  driver=pipe
  command = uux - -r -a$sender_address -gC $domain_data!rmail $pipe_addresses
  return_fail_output
  user=uucp
  batch_max = 20

However, all recipients are handled via the command line, so you're
discouraged to use it.


2. bsmtp/rsmtp

This is a more efficient way to transfer mails. It works like sending SMTP
via a pipe, but instead of waiting for an answer, the SMTP is just batched;
from this is also the name batched SMTP or short bsmtp.

Furthermore, this way won't fail on addresses like " "@do.main. If you want
this, please use this, if the remote site uses rsmtp (e.g. is exim4):
rsmtp:
  debug_print = "T: rsmtp for $pipe_addresses"
  driver=pipe
  command = /usr/bin/uux - -r -a$sender_address -gC $domain_data!rsmtp
  use_bsmtp
  return_fail_output
  user=uucp
  batch_max = 100

and this if it wants bsmtp as the command:
bsmtp:
  debug_print = "T: bsmtp for $pipe_addresses"
  driver=pipe
  command = /usr/bin/uux - -r -a$sender_address -gC $domain_data!bsmtp
  use_bsmtp
  return_fail_output
  user=uucp
  batch_max = 100

Of course, these examples can be extended for e.g. compression (but you can
also use ssh for compression, if you want).



3. The router

You need a router to tell exim4 which mails to forward to uucp.
You can use this one; please adopt the last line. Of course, it's
also possible to send mail via more than one way.

uucp_router:
  debug_print = "R: uucp_router for $local_part@$domain"
  driver=accept
  require_files = +/usr/bin/uux
  domains = wildlsearch;/etc/exim4/uucp
  transport = rsmtp

The file /etc/exim4/uucp looks like:
*.do.main        uucp.name.of.remote.side


4. speaking uucp with the smarthost

If you have a leaf system (i.e. all your mail not for your local system
goes to a single remote system), you can just forward all non-local mail
to the remote uucp system. In this case, you can replace "domains = ..."
with "domains = ! +local_domains", but then you need also to replace
$domain_data in the transport by the uucp-name of your smarthost. The file
/etc/exim4/uucp is not needed in this case.



B. On the receiving side

1. Allow uucp to use any envelope address

Depending how much you trust your local users, you might use trusted_users
and add uucp to it or use local_sender_retain=true and
local_from_check=false.

2. If you get batched smtp

Allow uucp to execute rsmtp via
commands        rmail rnews rsmtp
in your /etc/uucp/sys, and ask the sending site to use rsmtp (and not
bsmtp) as the batched command.



That's it for now. Have fun, and you a flexible, robust and good
transmission way for your mails.


Andreas Barth <aba@not.so.argh.org>, 2004-09-11
