<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Got it. Works like a charm!<BR>
<BR>
What about if I reply from my own account by mistake(common occurrence) and want to filter mail from my own INBOX.Sent folder to their respected folders, can I...<BR>
<BR>
for _, account1 do <BR>
account1.Sent:contain_subject('[OPEN]') *<BR>
account1.Sent:contain_to('domain2.ca'):move_messages(account2['Open']) <BR>
account1.Sent:contain_subject('[OPEN]') *<BR>
account1.Sent:contain_to('domain3.ca'):move_messages(account3['Open']) <BR>
end<BR>
<BR>
That's prob. all wrong but I think you can see the idea?<BR>
<BR>
Phil<BR>
On Sat, 2011-01-08 at 19:46 +0100, Lefteris Chatzimparmpas wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hello,
You don't need the '+', just like this:
for _, account in ipairs({ account1, account2 }) do
account.INBOX:contain_subject('[OPEN]'):move_messages(account['help/Open'])
account.INBOX:contain_subject('[CLOSED]'):move_messages(account['help/Closed'])
end
The '+' (OR operator) is needed when you want to combine different
search results, in order then to apply a single action to all them at
once.
On 01/08/2011 07:17 PM, Philippe LeCavalier wrote:
> Hi again.
>
> Sorry to bug you. I'm asking this on the list just in case other lua
> illiterates may benefit from this...
>
> If I want to encompass more subjects and move them to more mailboxes,
> can I do
>
> for _, account in ipairs({ account1, account2 }) do
> account.INBOX:contain_subject('[OPEN]'):move_messages(account['help/Open']) +
> account.INBOX:contain_subject('[CLOSED]'):move_messages(account['help/Closed'])
> end
>
> Is '+' the still the correct syntax to indicate to offlineimap the
> operand 'OR'?
>
> Thanks,
> Phil
>
> On Sat, 2011-01-08 at 10:34 -0600, Philippe LeCavalier wrote:
>
>> Quoting Lefteris Chatzimparmpas <<A HREF="mailto:lefcha@hellug.gr">lefcha@hellug.gr</A>>:
>>
>>> Yes, that's correct, you got that right. For each account it will move
>>> messages from its INBOX to its "help/Open" folder.
>>
>> Perfect!
>>
>> Thanks,
>> Phil
>>>
>>>
>>> On 01/08/2011 04:45 PM, Philippe LeCavalier wrote:
>>>> Thanks. That's much cleaner. I have one question though...
>>>> Quoting Lefteris Chatzimparmpas <<A HREF="mailto:lefcha@hellug.gr">lefcha@hellug.gr</A>>:
>>>>
>>>>> Hello,
>>>>>
>>>>> You can make use of Lua to accomplish this. For example one way could
>>>>> be:
>>>>>
>>>>> for _, account in ipairs({ account1, account2 }) do
>>>>>
>>>>> account.INBOX:contain_subject('[OPEN]'):move_messages(account['help/Open'])
>>>>>
>>>>> end
>>>> Can I assume that I'm reading this correctly in that mail for/from
>>>> account1 will stay in account1 ie it won't move a msg with subject OPEN
>>>> from account1.INBOX to account2.INBOX.help.Open right?
>>>>
>>>> Pardon my ignorance, I really don't know any form of programming language.
>>>>
>>>> Thanks,
>>>> Phil
>>>>>
>>>>> You can add more accounts or even write a nice Lua function, and so on.
>>>>>
>>>>>
>>>>> On 01/07/2011 07:49 PM, Philippe LeCavalier wrote:
>>>>>> I have 3 IMAP accounts. I'm wondering if I can merge identical filters?
>>>>>> ie.
>>>>>>
>>>>>> --Move Open
>>>>>> results = account1.INBOX:contain_subject('[OPEN]')
>>>>>> results:move_messages(account1['help/Open'])
>>>>>> results = account2.INBOX:contain_subject('[OPEN]')
>>>>>> results:move_messages(account2['help/Open'])
>>>>>>
>>>>>> with something like:
>>>>>>
>>>>>> --Move Open
>>>>>> results = account{1|2}.INBOX:contain_subject('[OPEN]')
>>>>>> results:move_messages(account{1|2}1['help/Open'])
>>>>>>
>>>>>> I know the above syntax is incorrect; it's just for illustration
>>>>>> purposes.
>>>>>>
>>>>>> Any thoughts?
>>>>>>
>>>>>> Phil
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Imapfilter-devel mailing list
>>>>>> <A HREF="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</A>
>>>>>> <A HREF="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</A>
>>>>>
>>>>
>>> _______________________________________________
>>> Imapfilter-devel mailing list
>>> <A HREF="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</A>
>>> <A HREF="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</A>
>>
>>
>> _______________________________________________
>> Imapfilter-devel mailing list
>> <A HREF="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</A>
>> <A HREF="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</A>
>
>
>
> _______________________________________________
> Imapfilter-devel mailing list
> <A HREF="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</A>
> <A HREF="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</A>
_______________________________________________
Imapfilter-devel mailing list
<A HREF="mailto:Imapfilter-devel@lists.hellug.gr">Imapfilter-devel@lists.hellug.gr</A>
<A HREF="http://lists.hellug.gr/mailman/listinfo/imapfilter-devel">http://lists.hellug.gr/mailman/listinfo/imapfilter-devel</A>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>