[imapfilter-devel] Conditional Actions in config.lua
Lefteris Chatzimparmpas
lefcha at hellug.gr
Sat Apr 17 19:07:17 EEST 2010
On 04/17/2010 04:26 PM, Paul wrote:
> Yes, I did this and nothing was returned - as confirmed by Cyrille -
> the Set.* functions don't return a variable.
Yes, you're right, I tried that with the old copy_messages that worked a
bit different, that one returned a boolean.
The new functions could be made to return something, I guess the best
would be to return true when all the copying was successful. See the
new copy_messages() copies messages from different accounts into a
specific mailbox, and thus some of those messages might get copied fine,
but some of the servers that have those messages might fail for some
reason.
You could change the set.lua like this:
function Set.copy_messages(self, dest)
_check_required(dest, 'table')
return r = true
for mbox in pairs(_extract_mailboxes(self)) do
if not mbox.copy_messages(mbox, dest, self) then r = false end
end
return r
end
Or count successful and unsuccessful copies from different source
mailboxes, etc. but in your case this isn't necessary since you have
only one.
I guess I should add something like this to the next release...
More information about the Imapfilter-devel
mailing list