[imapfilter-devel] Problem with has_flag() on Exchange 2010 IMAP server

Bernd Kuemmerlen bkuemmer at gmx.net
Wed Jan 12 14:49:06 EET 2011


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


More information about the Imapfilter-devel mailing list