WebDeveloper.com �: Where Web Developers and Designers Learn How to Build Web Sites, Program in Java and JavaScript, and More!   
Web Developer Resource Directory WebDev Jobs
Animated GIFs
CSS
CSS Properties
Database
Design
Flash
HTML
HTML 4.01 Tags
JavaScript
.NET
PHP
Reference
Security
Site Management
Video
XML/RSS
WD Forums
 Client-Side
  Development

    HTML
    XML
    CSS
    Graphics
    JavaScript
    ASP
    Multimedia
    Web Video
    Accessibility
    Dreamweaver
    General
    Accessibility
    Dreamweaver
    Expression Web

    General

 Server-Side
  Development

    PHP
    Perl
    .NET
    Forum, Blog, Wiki & CMS
    SQL
    Java
    Others

 Site Management
    Domain Names
    Search Engines
    Website Reviews

 Web Development
  Business Issues

    Business Matters

 Etc.
    The Coffee Lounge
    Computer Issues
    Feedback




Web Talk for Wireheads: Cookies
Part 3

by Glenn Fleishman

Sendmail 8.8.0 and Virtual Users

At long last, it's easy to make bill@y.com and bill@z.com go to different mailboxes with the same mailserver receiving mail for both domains. With releases before 8.8.0, sendmail required various hacks to the sendmail.cf file, including ruleset changes, to get this to work. Frankly, I never managed it between my legacy sendmail.cf (a converted SunOS file) and other dbm problems, now resolved.

Sendmail 8.8.0 adds this functionality directly as a supported feature. The documentation is okay (in the ./cf/cf/README file that comes with the distribution), but essentially you either set the FEATURE() correctly in your m4 file to generate the configuration file, or you uncomment about two dozen lines if you use the default m4 file and edit the cf.

Several items have to be coordinated for addressing like this to work. First, in your DNS files, the same mailserver should be specified in the MX records. Next, you add the domain to the list of hosts for which mail should be received by that server by either specifying them using the Cw config line (each domain separated by a space), or by using the Fw command to specify a file containing one host or domain per line. This latter method is suggested to make changes easier.

Then, you create the database source files in the /etc directory. The source should be tab-delimited text files; the default names are virtusertable and genericstable. In virtusertable, you put the incoming address on the left, a tab, and then the local mailbox or remote mail address for delivery on the right (see example below):

 info@fishnet.com fish-info info@stockings.com stockings@hossiery.stockings.com bill@abc.com bill-abc bill@xyz.com bill-xyz 

Similarly, in the genericstable, you put the local mailbox on the left, a tab, and the address should appear on the right:

 bill-abc bill@abc.com bill-xyz bill@xyz.com 

Finally, you have to use makemap (it comes with the sendmail distribution), to create the database files. The command is:

 makemap hash virtuserstable.db < vir- tuserstable 

This is repeated with genericstable (If you want to use btree instead of hash — recommended to me by a colleague — you need to change the two configuration lines in sendmail.cf for these tables (near the top)). The lookups occur on each transmission, so there's no necessity to restart or kill -HUP sendmail.

Thanks to Nik Mouat of Interconnected Associates in Seattle, and Stuart Williams, a UNIX consultant in Calgary, for making this all sensible.

Last Column

As you all know, I've been putting my money where my mouth is for the last two and a half years, running one of the first companies devoted to creating and hosting Web sites for businesses. To follow the same metaphor, I'm now sticking my entire checkbook past the epiglottis, and joining Amazon.com, a two-year-old "startup" Internet company that sells books over the Internet.

[ < Web Talk for Wireheads: Cookies:
Part 2 ]
[ Web Talk for Wireheads: Cookies:
Part 1 > ]



HTML5 Development Center


Recent Articles