通过 imapsync 实现邮件服务器迁移 (支持 IMAP 的邮箱)

本帖记录利用 imapsync 工具,从CentOS服务器上将Postfix邮箱转移到新的CentOS主机上的方法。
imapsync 用于同步两个imap邮箱 (仅适合迁移邮箱或者备份,不适合同步两个有用户同时访问的 imap 帐号)

首先在新的服务器上安装好邮件系统,建好相同的邮箱。

接着安装 imapsync (可以装在要同步的任意一台服务器上,也可以装在第三方的服务器上)
yum install imapsync

以下面的数据为例:
旧的邮件服务器为 mail1.mazentop.com
新的邮件服务器为 mail2.mazentop.com
旧的邮箱地址 support@mazentop.com
新的邮箱地址 support@mazentop.com
旧的邮箱密码保存在文件 /etc/mailpass1
新的邮箱密码保存在文件 /etc/mailpass2

那么以下命令可以将邮箱 support@mazentop.com 中的所有内容,从服务器 mail1 复制到服务器 mail2 上的 support@mazentop.com 邮箱中:
imapsync --host1 mail1.mazentop.com --user1 support@mazentop.com --passfile1 /etc/mailpass1 --host2 mail2.mazentop.com --user2 support@mazentop.com --passfile2 /etc/mailpass2

2 thoughts on “通过 imapsync 实现邮件服务器迁移 (支持 IMAP 的邮箱)

  • 星期四 六月 2nd, 2011 at 19:49
    Permalink

    Hi,

    Postfix is a SMTP server, there is no “Postfix mailbox”. You have to detect the IMAP server holding mailboxes. Postfix delivers messages to an IMAP server via a deliver agent. Postfix doesn’t know it deliver to IMAP or POP or file or command. The title is wrong, the body is good.

    Reply
  • 星期六 六月 4th, 2011 at 21:21
    Permalink

    Hi Gilles,

    Thanks for pointing out my mistake! I was trying to add more keywords to the title. 🙂

    I came across your website and found the Imapsync utility really helpful. so excited to see you here.

    Reply

黄忠进行回复 取消回复

电子邮件地址不会被公开。 必填项已用*标注