I am getting this error when trying to set the deleted flag;
Net::IMAP::NoResponseError (STORE attempt on READ-ONLY folder (Failure))
The error is thrown when running this;
connector.uid_store(item_uid, "+FLAGS", [:Deleted])
This code runs fine just before it;
connector.create("TestFolder") unless connector.list('', "TestFolder")
connector.uid_copy(item_uid, "TestFolder")
I have not been able to find a reason for this, especially since I can create 'folders' and copy items to it without a problem. I am using ruby 1.9.2, rails 3.2.10, mail 2.4.4
Any help would really save my mind.
Cheers
~~~~~~~ edit Mail defaults are setup as per below;
#==> 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)
The connector
is picked up from here;
def add_email_stubs(items, feed)
Mail.all do |item, connector, item_uid|
and used here (in same def);
#==> 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