1. Home
  2. Computing & Technology
  3. Linux

Linux Network Administrators Guide

From

18.8.5.1. Accepting mail for other domains

When sendmail receives an email message, it compares the destination host in the message headers to the local host name. If they match, sendmail accepts the message for local delivery; if they differ, sendmail may decide to accept the message and attempt to forward it on to the final destination (See Section 18.8.4.2 " earlier in this chapter for details on how to configure sendmail to accept mail for forwarding ).

If we wish to configure virtual email hosting, the first thing we need to do is to convince sendmail that it should also accept mail for the domains that we are hosting. Fortunately, this is a very simple thing to do.

The sendmail use_cw_file feature allows us to specify the name of a file where we store domain names for which sendmail accepts mail. To configure the feature, add the feature declaration to your sendmail.mc file:


   

FEATURE(use_cw_file)

The default name of the file will be /etc/mail/local-host-names for distributions using the /etc/mail/ configuration directory or /etc/sendmail.cw for those that don't. Alternatively, you can specify the name and location of the file by overriding the confCW_FILE macro using a variation on:


   

define('confCW_FILE','/etc/virtualnames')

To stick with the default filename, if we wished to offer virtual hosting to the bovine.net , dairy.org , and artist.org domains, we would create a /etc/mail/local-host-names that looks like:


   

bovine.net
dairy.org
artist.org

When this is done, and assuming appropriate DNS records exist that point those domain names to our host, sendmail will accept mail messages for those domains as though they were destined for our real domain name.

* License

* Linux Network Administrators Guide Guide Index

Explore Linux
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux Documentation
  5. Linux Network Admin Guide
  6. Linux Network Administrators Guide - 18.8.5. Configuring Virtual Email Hosting

©2009 About.com, a part of The New York Times Company.

All rights reserved.