HPlogo HP-UX Mailing Services Administrator's Guide: HP-UX 11i v1 and HP-UX 11i v2 > Chapter 2 Configuring and Administering Sendmail

Creating Domain-Specific Aliasing Using Virtual Hosting

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Sendmail controls the /etc/mail/virtusertable database. This database provides a domain-specific form of aliasing and also allows multiple domains to be hosted on a single machine.

With this feature, users can have their own domain names and receive mail using these domain names with a single host. You are required to obtain a new (available) domain name and set up name servers for that domain. Then, you must configure MX records for your new domain.

NOTE: Virtual hosting requires DNS to be set up. For information on setting up DNS, see the IP Address and Client Management Administrator’s Guide, at the URL http://www.docs.hp.com/hpux/netcom/index.html#Internet%20Services

The following steps describe how to set up virtual hosting:

  1. Assume mydomain.com as the new domain name. If the mail server that serves the new domain name has a full-time connection to the Internet, include the following line in the db.domain file (domain is the domain name specified in the file /etc/resolve.conf):

    mydomain.com. IN MX 10 mymailserver.mydomain.com.

    Otherwise, you must have another machine to queue mail for your domain. Include the following lines in the db.domain file:

    mydomain.com. IN MX 10 mymailserver.mydomain.com.
    mydomain.com. IN MX 20 othermailserver.otherdomain.com.

    Now you must set up Sendmail.

  2. Generate the sendmail.cf.gen file using the gen_cf utility with the virtusertable option, and move this file to /etc/mail/sendmail.cf.

    For more information on gen_cf, read the section “Modifying the Default Sendmail Configuration File”.

  3. Create the virtual user table in the /etc/mail directory. A sample virtual user table may look like the following:

    joe@mydomain.com         jschmoe
    jane@mydomain.com        jdoe@othercompany.com
    @mydomain.com            jschmoe

    In this example, the address joe@mydomain.com is mapped to the local user jschmoe, jane@mydomain.com to the remote user jdoe@othercompany.com, and any other address in mydomain.com is mapped to jschmoe.

  4. Build the virtual user table database file by running the makemap utility on the command line as follows:

    # makemap dbm /etc/mail/virtusertable < /etc/mail/virtusertable

    To reverse map local users for outbound mails, you must generate the sendmail.cf file with the genericstable option in addition to the virtusertable option.

    You must generate the generics table similar to the virtual user table, but with the entries reversed.

    Example:

    jschmoe                joe@yourdomain.com
  5. Add your domain name to the /etc/mail/sendmail.cw file.

  6. Kill and restart Sendmail.

    You can now receive mail at mydomain.com.

    IMPORTANT: The virtual hosting feature provides better support for ISPs that offer queuing services to dial-up customers because queue-runs no longer wait for the dial-up server connection attempts to time out.
© 2006 Hewlett-Packard Development Company, L.P.