错误:gmail-sent 通道:无法打开从属发送

问题描述 投票:0回答:4

我可以同步我的 Gmail 收件箱,但已发送文件夹不起作用。

这是我的.mbsyncrc

IMAPStore martinstabenfeldt-remote
    Account martinstabenfeldt

MaildirStore martinstabenfeldt-local
    Path ~/.mail/martinstabenfeldt/           
    INBOX ~/.mail/martinstabenfeldt/INBOX

Channel martinstabenfeldt
    Master :martinstabenfeldt-remote:
    Slave :martinstabenfeldt-local:
    Patterns *
    # Automatically create missing mailboxes, both locally and on the server
    Create Both
    # Save the synchronization state files in the relevant directory
    SyncState *

Channel martinstabenfeldt-inbox
    Master ":martinstabenfeldt-remote:INBOX"
    Slave  ":martinstabenfeldt-local:INBOX"

Channel martinstabenfeldt-sent
    Master ":martinstabenfeldt-remote:[Gmail]/Sent Mail"
    Slave  ":martinstabenfeldt-local:sent"

这是我得到的错误:

$ mbsync --verbose  martinstabenfeldt-sent
Logging in...
Opening master box [Gmail]/Sent Mail...
Opening slave box sent...
Error: channel martinstabenfeldt-sent: slave sent cannot be opened.
C: 1/1  B: 1/1  M: +0/0 *0/0 #0/0  S: +0/0 *0/0 #0/0

知道为什么会失败吗? 我创建了 ~/.mail/martinstabenfeldt/sent 文件夹。而且这个文件夹是空的。

email gmail-imap mbsync
4个回答
11
投票

不是OP的情况,但如果您忘记了

Path
MaildirStore
配置变量中的尾部斜杠,您可能会收到此确切的错误消息。

手册页确实说需要尾部斜杠,但这很容易被忽视。


6
投票

尝试使用[Google Mail]而不是[Gmail]。它应该有效。 我相信有加星标、垃圾邮件、已发送邮件、重要邮件、草稿、垃圾箱和所有邮件可与 [Google Mail]/ 配合使用。

这是我的配置文件:

IMAPAccount gmail
Host imap.gmail.com
User <your email address>
Pass <your password>
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
Path ~/mail/gmail/
Inbox ~/mail/gmail/inbox

Channel gmail-default
Master :gmail-remote:
Slave  :gmail-local:
Patterns INBOX

Channel gmail-sent
Master ":gmail-remote:[Google Mail]/Sent Mail"
slave  :gmail-local:sent

Channel gmail-trash
Master :gmail-remote:"[Google Mail]/Bin"
slave  :gmail-local:trash

Channel gmail-archive
Master :gmail-remote:"[Google Mail]/All Mail"
slave  :gmail-local:all

Channel gmail-drafts
Master :gmail-remote:"[Google Mail]/Drafts"
Slave :gmail-local:drafts

# Automatically create missing mailboxes, both locally and on the server
Create slave # Only create locally for now
SyncState *

Group gmail
Channel gmail-default
Channel gmail-trash
Channel gmail-archive
Channel gmail-sent
Channel gmail-drafts

如果仍有问题,您可以尝试以下配置:

IMAPAccount gmail
Host imap.gmail.com
User <your email address>
Pass <your password>
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
Path ~/mail/gmail/
Inbox ~/mail/gmail/inbox

Channel gmail-default
Master :gmail-remote:
Slave  :gmail-local:
Patterns "[Gmail]/Sent Mail"

# Automatically create missing mailboxes, both locally and on the server
Create slave # Only create locally for now
SyncState *

Group gmail
Channel gmail-default

一旦你运行以下命令: mbsync -Dmn gmail

您应该看到一些输出:

* NAMESPACE (("" "/")) NIL NIL
4 OK Success
>>> 5 LIST "" "*"
* LIST (\HasNoChildren) "/" "Deleted Items"
* LIST (\HasNoChildren) "/" "Drafts"
* LIST (\HasNoChildren) "/" "INBOX"
* LIST (\HasNoChildren) "/" "Junk"
* LIST (\HasNoChildren) "/" "Notes"
* LIST (\HasNoChildren) "/" "Personal"
* LIST (\HasNoChildren) "/" "Receipts"
* LIST (\HasNoChildren) "/" "Sent"
* LIST (\HasNoChildren) "/" "Trash"
* LIST (\HasNoChildren) "/" "Unwanted"
* LIST (\HasNoChildren) "/" "Work"
* LIST (\HasChildren \Noselect) "/" "[Google Mail]"
* LIST (\All \HasNoChildren) "/" "[Google Mail]/All Mail"
* LIST (\HasNoChildren \Trash) "/" "[Google Mail]/Bin"
* LIST (\Drafts \HasNoChildren) "/" "[Google Mail]/Drafts"
* LIST (\HasNoChildren \Important) "/" "[Google Mail]/Important"
* LIST (\HasNoChildren \Sent) "/" "[Google Mail]/Sent Mail"
* LIST (\HasNoChildren \Junk) "/" "[Google Mail]/Spam"
* LIST (\Flagged \HasNoChildren) "/" "[Google Mail]/Starred"
5 OK Success
>>> 6 LOGOUT
* BYE LOGOUT Requested
6 OK 73 good day (Success)

从这里您可以看到各自的远程文件夹名称应该是什么。


0
投票

我很确定这是由你的引述引起的;而不是:

Channel martinstabenfeldt-sent
    Master ":martinstabenfeldt-remote:[Gmail]/Sent Mail"
    Slave  ":martinstabenfeldt-local:sent"

尝试:

Channel martinstabenfeldt-sent
    Master :martinstabenfeldt-remote:"[Gmail]/Sent Mail"
    Slave  :martinstabenfeldt-local:sent

0
投票

尝试:

Channel gmail-sent
Far:gmail-remote:"[Gmail]/Sent Mail"
Near:gmail-locat:"Sent"
CopyArrivalDate yes
Create Both
Expunge Both
SyncState *

将频道添加到群组

Group gmail
Channel <other_channels>
Channel gmail-sent
© www.soinside.com 2019 - 2024. All rights reserved.