[imapfilter-devel] filters for archiving mail
Philippe LeCavalier
support at plecavalier.com
Sun Jan 23 22:07:13 EET 2011
This may seem ridiculously easy once I have the answer but ever since I
stumbled upon this project over a month ago I've been trying to create a
simple rule to archive my mail. Here's what I've come up with -which
doesn't work- Ideally, I'd like to build upon that so I don't have to
revist it ie have a function that substracts 1 from the current year and
performs the archive. Even better would be to create the folders in the
archive to replicate the tree :-) Anyway.
55 --ARCHIVING
56 --Pre-2009
57 --[[
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'])
69 --]]
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?
ii) if i) then how can I exclude the 'rec' and 'archive' folders?
Thanks for any advice.
Phil
More information about the Imapfilter-devel
mailing list