austinrocks1995
austinrocks1995

Reputation: 45

Mark as unread flag is not working in IMAP + ruby

Unread to Read

it's working

imap = Net::IMAP.new(account.imap_url, 993, usessl = true, certs = nil, verify = false)
imap.login(account.client_email, account.client_secret)
imap.select("Inbox")
imap.search(['All'])
imap.store(7665, "+FLAGS", [:Seen])

Read to Un-read

it's not working

imap = Net::IMAP.new(account.imap_url, 993, usessl = true, certs = nil, verify = false)
imap.login(account.client_email, account.client_secret)
imap.select("Inbox")
imap.search(['All'])
imap.store(7665, "+FLAGS", [:Unseen])

I tried with Unseen, Unread, Not seen and I have set a flag as 1, 0 for seen then also I didn't any solution for it. Bad Response Error

Upvotes: 1

Views: 680

Answers (1)

Max
Max

Reputation: 10985

Unseen is not a flag (it is a search criteria though). You take away the \Seen flag with -FLAGS instead.

Upvotes: 3

Related Questions