Recall that mail to your machine will be delivered to the hub, because of the MX record that you just created. Unless you change the configuration of the hub, that mail will bounce, because the hub doesn't yet know that it should accept it.
Again, you may lack permission to make the required changes. But for the sake of illustration we'll assume that you can.
You need to modify the hub's configuration file so that the hub thinks mail to your local machine is instead mail to itself. The first step is to edit the hub's configuration file and search for the rule that allows it to recognize itself. Because every machine needs to recognize itself under the name
localhost
, you should search for that string first. Such a search will reveal something like this:
# We always want localhost to be considered local. Cwlocalhost
This example shows part of a typical configuration file that declares
localhost
as equivalent to the hub's hostname.
Recall that class
w
is special because it is initialized internally by
sendmail
to contain all the possible names of a machine - all, that is, except
localhost
, which always needs to be added to class
w
in the configuration file.
We searched for
localhost
instead of
Cw
because some configuration files use a letter other than
w
to list alternative names. The following illustrates one of those other letters:
# Other name for our machine CO localhost printserver faxhost
If your hub's configuration file is like this, use the letter
O
(or whatever letter appeared) in place of the more standard letter
w
in the following examples.
Now that you have the name (letter) of the class of other names, you need to add the local workstation's name to that list. This can be done in either of two ways. If the local machine is the only one that will be using the client.cf file, you can add its name to the existing class definition:
# Other name for our machine CO localhost printserver faxhosthere
add the local machine's name here
On the other hand, if yours is just the first of many machines that will be using the client.cf file, you should create an external file now, so that the hub's configuration file only needs to be edited once:
# Other name for our machine CO localhost printserver faxhost# Clients for which we receive mail
newFO/etc/mail/clientlist
new
If you use the external file approach, make certain to create that file and add the local machine's name to it before continuing.
After modifying the hub's sendmail.cf file, you should test it. Run sendmail in rule-testing mode and give it the local machine's name as part of each address:
%/usr/lib/sendmail -bt
ADDRESS TEST MODE Enter <ruleset> <address> >
This example shows that the hub is running an old version of sendmail , [4] one that always calls rule set 3 first. Bear that in mind as you feed it addresses.
[4] By old, we mean a non-IDA version, prior to V8.
To test whether or not the hub's
sendmail
recognizes the local machine as local to the hub, you need to see whether rule set 0 selects the
local
delivery agent. Since rule set 3 is automatically called first (for this old version of
sendmail
), don't specify it. In its absence, the rules called for this old version of
sendmail
will be 3, then 0:
>0 user@here
rewrite: ruleset 3 input: "user" "@" "here" rewrite: ruleset 6 input: "user" "<" "@" "here" ">" rewrite: ruleset 6 returns: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 3 returns: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 0 input: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 30 input: "user" rewrite: ruleset 3 input: "user" rewrite: ruleset 3 returns: "user" rewrite: ruleset 0 input: "user" rewrite: ruleset 9 input: "user" rewrite: ruleset 9 returns: "user" rewrite: ruleset 0 returns: $# "local" $: "user" rewrite: ruleset 30 returns: $# "local" $: "user" rewrite: ruleset 0 returns: $# "local" $: "user" >
Success! The output that is produced will vary depending on your hub's configuration file and version of
sendmail
, but the result you are seeking will be the same. The last line of output (what rule set 0 returns) should show that the
local
delivery agent was selected (the
$#
operator).
Now perform the same test, but this time include your domain as part of the hostname:
>0 [email protected]
rewrite: ruleset 3 input: "user" "@" "here" "." "us" "." "edu" rewrite: ruleset 6 input: "user" "<" "@" "here" "." "us" "." "edu" ">" rewrite: ruleset 6 returns: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 3 returns: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 0 input: "user" "<" "@" "LOCAL" ">" rewrite: ruleset 30 input: "user" rewrite: ruleset 3 input: "user" rewrite: ruleset 3 returns: "user" rewrite: ruleset 0 input: "user" rewrite: ruleset 9 input: "user" rewrite: ruleset 9 returns: "user" rewrite: ruleset 0 returns: $# "local" $: "user" rewrite: ruleset 30 returns: $# "local" $: "user" rewrite: ruleset 0 returns: $# "local" $: "user" >
If all tests well, you need to kill and restart the
sendmail
daemon on the hub. Review
Chapter 4,
How to Run sendmail
, if you've forgotten how to do this. Beware of any frozen configuration file that might exist if the hub is running a pre-V8 version of
sendmail
. If one exists, you will have to refreeze it. (See the discussion of the
-bz
switch in
Chapter 36,
The Command Line
.)