
Book IX
Chapter 7
Running Sendmail
747
Modifying sendmail.mc
Enabling masquerading
Masquerading allows all the mail being sent from your domain to appear as
if it came from the domain (for example, wally@cleaver.net) rather than
from the individual hosts (like wally@wally.cleaver.net). To enable
masquerading, add lines similar to these:
MASQUERADE_AS(`cleaver.net’)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(`cleaver.net’)dnl
Setting up aliases
An alias — also known as a virtual user — is an incoming e-mail address that
is automatically routed to local users. For example, you may want to create
a generic account such as sales@mydomain.com and have all mail sent to
that account delivered to a user named willie. To do that, you edit the file /
etc/mail/virtusers. This file starts out empty. To create a virtual user,
just list the incoming e-mail address followed by the actual recipient.
For example, here’s a virtusers file that defines several aliases:
sales@mydomain.com willie
bob@mydomain.com robert
marketing@mydomain.com robert
After you make your changes, you should restart the Sendmail service.
Don’t be an open relay!
An open relay is a mail server that’s configured
to allow anyone to use it as a relay for sending
mail. In short, an open relay sends mail when
neither the sender nor the recipient is a local
user. Spammers love open relays because they
can use them to obscure the true origin of their
junk e-mail. As a result, open relays are a major
contributor to the Internet spam problem.
Fortunately, the default configuration for the
current version of Sendmail (8.14) is to not
allow open relaying. As a result, you have to
go out of your way to become an open relay
with Sendmail. In fact, you’ll have to look up the
lines you’d need to add to sendmail.mc to
enable open relaying. I’m certainly not going to
list them here.
If you do need to allow relaying for specific
hosts, create a file named relay-domains
in /etc/mail. Then, add a line for each
domain you want to allow relaying for. This line
should contain nothing but the domain name.
Then restart Sendmail.
69_625873-bk09ch07.indd 74769_625873-bk09ch07.indd 747 9/21/10 10:47 PM9/21/10 10:47 PM