从 Plesk 服务器获取旧邮件,移动到相同域名的 CPanel 服务器

Fetching old emails from Plesk server, to move to CPanel server of the same domain name

我的客户之前有一个网站由另一位使用 plesk 的先生托管。

我已经接管了网站并将域迁移到我的服务器,所以它的名称服务器现在是我的服务器,而不是 plesk 个人的。

我知道那个人使用 123reg 来托管。我也有 IP 地址、记录和诸如此类的东西,但没有名称服务器。

我的问题是:我的客户没有告诉我他们需要将这些电子邮件与网站一起迁移,所以现在他们无法访问在将网站迁移到之前存在的电子邮件我。 在你说之前,我已经阅读了很多在线文章和主题以试图找到答案,但要么他们有不同的问题,要么使用了过时的解决方案。

我需要知道如何访问旧电子邮件收件箱以 FTP 电子邮件或手动传输它们。

坐在这里:

请帮我纠正这个菜鸟错误!我再也不会假设他们不需要电子邮件了!

有任何问题请尽管提问。我知道我有办法修复它,但不知道如何去做。

非常感谢! 基隆

问题是旧服务器使用的是 Plesk,而 Plesk 使用的是 Postfix 电子邮件服务器,而新服务器使用的是 cPanel,后者使用 Exim。因此,没有直接的方法来传输电子邮件。您应该使用 IMAP 手动迁移电子邮件。如果只有几个电子邮件帐户,请尝试使用以下步骤:

  • 在新服务器上创建与旧服务器上相同的电子邮件帐户。使用相同的拼写和大小写。
  • 为新电子邮件帐户提供您在旧服务器上使用的相同密码。如果需要,您可以在迁移过程完成后更改密码。

  • 在您的本地电子邮件客户端中,创建两个新的电子邮件帐户。

    • 这两个都用于同一个电子邮件地址。
    • 他们将使用相同的密码。
    • 它们都必须配置为使用 IMAP 连接。
    • 每个帐户的接收服务器(或 IMAP 服务器)都不同。您应该尽可能为新服务器使用您的 IP 地址,为旧服务器使用您的访问域或 IP 地址,而不是您的域名。这将避免任何可能的 DNS 冲突。
  • 在两个帐户都在线的情况下,打开连接到旧服务器的帐户的收件箱。将邮件从此收件箱拖放到新服务器上的收件箱中。
  • 就是这样!如果您有很多电子邮件,请给帐户几分钟时间以完成同步。完成后,您的旧电子邮件将在新服务器上的邮箱中。

如果您可以访问新服务器中的控制台,您可以尝试安装 imapsync,例如 CentOS:

If you dont havce access to the console or cant install imapsync, you can always use the online version here: https://i005.lamiral.info/X/

首先通过 yum 安装访问 Epel 存储库:

  yum install epel-release

然后安装imapsync及其依赖:

  yum install imapsync

然后你可以创建一个脚本来读取一个 txt 文件并同步你想要的所有 IMAP 邮箱(只需将旧邮件服务器的 IP 地址用作源服务器):

#!/bin/sh
#
# $Id: sync_loop_unix.sh,v 1.8 2018/02/12 21:53:40 gilles Exp gilles $

# Example for imapsync massive migration on Unix systems.
# See also http://imapsync.lamiral.info/FAQ.d/FAQ.Massive.txt
#
# Data is supposed to be in file.txt in the following format:
# host001_1;user001_1;password001_1;host001_2;user001_2;password001_2;
# ...
# Separator is character semi-colon ";" it can be changed by any character changing IFS=';' 
# in the while loop below.
# # Each line contains 6 columns, columns are parameter values for 
# --host1 --user1 --password1 --host2 --user2 --password2
# and a trailing empty fake column to avoid CR LF part going 
# in the 6th parameter password2. Don't forget the last semicolon.
#
# You can add extra options after the variable "$@" 
# Use character backslash \ at the end of each supplementary line, except for the last one.
# You can also pass extra options via the parameters of this script since
# they will be in "$@"

# The credentials filename "file.txt" used for the loop can be renamed 
# by changing "file.txt" below.


echo Looping on account credentials found in file.txt
echo

{ while IFS=';' read  h1 u1 p1 h2 u2 p2 fake
    do 
        { echo "$h1" | tr -d '\r' | egrep '^#|^ *$' ; } > /dev/null && continue # this skip commented lines in file.txt
        echo "==== Starting imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
        imapsync --host1 "$h1" --user1 "$u1" --password1 "$p1" \
                 --host2 "$h2" --user2 "$u2" --password2 "$p2" \
                 "$@"  
        echo "==== Ended imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
        echo
    done 
} < file.txt

这是.txt 文件的示例(您必须将其与邮箱数据一起编译才能同步)。

Format is:

source server;source user;source password;destination server;destination user;destination password

# Example file.txt for imapsync massive migration.
#
# $Id: file.txt,v 1.14 2018/02/11 13:42:58 gilles Exp gilles $ 
#
# Each line contains 6 columns, columns are parameters for 
# --host1 --user1 --password1 --host2 --user2 --password2
# and a trailing empty fake column to avoid CR LF part going 
# in the 6th parameter password2. Don't forget the last semicolon.
#
# Windows: see the script examples/sync_loop_windows.bat 
# Unix:    see the script examples/sync_loop_unix.sh 
#
# Lines starting with a # are comments and ignored
# Blank lines are ignored as well


# Now the data example 
host001_1;user001_1;password001_1;host001_2;user001_2;password001_2;
host002_1;user002_1;password002_1;host002_2;user002_2;password002_2;
host003_1;user003_1;password003_1;host003_2;user003_2;password003_2;

# Another comment blabla
host004_1;user004_1;password004_1;host004_2;user004_2;password004_2;

# This last example is a real one, ie, truly working in the real world.
test1.lamiral.info;test1;secret1;test2.lamiral.info;test2;secret2;