[imapfilter-devel] filters for archiving mail

Lefteris Chatzimparmpas lefcha at hellug.gr
Tue Jan 25 21:39:25 EET 2011


On 01/23/2011 09:07 PM, Philippe LeCavalier wrote:
>  58 results = account1.INBOX:arrived_before('01-Jan-2009') -
>  59         (account1['rec'] +
>  60         account1['archives'])
>  61     results:move_messages(account2['archives/pre_2009'])
>  62 
>  63 --2009
>  64 results = account1.INBOX:arrived_since('01-Jan-2009') *
>  65         account1.INBOX:arrived_before('01-Jan-2010') -
>  66         (account1['rec'] +
>  67         account1['archives'])
>  68 results:move_messages(account2['archives/2009'])

You can't include folders in your results like this or combine them with
search functions like arrived_before().  If you want to exclude all mail
in those 2 mailboxes then use select_all().

You're supposed to call specific functions to do searching.  See the
imapfilter_config(5) man page section SEARCHING.

> i) rather than specify each mailbox and subfolder thereof, how can I
> have it look through all mailboxes under INBOX recursively. 'INBOX.*'
> kind of thing?

Have a look at the LISTING section in the man page.

> ii) if i) then how can I exclude the 'rec' and 'archive' folders?

You have to use a some Lua and to string comparisons based on the output
of the listing functions.


More information about the Imapfilter-devel mailing list