Reputation: 179
I am able to read the unread emails with the word "development" from my mailbox using:
Mail.find(keys: ['UNSEEN','SUBJECT',"development"],:count => 100,:what =>:all).
I now want to retrieve the unread mails from my mailbox with out the word "development" in subject line.
I read RFC2060, section 6.4.4, and tried UNKEYWORD AND NOT methods, but it didn't help. Can anybody suggest me an appropriate answer for the same?
Upvotes: 0
Views: 297
Reputation: 54223
Note that it is an IMAP query, so it uses Polish notation :
Mail.find(keys: ['UNSEEN', 'NOT', 'SUBJECT',"development"],:count => 100,:what =>:all)
It worked on my computer with Gmail IMAP.
One problem was that an Unseen mail was considered Seen as soon as I retrieved it to check subject
and from
.
Upvotes: 1