translated

This commit is contained in:
geekpi 2020-01-17 08:46:04 +08:00
parent 727f9f1858
commit b35d90fb14
2 changed files with 77 additions and 79 deletions

View File

@ -1,79 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Keep your email in sync with OfflineIMAP)
[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
Keep your email in sync with OfflineIMAP
======
Mirroring your email to a local folder is the first step in taming your
message pileup. Learn how in the third article in our series on 20 ways
to be more productive with open source in 2020.
![email or newsletters via inbox and browser][1]
Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using.
### Sync your email locally with OfflineIMAP
I have a love/hate relationship with email. I love the way it allows me to communicate with people all over the world. But, like many of you, I get a lot of mail, much of it from lists as well as spammers, advertisers, and the like. And it builds up.
![The OfflineIMAP "blinkenlights" UI][2]
Almost all the tools I've tried (outside of the big mail providers) that work really well with large amounts of mail have one thing in common: they all rely on a local copy of your mail stored in [Maildir][3] format. And the most useful tool for that is [OfflineIMAP][4]. OfflineIMAP is a Python script that mirrors IMAP mailboxes to a local Maildir folder tree. I use it to create a local copy of my mail and keep it in sync. Most Linux distributions include it, and it is available via Python's pip package manager.
The sample minimal configuration file is a good template to start with; begin by copying it to **~/.offlineimaprc**. Mine looks something like this:
```
[general]
accounts = LocalSync
ui=Quiet
autorefresh=30
[Account LocalSync]
localrepository = LocalMail
remoterepository = MirrorIMAP
[Repository MirrorIMAP]
type = IMAP
remotehost = my.mail.server
remoteuser = myusername
remotepass = mypassword
auth_mechanisms = LOGIN
createfolder = true
ssl = yes
sslcacertfile = OS-DEFAULT
[Repository LocalMail]
type = Maildir
localfolders = ~/Maildir
sep = .
createfolder = true
```
What my configuration does is define two repositories: the remote IMAP server and the local Maildir folder. There is also the **Account** that tells OfflineIMAP what to sync when it runs. You can define multiple accounts linked to different repositories. This allows you to copy from one IMAP server to another as a backup, in addition to making a copy locally.
The first run of OfflineIMAP will take a while if you have a lot of mail. But once it is done, future runs take a _lot_ less time. You can also run OfflineIMAP as a cron job (my preference) or as a daemon constantly syncing between repositories. The documentation covers all of this, as well as advanced configuration options for things like Gmail.
Now that my mail is copied locally, there is a whole range of tools I can work with to speed up searching, filing, and managing mail. And I'll talk about that tomorrow.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/sync-email-offlineimap
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser)
[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI)
[3]: https://en.wikipedia.org/wiki/Maildir
[4]: http://www.offlineimap.org/

View File

@ -0,0 +1,77 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Keep your email in sync with OfflineIMAP)
[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap)
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
使用 OfflineIMAP 同步邮件
======
将邮件镜像保存到本地是整理消息的第一步。在我们的 20 个使用开源提升生产力的系列的第三篇文章中了解该如何做。
![email or newsletters via inbox and browser][1]
去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。
### 使用 OfflineIMAP 在本地同步你的邮件
我与邮件之间存在爱恨交织的关系。我喜欢它让我与世界各地的人交流的方式。但是,像你们中的许多人一样,我收到过很多邮件,许多是来自列表中的人,但也有很多垃圾邮件、广告等。这些积累了很多。
![The OfflineIMAP "blinkenlights" UI][2]
我尝试过的大多数工具(除了大型提供商外)都可以很好地处理大量邮件,它们都有一个共同点:它们都依赖于以 [Maildir][3] 格式存储的本地邮件副本。这其中最有用的是 [OfflineIMAP][4]。OfflineIMAP 是将 IMAP 邮箱镜像到本地 Maildir 文件夹树的 Python 脚本。我用它来创建邮件的本地副本并使其保持同步。大多数 Linux 发行版都包含它,并且可以通过 Python 的 pip 包管理器获得。
示例的最小配置文件是一个很好的模板。首先将其复制到 **~/.offlineimaprc**。我的看起来像这样:
```
[general]
accounts = LocalSync
ui=Quiet
autorefresh=30
[Account LocalSync]
localrepository = LocalMail
remoterepository = MirrorIMAP
[Repository MirrorIMAP]
type = IMAP
remotehost = my.mail.server
remoteuser = myusername
remotepass = mypassword
auth_mechanisms = LOGIN
createfolder = true
ssl = yes
sslcacertfile = OS-DEFAULT
[Repository LocalMail]
type = Maildir
localfolders = ~/Maildir
sep = .
createfolder = true
```
我的配置要做的是定义两个仓库:远程 IMAP 服务器和本地 Maildir 文件夹。还有一个**帐户**,告诉 OfflineIMAP 运行时要同步什么。你可以定义链接到不同仓库的多个帐户。除了本地复制外,这还允许你从一台 IMAP 服务器复制到另一台作为备份。
如果你有很多邮件,那么首次运行 OfflineIMAP 将花费一些时间。但是完成后下次会花_少得多_的时间。你也可以将 CoffeeIMAP 作为 cron 任务(我的偏好)或作为守护程序在仓库之间不断进行同步。文档涵盖了所有这些内容以及 Gmail 等高级配置选项。
现在,我的邮件已在本地复制,并有多种工具用来加快搜索、归档和管理邮件的速度。我明天再说。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/1/sync-email-offlineimap
作者:[Kevin Sonney][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ksonney
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser)
[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI)
[3]: https://en.wikipedia.org/wiki/Maildir
[4]: http://www.offlineimap.org/