[imapfilter-devel] bad argument #1 to `getn'
Lefteris Chatzibarbas
lefcha at hellug.gr
Wed Apr 7 01:24:25 EEST 2004
On Thu, May 06, 2004 at 06:46:14AM +1000, Gautam Gopalakrishnan wrote:
> On Wed, May 05, 2004 at 06:26:21PM +0300, Lefteris Chatzibarbas wrote:
> > On Wed, May 05, 2004 at 10:55:59PM +1000, Gautam Gopalakrishnan wrote:
> > > hello,
> > > results = match(acc1, 'INBOX', all)
> > > move(acc1, 'INBOX', results, acc1, 'all')
> > ^^^^^^^
> > Try this:
> >
> > move(acc1, 'INBOX', acc1, 'all', results)
> >
> >
> > As I have stated in my previous mail:
> >
> > Changed argument order on some functions (copy(), move(), flag(),
> > fetchheaders()) so you should check and correct your 1.0-beta configuration
> > file (probably last change to the config file until 1.0).
> >
> > So the "messages" table always goes to the end of the command, thus it is more
> > consistent this way. Sorry for the confusion/inconvenience.
>
>
> Hmm, I copied this straight off the sample.config.lua from the rc1
> distro. Thanks.
Forgot to change those, too. I will correct it.
> Anyway, a suggestion. Since I have already run 'match' on acc1-inbox and
> the list of messages is in 'results', why do I need to specify acc1-inbox
> again when running 'move'? I could write a wrapper for myself, but I
> guess it is bad semantics.
>
> results = match(acc1, 'INBOX', all)
> move(results, acc1, 'all')
>
> would make more sense, I feel.
Because this way it does things behind your back; it guesses that you want
to move messages from the last match() command, but I could have done:
res1 = match(a, 'INBOX', all)
res2 = match(a, 'foo', all)
move(res1, a, 'bar')
move(res2, a, 'bar')
And it would move the messages in res1 from 'foo' to 'bar', and then the
messages in res2 from 'foo' to 'bar', but I actually did't want that.
As you suggest you can override this with a wrapper using Lua.
More information about the Imapfilter-devel
mailing list