IMAP迁移和对文件夹结构的更改

问题描述 投票:1回答:2

我正在ubuntu 14.04服务器和telnet上使用imapcopy迁移并分别编辑沉重的imap收件箱帐户。我想展平文件夹结构,这意味着我想选择所有子文件夹中的所有电子邮件并将其复制到一个“导入”文件夹中。

我似乎无法做到这一点。对替代方法有什么建议吗?

email imap dovecot
2个回答
0
投票

您在使用这个吗? https://launchpad.net/ubuntu/+source/imapcopy/1.04-1。如果是这样,请编辑imaptools.pas并更改如下所示的行以将所有消息复制到目标上的IMPORT文件夹。

原件:

Result := Command ('APPEND '+Mailbox + Flags + ' {' + IntToStr (Length(Msg)) + '}',TRUE);

新:

Result := Command ('APPEND IMPORT' + Flags + ' {' + IntToStr (Length(Msg)) + '}',TRUE);

如果IMPORT文件夹尚不存在,则需要创建它。

Err := Dst.CreateMailbox ('IMPORT');

然后重新编译。


0
投票

您也可以使用https://github.com/Schluggi/pymap-copy。我认为这更帅,因为您无需编译任何内容。

如果您如上所述需要,(将每个子文件夹的每个邮件复制到导入文件夹中:] >>

./pymap-copy.py \
--source-user=user1 \
--source-server=server1.example.org \
--source-pass=2345678 \
--destination-user=user2 \
--destination-server=server2.example.info \
--destination-pass=abcdef \
--redirect *:INBOX.import

并且如果您要维护文件夹结构:

./pymap-copy.py \
--source-user=user1 \
--source-server=server1.example.org \
--source-pass=2345678 \
--destination-user=user2 \
--destination-server=server2.example.info \
--destination-pass=abcdef \
--destination-root INBOX.import
© www.soinside.com 2019 - 2024. All rights reserved.