H-Sphere Documentation Sysadmin Guide

For more information contact us at info@psoft.net

Moving Mail Service

 

Related Docs:  

Understanding Mail Server Configuration

To move the mail server to another machine, you need to do the following:

  1. Prepare a new box with a mail server using H-Sphere installer.
  2. Using E.Manager, create a new physical server and add a mail server group (or add this group to the physical server you are planning to move mail server to).
  3. Log into control panel server as root.
  4. Stop the Control Panel.
  5. In the H-Sphere database run the following command:
    update l_server set p_server_id=[new_p_server_id] where id=[id_of_mail_logical_server];
    (1 record)
    update l_server_ips set ip='[new_mail_server_IP]', mask='[new_mail_server_mask]' where l_server_id=[id_of_mail_logical_server] and flag=4;
    (1 record)
    select * from l_server_ips where l_server_id=[id_of_mail_logical_server] and flag in (5,6);
  6. Log into your old mail server from the cp server:
    su-l cpanel
    ssh root@OLD_MAIL_SERVER_IP
  7. Move directories from the old to a new mail server:
    /hsphere/local/var/vpopmail/domains/
    /hsphere/local/var/vpopmail/etc/
    /var/qmail
  8. To move directories, you can run the following commands:
    rsync -arzgop -e ssh /hsphere/local/var/vpopmail/domains/ root@New_Mail_Server_IP:/hsphere/local/var/vpopmail/domains/
    rsync -arzgop -e ssh /hsphere/local/var/vpopmail/etc/ root@New_Mail_Server_IP:/hsphere/local/var/vpopmail/etc/
    rsync -arzgop -e ssh /var/qmail root@New_Mail_Server_IP:/var/qmail

    You may also want to run queue-fix on a new mail server to rescue queued mail:
    queue-fix /var/qmail/queue

  9. Log off the old mail server.
  10. Log into a new mail server by running:
    ssh root@NEW_MAIL_SERVER_IP
  11. Check if vpopmail user ID and group ID have changed:
    1) create test.test domain:
    /hsphere/local/var/vpopmail/bin/vadddomain test.test
    2) check new vpopmail user id (UID):
    tail -3 /var/qmail/users/assign
    The result should contain the following 3 lines:
        your.domain.com-:your.domain.com:110:100:/hsphere/local/var/vpopmail/domains/your.domain.com:-::
        +test.test-:test.test:399:399:/hsphere/local/var/vpopmail/domains/test.test:-::
        .
    Where 110 - old vpopmail user id (UID) 100 - old vchkpw group id (GID)
    399 - new vpopmail user id (UID) 399 - new vchkpw group id (GID)

    If vpopmail user ID/vchkpw group ID is changed:

    1. change group ID for group vchkpw:
      /usr/sbin/groupmod -g GROUP_ID vchkpw
      example: /usr/sbin/groupmod -g 399 vchkpw
    2. change user ID for vpopmail
      /usr/sbin/usermod -u USER_ID -g GROUP_ID vpopmail
      example: /usr/sbin/usermod -u 399 -g 399 vpopmail
    3. change permissions for all copied files that belong to the vpopmail user:
      find / -user vpopmail -exec chown vpopmail:vchkpw {} \;
    4. in the file /var/qmail/users/assign change vpopmail user IDs/vchkpw group IDs to new IDs similar to the 2nd line of the result above;
    5. delete test.test virtual mail domain:
      /hsphere/local/var/vpopmail/bin/vdeldomain test.test
    6. create test.test domain again:
      /hsphere/local/var/vpopmail/bin/vadddomain test.test
    7. restart qmail
  12. Send a test email to postmaster@[your_service_zone] to see if your mail service is up and running.
  13. Start the Control Panel.

Related Docs:  

Understanding Mail Server Configuration



Home   Products   Services   Partners   Support   News   Contact   Forum
© Copyright 1998-2003. Positive Software Corporation.
All rights reserved.