从 kmail 迁移到 thunderbird

从 kmail 迁移到 thunderbird

我喜欢 kmail 界面,但多年来我一直遇到问题,最近几天它变得无法使用:它不断锁定或崩溃,网络上没有解决方案。我不会详细讨论,因为我厌倦了它。

我尝试重置其设置(https://forum.kde.org/viewtopic.php?f=20&t=97754) 毫无效果。我想移动 Thunderbird,但我还没有找到导入消息/帐户/过滤器的方法:在 Thunderbid 中,[工具][导入] 然后 [下一步] 会将我带到一个只有 [取消] 的空白窗口。从 kmail 我设法将所有内容导出到 zip 导出文件,但我不知道如何处理它。

我搜索了 thunderbird 的导入附加组件,但没有成功。我读过一些消息,说要手动移动 /cur/ 目录,但这仅适用于消息,对吗?有什么建议吗?

答案1

我终于找到了解决方案。正如 Timothy Truckle 所写,我使用了导出/导入插件,但在此之前,我必须重命名邮件文件,否则导入只会显示空目录。

首先,找到 kmail 存储您的邮件的位置(如果您有多个帐户,则可能有多个地方):

$ ls -1d ~/.local/share/local-mail ~/.local/share/*/local-mail
~/.local/share/0/local-mail
~/.local/share/1/local-mail
~/.local/share/local-mail

然后在每个目录中,执行以下操作:

# This performs a backup
zip -r ~/mail.backup.zip ~/.local/share/local-mail
cd ~/.local/share/local-mail
# This renames the files so that the import will identify them properly
find -type f -exec mv -v '{}' '{}.eml' \;

现在您可以在这里停下来并导入 Thunderbird 中的目录,但您最终会得到很多空目录和错误命名的目录,例如 .Friends.directory 或 .Family/cur,因此可以先使用一些脚本清理一下。

# Remove empty directories
find -type d -exec rmdir -v '{}' \;
# Move the files up from cur/, tmp/ and new/
find -type d -name cur -exec bash -c 'for dir; do mv -v "$dir"/* "$(dirname "$dir")/"; done' bash {} +
find -type d -name tmp -exec bash -c 'for dir; do mv -v "$dir"/* "$(dirname "$dir")/"; done' bash {} +
find -type d -name new -exec bash -c 'for dir; do mv -v "$dir"/* "$(dirname "$dir")/"; done' bash {} +
find -type d -exec rmdir -v '{}' \;
find -type d -iregex "\..*\.directory"
# Now move ../.something.directory into ../something (which may not exist)
find -depth -type d -iregex "\..*\.directory" -exec bash -c 'for dir; do A=$(echo $dir | sed -e "s#\(.*\)\.\([^/]*\).directory#\1\2#"); mv -v "$dir"/* "$A/" ; done' bash {} +
# if there are still .something.directory, just rename them manually to 'something' (this line won't do it automagically):
find -type d -iregex "\..*\.directory"

最后,在 Thunderbird 中,在本地文件夹下创建一个目录 IMPORT,选择它(不要忘记,因为右键单击是不够的!),右键单击它,[ImportExportTools],[从目录及其子目录导入所有消息],让它工作一段时间。

我可以编写一个脚本来完成上述所有操作,但现在我终于设法移动了我的邮件,我对此感到厌烦。

答案2

Thunderbird 有一个出口进口您可以从 KMail 文件夹结构导入邮件消息的插件。https://addons.mozilla.org/de/thunderbird/addon/importexporttools/

不幸的是,您不能同时导入文件夹结构和邮件消息(至少我不能)。

我意外地导入了文件夹结构,但没有任何邮件,因此删除了它。不幸的是,我无法重现这种情况,因此我不得不从头开始在 TB 中重新创建文件夹结构。

然后您必须分别导入每个文件夹的邮件消息。TB 导入/导出插件的菜单确实有“带子文件夹”条目,但它们对我来说不起作用。

相关内容