[imapfilter-devel] Error: attempt to index field 'INBOX'
Alejandro Jakubi
jakubi at df.uba.ar
Mon Oct 22 00:10:24 EEST 2007
Lefteris,
> imapfilter. In your case where you want this kind of behaviour for
> keeping deleted messages in some folders, etc. or with logging
> information that you find useful... I would not call this "common
> filtering", and it's cases like these that Lua becomes so useful.
Moving and keeping deleted is a standard option of the two email clients that
I am using at present: Pine and Horde. The logging of actions is comonplace
for applications that run in the background.
> And that's why imapfilter today embeds Lua, because otherwise I would
> have to write a giant program with hundreds of options and operators, in
> order to fit every user's needs...
No, I am not requesting you to add features to imapfilter. I am just landing here,
and, as you may have noted, I do not know exactly yet what is inside imapfilter.
Hence I cannot say for sure what is outside and request for it.
If combining imapfilter with Lua is the way to do some tasks, this is fine
for me. My issue has to do with documentation. If there are so many things
that can be done with imapfilter-Lua, it would be very useful that the
techniques, tricks, etc, that were already developed by the user community
(I do not know how large it is) were more systematically available, eg in
a wiki. In other words, I am not particularly interested in reinventing
the wheel.
> the log file. If you want to log every action you can do it with a hack
> like this; say you want to save the date and some information on what
> happened:
>
> pipe_to('cat >> ~/LOG', os.date() .. ' starting to filter')
> results = match(myaccount, 'INBOX', myfilter)
> move(myaccount, 'INBOX', myaccount, 'spam', results)
> pipe_to('cat >> ~/LOG', os.date() .. ' ' .. #results .. ' moved to spam')
This hack is perfect for me, except for the missing new line. Thank you.
> > Is there a way to query the value of all the options?
>
> Yes, in the man page, in the OPTIONS section, in the description of each
> option, it is specified what the default value for that option is.
No, I have meant a way to query the current value of the options (that might be
different from the default one).
Alejandro
More information about the Imapfilter-devel
mailing list