Discussion:
[imapfilter-devel] function question
John Webster
2011-05-25 16:38:55 UTC
Permalink
I'm trying to define the following function:

badCharsets = function (mailbox)
local result1 = mailbox:contain_field('Content-Type', 'koi8-r') +
mailbox:contain_field('Content-Type', 'iso-8859-9') +
mailbox:contain_field('Content-Type', 'windows-1254') +
mailbox:contain_field('Content-Type', '-=SPLIT') +
mailbox:contain_subject('=%?utf-8%?Q%?') +
mailbox:contain_subject('=%?iso-8859-9%?') +
mailbox:contain_from('=%?iso-8859-9%?')
local result2 = mailbox:is_undeleted()
return result1 * result2
end


However I'm getting the following error:

attempt to index local 'mailbox' (a nil value)


Can someone tell me why?

Thanks.

jw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/imapfilter-devel/attachments/20110525/30f1896d/attachment.pgp>
John Webster
2011-05-26 21:16:35 UTC
Permalink
Please disregard. :-} I found my mistake.
I forgot the IMAP in the account statement.
Everything is working fine now.


jw
Post by John Webster
badCharsets = function (mailbox)
local result1 = mailbox:contain_field('Content-Type', 'koi8-r') +
mailbox:contain_field('Content-Type', 'iso-8859-9') +
mailbox:contain_field('Content-Type', 'windows-1254') +
mailbox:contain_field('Content-Type', '-=SPLIT') +
mailbox:contain_subject('=%?utf-8%?Q%?') +
mailbox:contain_subject('=%?iso-8859-9%?') +
mailbox:contain_from('=%?iso-8859-9%?')
local result2 = mailbox:is_undeleted()
return result1 * result2
end
attempt to index local 'mailbox' (a nil value)
Can someone tell me why?
Thanks.
jw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/imapfilter-devel/attachments/20110526/6af3cee0/attachment.pgp>
Loading...