The Exim FAQ Section 15

# The Exim FAQ

Contents Previous Next

## 15. UUCP

Q1501: The MX records for some UUCP domains point to my local host. How do I get it to pass the messages on to UUCP?

A1501: The simplest way is to create a file containing a list of domains, and the hosts to which their messages should be sent, like this:

       uucp1.domain.example:   uucp1.host.example
       uucp2.domain.example:   uucp2.host.example
       ....

Then you can use a router like this:

       uucp_router:
         driver = accept
         domains = lsearch;/etc/uucp/domains
         transport = uucp_transport

and a transport like this:

       uucp_transport:
         driver = pipe
         user = nobody
         command = /usr/local/bin/uux - -r $domain_data!rmail $local_part
         return_fail_output

The $domain_data variable retains the value that is looked up when the `domains` option in the router is matched.

Q1502: How can I get Exim to handle “bang path” addresses?

A1502: In general, you can't (Exim is an Internet mailer and recognizes only RFC 2822 domain-style addresses) but some restricted kinds of bang path can be dealt with by appropriate rewriting - but please note the warning below.

Exim treats a bang path address as an unqualified local part, and so will qualify it with your domain. A rule such as

       \N^([^!]+)!(.+)@your\.domain$\N   $2@$1

turns a!b@your.domain into b@a. You can also use a repeating rule to turn multi-component paths into the “percent hack” notation with a rule such as

       \N^([^!]+)!([^@%]+)(.+)$\N   $2%$1$3   R

which turns a!b@c into b%a@c and a!b!c@d first into b!c%a@d and then, because of the R flag, into c%b%a@d. The R flag causes repetition up to 10 times.

Warning: If you install a general rewriting rule like the above, you are opening yourself up to the possibility of unwanted relaying. A host that is not permitted to relay through your system could send a message with an SMTP command line such as

       RCPT TO:<victim-host!victim-user@your.domain>

and this would be accepted because it is addressed to your domain. However, the rewriting then converts the address, and the message does in fact get relayed. One way round this, if all your bang path messages are passed to Exim via SMTP, is to use the `S` rewriting flag. This applies a rewriting rule to incoming SMTP addresses as soon as they are received, before checking for qualification, relaying, etc. So a rule such as

       \N^([^!]+)!(.+)$\N  $2@$1  S

rewrites simple two-component bang paths before the result is checked for relaying. However, this does not rewrite addresses in the headers of the message.

Q1503: We see something strange on our system in regards to mail coming in via rmail from a UUCP link. The sender is being set to mailmaster instead of the real sender, and a Sender: header is being added to the message.

A1503: If mailmaster is the user that is running rmail, you need to include that user in the `trusted_users` configuration option. Only trusted users are permitted to specify senders when mail is passed to Exim via the command line.

Contents Previous Next