Technical article 107616

How do I configure sendmail to send mail over UUCP and not SMTP?

OpenServer 5.0.0OpenServer 5.0.2

Written · Last revised

Problem

I need to configure sendmail to send mail over UUCP instead of over SMTP (RFC821).

Cause

Sendmail comes preconfigured to send mail using SMTP (Simple Mail Transfer Protocol) rather than through UUCP (Unix to Unix Copy Protocol).

Solution

The sendmail.cf file needs to be modified to send mail through UUCP and local mail, instead of through SMTP.

The first step is to copy the sendmail.cf file, by issuing the command:

#cp /usr/lib/sendmail.cf /usr/lib/sendmail.cf-
Change directories to /usr/lib and edit the file sendmail.cf
using your favorite text editor.  Make the following changes:

Create a new macro called "R" in the area above "Special macros", where the system is the name of the host you're connecting to in /usr/lib/uucp/Systems.

DRsystem

Make sure that the CU entry looks like the following:

CUsystem

The final result should look similar to:

CUsystem
DRsystem
##########################
###   Special macros     ###
##########################
Next, add the following at the end of Ruleset 0.  You can get
to Ruleset 0 by searching for S0, and from there scroll down until
you find:
##################################################################
###   End of ruleset zero                                      ###
##################################################################

Add the following lines to the area before the "End of ruleset zero".

R$*<@domain.com>        $#local$:$1               everything else
R$*<@[$+]>$*            $#uucp$@$R$:$1@$2$3
R$*<@$+>                $#uucp$@$R$:$1@$2

The end result should look similar to this (where domain.com is your local domain):

R$*<@domain.com>        $#local$:$1          everything else
R$*<@[$+]>$*            $#uucp$@$R$:$1@$2$3
R$*<@$+>                $#uucp$@$R$:$1@$2
R@                      $n                   fix magic token
R$+                     $#local$:$1          everything else
###################################################################
###   End of ruleset zero
Comment out any entries that have the letters "tcp" or "local"
anywhere in the rule for Ruleset 0 (except for the entry we've
entered manually above).  The "#" sign is used for comments in
the sendmail.cf file.
Save and exit sendmail.cf.
To test entries, change directories to /usr/lib.  Enter the command:
#./sendmail -bt
You will see the following:

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > Enter 0 user@system at the ">" sign. Once again, the system is the name of the host you're connecting to in /usr/lib/uucp/Systems. Your output should look similar to the following:

> 0 user@system
rewrite: ruleset  0   input: user @ system
rewrite: ruleset  3   input: user @ system
rewrite: ruleset  9   input: user @ system
rewrite: ruleset  9 returns: system ! user
rewrite: ruleset  9   input: system ! user
rewrite: ruleset  6   input: system ! user
rewrite: ruleset  6 returns: system ! user
rewrite: ruleset  9 returns: system ! user
rewrite: ruleset  3 returns: system ! user
rewrite: ruleset 11   input: system ! user
rewrite: ruleset 11 returns: system ! user
rewrite: ruleset  0 returns: $# uucp $@ system $: user

Also try (where domain.com is your local domain):

> 0 user@domain.com
rewrite: ruleset  0   input: user @ domain . com
rewrite: ruleset  3   input: user @ domain . com
rewrite: ruleset  9   input: user @ domain . com
rewrite: ruleset  9 returns: user @ domain . com
rewrite: ruleset  6   input: user < @ domain . com >
rewrite: ruleset  6 returns: user < @ domain . com >
rewrite: ruleset  6   input: user < @ domain . com >
rewrite: ruleset  6 returns: user < @ domain . com >
rewrite: ruleset  3 returns: user < @ domain . com >
rewrite: ruleset  0 returns: $# local $: user

Then, as a final test, try (leaving xxx.com as it is):

> 0 user@xxx.com
rewrite: ruleset  0   input: user @ xxx . com
rewrite: ruleset  3   input: user @ xxx . com
rewrite: ruleset  9   input: user @ xxx . com
rewrite: ruleset  9 returns: user @ xxx . com
rewrite: ruleset  6   input: user < @ xxx . com >
rewrite: ruleset  6 returns: user < @ xxx . com >
rewrite: ruleset  3 returns: user < @ xxx . com >
rewrite: ruleset  0 returns: $# uucp $@ system $: user @ xxx . com
rewrite: ruleset  3 returns: user < @ domain . com >
rewrite: ruleset  0 returns: $# local $: user

The result of the last entry will cause all mail, to any domain other than our own, to be delivered to the remote UUCP host. Restart the sendmail daemon and test your mail.

If you run "mkdev cf", you will lose the changes that you have
made to the sendmail.cf.  It is recommended that you keep a copy
of the modified file in a safe place.

See also

uucp(C), sendmail(ADMN),

From the Xinuos technical article database, record 107616. Reproduced with permission. The original is at www.sco.com/ta/107616, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.