[imapfilter-devel] Re: Re: can't solve "table expected, got nil"

Joel CARNAT joel at carnat.net
Mon Aug 16 10:19:26 EEST 2004


On Fri, Aug 13 2004 - 14:09, David DeSimone wrote:
> Joel CARNAT <joel at carnat.net> wrote:
> >
> > imapfilter: /home/jcarnat/.imapfilter/config.lua:105: table expected, got nil
> > I just can't get what this means.
> 
> The match() routine returns nil when there are no results found.  You
> will want to check for this case before passing the results to another
> function.
> 
> > results = match(admin, 'INBOX', nagios)
> > move(admin, 'INBOX', admin, 'nagios', results)
> 
> You should rewrite it like this:
> 
>     results = match(admin, 'INBOX', nagios)
> 
>     if (results ~= nil)
>     then
> 	move(admin, 'INBOX', admin, 'nagios', results)
>     end
> 

OK, thanks that worked !
but that leads to 2 more questions... :p

How comes this is not the default behaviour ?
I mean, isn't possible to tell imapfilter to not execute ACTION if
RESULTS is nil ? I have about 20 rules and wouldn't like to have to add
the whole if,then,end for each :)

Then... now the whole filtering process goes one well, but...
my MATCH doesn't seem to work on the account where NIL is returned.
That's really strange as both are IMAP boxes on the same server and
notification (from Nagios) are formatted the same way... I thought
something might be due the INBOX itself... I checked it with mutt and
sylpheed and the INBOX seems correct (I can read & modify it)... I also
tried to change the case of the regexp (Nagios to nagios) and it still
only works on one of the account... any idea what to check else ?

TIA,
	Jo




More information about the Imapfilter-devel mailing list