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.
DRsystemMake sure that the CU entry looks like the following:
CUsystemThe 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@$2The 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 zeroComment 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 -btYou 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 $: userAlso 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 $: userThen, 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 $: userThe 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),