[imapfilter-devel] Problem with has_flag() on Exchange 2010 IMAP server
Lefteris Chatzimparmpas
lefcha at hellug.gr
Thu Jan 13 20:18:28 EET 2011
Hello,
Can you try like this?
results = account2.Test:is_flagged()
On 01/12/2011 01:49 PM, Bernd Kuemmerlen wrote:
> Hello all,
>
> I have some issues with flags on an Exchange 2010 IMAP server.
>
> I am trying to get all messages with a specific flag, and according to
> the documentation this should work like this:
>
> results = account2.Test:has_flag('\\Flagged')
>
> This results in the following debug output
> ----------------------------------------------------------
> 100C SELECT "Test"
>
> getting response (4):
>
> * 3 EXISTS
> * 0 RECENT
> * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
> * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft
> $MDNSent)] Perman
> ent flags
> * OK [UIDVALIDITY 1267] UIDVALIDITY value
> * OK [UIDNEXT 23] The next unique identifier value
> 100C OK [READ-WRITE] SELECT completed.
>
> sending command (4):
>
> 100D UID SEARCH ALL KEYWORD "\Flagged"
>
> getting response (4):
>
> 100D BAD Command Argument Error. 11
> ----------------------------------------------------------
>
> Of the three messages in the mailbox, one has \Flagged set, which I can
> confirm with
>
> results = account2.Test:has_flag('\\Flagged')
> for _, mesg in ipairs(results) do
> mbox, uid = unpack(mesg)
> flags = mbox[uid]:fetch_flags()
> for k,v in pairs(flags) do print(k,v) end
> end
>
> Does anyone have an idea why has_flag() fails?
>
> Getting all messages and filtering afterwards for the flag is what I'd
> like to prevent...
>
> Any ideas?
>
> Thanks in advance,
> Bernd
> _______________________________________________
> Imapfilter-devel mailing list
> Imapfilter-devel at lists.hellug.gr
> http://lists.hellug.gr/mailman/listinfo/imapfilter-devel
More information about the Imapfilter-devel
mailing list