I want my RaQ to point from virtual site domain1 to another domain2 and send all email from domain1, to domain2 on the same server.

Export to PDF | Export to DOC

Problem: I want my RaQ to point from virtual site domain1 to another domain2 and send all email from domain1, to domain2 on the same server.


  1. Ensure domain2 is properly setup and all users receive e-mail.
  2. Setup DNS in the control panel for domain1:
    domain1.com xxx.xxx.xxxx.xxx
    (domain2 IP address)
    mail.domain1.com xxx.xxx.xxxx.xxx
    (domain2 IP address)
    www.domain1.com xxx.xxx.xxxx.xxx
    (domain2 IP address)
    (domain2 IP address)
    (domain2 IP address)
    (domain2 IP address)
    domain1.com mail.domain2.com
  3. vi /etc/httpd/conf/httpd.conf
    1. Yank (20 yy) the 20 lines in the httd.conf file that correspond to domain2
      (begins with <VirtualHost xxx.xxx.xxx.xxx> and ends with </VirtualHost xxx.xxx.xxx.xxx> and has the name of www.domain2.com as the ServerName.
    2. Go the line after the end of the domain2 section (The beginning of the next section and paste (p) the 20 lines.
    3. Replace the ServerName and ServerAlias configurations with domain1.ServerName

      www.domain2.com now will become: ServerName www.domain1.com
      ServerAlias www.domain2.com now will become: ServerAlias www.domain1.com

  4. Save the /etc/httpd/conf/httpd.conf and restart the web server by running the script ht (a custom script in /usr/bin that runs /etc/rc.d/rc2.d/S74admserv restart & /etc/rc.d/rc2.d/S75httpd restart)
  5. Perform steps 5-8 only if email from domain1 should go to domain2.
    Add the following custom line at the bottom of the /etc/virtusertable only if mail for user@domain1.com should go to user@domain2.com.
    If mail for user@domain1.com should go to defaultuser@domain2.com, then skip to step 6. (All mail delivered to domain1 will go to user@domain2)
    @domain1.com %1@domain2.com

    Where the space between is a TAB.
    This ensures any mail sent to user@domain1.com will be sent to the user@domain2.com. (A user to user relationship)

  6. Follow this step only if you skipped to it from step 5.
    To have mail for user@domain1.com go to anotheruser@domain2.com. There will not be a user to user relationship.List @domain1 as an alias for the user in domain2 that will receive all the email.
    To do this:

    a. Use the user interface and go to Site Management for domain2.com.
    b. Click on the blue envelope button to create/modify the user’s email account.
    c. Add “@domain1.com” to the email aliases of the user. This creates a catch-all alias for the site domain1 in domain2..

  7. Run makemap hash /etc/virtusertable < /etc/virtusertable
  8. Edit /etc/sendmail.cw and add domain1.com and www.domain1.com to the bottom of the file.
  9. Restart sendmail
    Run /etc/rc.d/init.d/sendmail restart
  10. Test doamin1from a web browser and for e-mail (Note: e-mail boxes are located in /home/spool/mail) 

Leave a Reply

Your email address will not be published. Required fields are marked *