Offlineimap OSX Snow Leopard - 除一个帐户外所有帐户均同步,但 Gmail 同步因重复文件而崩溃?

Offlineimap OSX Snow Leopard - 除一个帐户外所有帐户均同步,但 Gmail 同步因重复文件而崩溃?

我正在 OSX Snow Leopard 上设置 Offlineimap 和 Mutt。我几乎已经完成了,并且有 5 个帐户正在工作/同步。但是,每次我尝试同步时,我的主要 Gmail 都会崩溃!我不知道发生了什么,因为其他帐户也在 Gmail 上,并且没有问题。主要 Gmail 帐户中有更多的消息(>5gb)——这可能是问题所在吗?我无休止地在 Google 上搜索此错误消息,但一无所获。错误消息显示“OSError:[Errno 17] 文件存在:'[Gmail].已发送邮件'”——但是我多次删除了此文件/文件夹并确保 .offlineimaprc 是干净的。此外,其他帐户也以相同的方式设置,没有遇到此问题。真的不知道如何从这里继续,但可能有一些显而易见的答案。

非常感谢!

铁轨上的兔子

Thread 'Account sync Gmail' terminated with exception:
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/offlineimap/threadutil.py", line 149, in run
    Thread.run(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/offlineimap/accounts.py", line 183, in syncrunner
    self.sync(siglistener)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/offlineimap/accounts.py", line 220, in sync
    remoterepos.syncfoldersto(localrepos, [statusrepos])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/offlineimap/repository/Base.py", line 155, in syncfoldersto
    dest.makefolder(key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/offlineimap/repository/Maildir.py", line 101, in makefolder
    os.makedirs(foldername, 0700)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '[Gmail].Sent Mail'


Last 50 debug messages logged for Account sync Gmail prior to exception:
imap: imapsplit() called with input: \HasChildren \HasNoChildren
imap: imapsplit() returning: ['\\HasChildren', '\\HasNoChildren']
imap: dequote() called with input: "[Gmail]/Drafts"
imap: dequote() returning: [Gmail]/Drafts
imap: dequote() called with input: [Gmail]/Drafts
imap: imapsplit() called with input: (\HasNoChildren) "/" "[Gmail]/Sent Mail"
imap: imapsplit() returning: ['(\\HasNoChildren)', '"/"', '"[Gmail]/Sent Mail"']
imap: imapsplit() called with input: \HasNoChildren
imap: imapsplit() returning: ['\\HasNoChildren']
imap: dequote() called with input: "[Gmail]/Sent Mail"
imap: dequote() returning: [Gmail]/Sent Mail
imap: dequote() called with input: [Gmail]/Sent Mail
imap: imapsplit() called with input: (\HasChildren \HasNoChildren) "/" "[Gmail]/Starred"
imap: imapsplit() returning: ['(\\HasChildren \\HasNoChildren)', '"/"', '"[Gmail]/Starred"']
imap: imapsplit() called with input: \HasChildren \HasNoChildren
imap: imapsplit() returning: ['\\HasChildren', '\\HasNoChildren']
imap: dequote() called with input: "[Gmail]/Starred"
imap: dequote() returning: [Gmail]/Starred
imap: dequote() called with input: [Gmail]/Starred
imap: imapsplit() called with input: (\HasChildren \HasNoChildren) "/" "[Gmail]/Trash"
imap: imapsplit() returning: ['(\\HasChildren \\HasNoChildren)', '"/"', '"[Gmail]/Trash"']
imap: imapsplit() called with input: \HasChildren \HasNoChildren
imap: imapsplit() returning: ['\\HasChildren', '\\HasNoChildren']
imap: dequote() called with input: "[Gmail]/Trash"
imap

答案1

好吧,像往常一样,实际上写出这个问题让我以不同的方式思考它,我找到了(简单的)解决方案。我会在这里发布它以防其他人遇到这种情况:

问题是,在之前的设置过程中(或其他方式),Offlineimap 或 Mutt 以某种方式向我的 Gmail 帐户添加了一个名为“[Gmail]/已发送邮件”的标签/文件夹。然后它再次尝试添加它,但失败了,因为它已经存在了。所以我进入 Gmail 并删除了这个重复的标签,同步就成功了。

答案2

我认为如果你使用最新的离线IMAP(可从 github 获取)。它有专门针对 Gmail 的修改和配置规范。

我在文档中找不到它,但是示例配置文件演示如何进行 Gmail 配置。OfflineIMAP 实际上有一个类型=Gmail设置。搜索邮箱在页面上。它位于第 260 行左右,不过当您查看它时它可能会移动。

相关内容