[root@dns ~]# yum install roundcubemail postfix dovecot mysql-server
[root@mail ~]# rsync -av /var/lib/mysql 163.17.10.1:/var/lib/ [root@mail ~]# rsync -av /etc/{postfix,dovecot,roundcubemail} 163.17.10.1:/etc/ [root@mail ~]# rsync -av /usr/share/roundcubemail 163.17.10.1:/usr/share/ [root@mail ~]# rsync -av --exclude=root --exclude=lost+found --exclude=rpc \ /var/spool/mail 163.17.10.1:/var/spool/
[root@dns ~]# grep csie.cyut.edu.tw /etc/postfix/main.cf myhostname = csie.cyut.edu.tw mydomain = csie.cyut.edu.tw
postmaster_address
。
[root@dns ~]# grep csie.cyut.edu.tw /etc/dovecot/dovecot.conf postmaster_address=postmaster at csie.cyut.edu.tw
[root@dns ~]# vim /etc/roundcubemail/config.inc.php [root@dns ~]# grep csie.cyut.edu.tw /etc/roundcubemail/config.inc.php $config['default_host'] = "csie.cyut.edu.tw";
username, mail_host
兩個欄位做斷判,備份到新主機的資料庫如果不修改,由於郵件主機不同,因此登入時會新產生一筆帳號。上一動作將 roundcubemail 預設 mail server 改成 csie.cyut.edu.tw,mysql 資料庫 roundcubemail 帳號中的 mail_host
也必須改成 csie.cyut.edu.tw,這樣才能使用原有帳號的設定。
[root@dns ~]# mysql -uroot -pxxxxxx -e "use roundcube; \ update users set mail_host='csie.cyut.edu.tw' \ where mail_host='mail.csie.cyut.edu.tw';"