Weldon Whipple <email@example.com>
Sendmail's class w ($=w) is the set of all hosts and IP addresses (etc.) for which sendmail will accept and (attempt to) deliver mail locally.
You can see the contents of your sendmail's class w by issuing this command on your server as root:# echo '$=w' | sendmail -bt
You will probably become aware of the need to remove an entry from class w if your MX server (for example) is mail.whipple.org, but you are logged onto whipple.org and want to send e-mail to firstname.lastname@example.org. Instead of going to mail.whipple.org, the local server will attempt to deliver it to fred's local mailbox (which may or not exist on whipple.org).
There are several ways that hosts/domains are added to class w. Here are some of the ways:
The local-host-names naming convention is used in recent versions of sendmail. (In earlier sendmail versions, the file was named sendmail.cw.) In the sendmail macro configuration (mc) file, the FEATURE(`use_cw_file') directive generates a line beginning "Fw" in the sendmail.cf file. The Fw line names the local-host-names file.
You can add domains/hosts to the cf file's Cw line by using LOCAL_DOMAIN directives in the mc file.
Try the following, if they apply:
If the host name you want to remove happens to be the hostname of your server, it is probably easiest to rename your server. (This will remove the name from class w, as well as add the server's new name to class w).
If I want to remove whipple.org from class w, I could rename the server to frodo.whipple.org, www.whipple.org, elvis.whipple.org, for example.
Use this as a last resort. (It actually involves modifying the sendmail.mc/cf file, but I didn't include it above because it is the least desirable solution! Also, unless you are very careful, you can break your sendmail configuration)
The example below illustrates a situation where the mail server for the whipple.org domain is named mail.whipple.org--the DNS MX record points to mail.whipple.org. This solution fixes the condition where other hosts on the Net send mail to mail.whipple.org correctly, but mail originating from the host named whipple.org, destined for email@example.com, is unable to leave the whipple.org server.
If your mc file doesn't already have a LOCAL_RULESETS section, add one. If it does, just add the LOCAL_RULE_0 line--and the line following it--to the existing LOCAL_RULESETS section:
LOCAL_RULESETS LOCAL_RULE_0 R$* < @whipple.org. > $* <tab>$#esmtp $@ mail.whipple.org $: $1<@whipple.org.>$2
The LOCAL_RULESETS section generally goes last in the sendmail mc file.
Be sure to replace <tab> with an actual tab character! (Press the tab key in your editor.)
After modifying the mc file, generate a new sendmail.cf file (making a backup of your original sendmail.cf in case your new one doesn't work). Then restart sendmail. Finally, send a few e-mails to make sure sendmail works as expected.
This document is a work in progress. Please send corrections, suggestions and additions to me.