[imapfilter-devel] archiving function not working

Lefteris Chatzibarbas lefcha at hellug.gr
Sat Jun 4 12:35:50 EEST 2005


On Fri, Jun 03, 2005 at 09:28:50PM +0200, Joel CARNAT wrote:
> Hi,
> 
> I already done a sorting function that takes mail from INBOX and store
> them is "subdirectory" according to the date. Now I would like to do the
> same with mail already stored in various folders but it doesn't work :(
> 
> [...]
>
> My initial function is :
> function horoMove(account, mbox, filter, destination)
>         results = match(account, mbox, filter)
>         if results ~= nil then
>                 headers = fetchheaders(account, mbox,{ 'date ' }, results)
>                 if headers ~= nil then
>                         for ID, HDR in pairs(headers) do
> _, _, _, _, _, month, year = string.find(HDR, "Date: (%a+),(%s+)(%d+) (%a+) (%d+)")
>                                 if month ~= nil then
> move(account, mbox, account, year .. '.' .. month .. '.' .. destination, results)
>                                 end
>                         end
>                 end
>         end
> end
>
> [...]

Hello

I think I know where the problem is.  Try changing the above move() line to:

  move(account, mbox, account, year .. '.' .. month .. '.' .. destination, ID)

L.




More information about the Imapfilter-devel mailing list