【问题标题】:Imaplib Select Fails while connecting folder(**Labelname) of gmail连接gmail的文件夹(**Labelname)时Imaplib选择失败
【发布时间】:2012-05-10 01:42:59
【问题描述】:

我正在使用 imaplib 模块连接到 Gmail Imap,但出现以下错误。 我正在使用选择命令连接

Labelname is  **LabelName 

我得到这个错误:

    resp, data = self._imap.select("**LabelName")
  File "/usr/lib/python2.6/imaplib.py", line 642, in select
    typ, dat = self._simple_command(name, mailbox)
  File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.6/imaplib.py", line 895, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SELECT command error: BAD ['Could not parse command']

而如果标签名称是

** LabelName 

连接成功。

谁能告诉我这里发生了什么?

【问题讨论】:

  • 当我们尝试连接时,php库中没有这个错误

标签: python gmail-imap imaplib


【解决方案1】:

解决了这个问题,在使用 imaplib 连接时,我们需要像这样连接:

imapobj.select('"'+ '**Foldername' + '"')

这会导致像这样选择

"**Foldername"

【讨论】:

    猜你喜欢
    • 2017-10-29
    • 2010-09-26
    • 2011-07-08
    • 2014-10-14
    • 2018-02-08
    • 2017-09-29
    • 1970-01-01
    • 1970-01-01
    • 2022-01-01
    相关资源
    最近更新 更多