[imapfilter-devel] imapfilter 2.2 broke this LUA function, help?
Rob Austein
sra at hactrn.net
Sun Jun 6 19:47:55 EEST 2010
At Sun, 06 Jun 2010 11:23:11 +0200, Lefteris Chatzimparmpas wrote:
>
> Try with something like this:
>
> function archive(days, mailboxes)
> for _, mailbox in ipairs(mailboxes) do
> results = myserver[mailbox]:is_older(days) *
> myserver[mailbox]:is_seen() *
> myserver[mailbox]:is_unflagged()
> for _, message in ipairs(results) do
> mbox, uid = unpack(message)
> date = mbox[uid]:fetch_date()
> _, _, m, y = string.find(date, "%d+-(%a+)-(%d+)")
> target = mailbox .. "." .. y .. "." .. month[m]
> Set{message}:copy_messages(myserver[target])
> end
> end
> end
That does the basic job, although it misses the old version's batching
behavior (collecting all the messages to be moved into a particular
target mailbox and processing them all with a single move_messages()
command). But it's enough of a hint that I can probably work out the
rest for myself. Thanks!
More information about the Imapfilter-devel
mailing list