[imapfilter-devel] Conditional Actions in config.lua
Paul
imapfilter at airbred.com
Sat Apr 17 17:26:57 EEST 2010
On 17/04/2010 11:56 PM, Lefteris Chatzimparmpas wrote:
> On 04/16/2010 01:32 AM, Paul wrote:
>> Something like this:
>>
>> -- accounts
>>
>> account1 = IMAP { xxx }
>>
>> account2 = IMAP { yyy }
>>
>> results = account1.INBOX:select_all()
>>
>> if results:copy_messages(account2.incoming)
>> results:move_messages(archive)
>> end
>
> The target mailbox of move_messages() should be something like
> account1.archive (I guess this is what you meant).
>
Yes - in words this would be "copy any messages from account1's inbox to
account2's incoming folder and if successful, move the same messages
from account1's inbox to the account1 archive folder".
> I believe copy_messages() returns true or false based on whether the
> IMAP COPY command (or the IMAP APPEND command when copying to a
> different server) was successful. You can check that easily:
>
> ret = results:copy_messages(account2.incoming)
> print(ret)
> if (ret)
> ...
Yes, I did this and nothing was returned - as confirmed by Cyrille - the
Set.* functions don't return a variable.
More information about the Imapfilter-devel
mailing list