尝试设置已删除标志时出现此错误;
Net::IMAP::NoResponseError (STORE attempt on READ-ONLY folder (Failure))
运行时抛出错误;
connector.uid_store(item_uid, "+FLAGS", [:Deleted])
这段代码在它之前运行良好;
connector.create("TestFolder") unless connector.list('', "TestFolder")
connector.uid_copy(item_uid, "TestFolder")
我一直无法找到原因,特别是因为我可以创建“文件夹”并将项目复制到其中而不会出现问题。我正在使用 ruby 1.9.2、rails 3.2.10、邮件 2.4.4
任何帮助都会真正拯救我的思想。
干杯
~~~~~~~ 编辑邮件默认设置如下;
#==> Collect items
case feed.url_type
when "IMAP"
puts "Trying IMAP retriever for " + feed.url_source
Mail.defaults do
retriever_method :imap,
:address => feed.url_source,
:port => 993,
:user_name => feed.user,
:password => feed.password,
:enable_ssl => true,
:read_only => false
end
self.add_email_stubs(Mail.find(), feed)
是从这里connector
拿起的;
def add_email_stubs(items, feed)
Mail.all do |item, connector, item_uid|
并在此处使用(在相同的定义中);
#==> Move message
connector.create("Archive") unless connector.list('', "Archive")
connector.uid_copy(item_uid, "Archive")
connector.uid_store(item_uid, "+FLAGS", [:Deleted]) <==Error occurs here