-- this will flag every message in every dir of the mailbox -- as seen. Used in case of shared folder mailbox to fix -- some bugs around shared folders code. THIS IS QUITE UGLY ! --------------- -- Options -- --------------- options.timeout = 120 options.subscribe = true options.namespace = false ---------------- -- Accounts -- ---------------- account1 = { server = 'localhost', username = 'taibeau', password = 'gamin', ssl = 'ssl2', } myfilter= { 'unseen' } mailboxes = {} function list_all(account, path) mboxes, folders = list(account, path) for _, mbox in ipairs(mboxes) do table.insert(mailboxes, mbox) print(mbox) results = match(account1, mbox, myfilter) flag(account1, mbox, 'add', { 'seen' }, results) end for _, folder in ipairs(folders) do if (folder ~= path .. '/') then list_all(account, folder) end end end function forever() list_all(account1, 'INBOX.') end daemon_mode(30, forever)