[imapfilter-devel] move/copy problem

Lefteris Chatzimparmpas lefcha at hellug.gr
Tue Jul 6 18:59:18 EEST 2010


On 07/01/2010 09:55 PM, Michael M. Tung wrote:
> Hi all,
>
> I found a work around to my previous problem, which nevertheless I still don't
> understand since the copy_messages command in the old script erroneously reports
> that files are copied.

See my other mail; we might find out something from that.  See also below my
further comments...

>
> Now I am using the following code
>
> ------------------------------------------------------------------------
>
> all = myserver.INBOX:select_all()
> spam = Set {}
> unsure = Set {}
>    for _, mesg in ipairs(all) do
> 	mbox, uid = unpack(mesg)
> 	text = mbox[uid]:fetch_message()
> 	flag = pipe_to('bogofilter', text)
> 	if (flag == 0) then
> 	  table.insert(spam, mesg)
>          elseif (flag == 2) then
>            table.insert(unsure, mesg)
>          end
>    end
>
> myserver['INBOX']:move_messages(myserver['Junk'], spam)
> myserver['INBOX']:copy_messages(myserver['Junk/Unsure'], unsure)

These two lines should/could be:

spam:move_messages(myserver['Junk'])
unsure:copy_messages(myserver['Junk/Unsure'])

>
> ------------------------------------------------------------------------
>
> However, I am running exactly this same config on two different machines
> (with identical versions IMAPFilter 2.2.2, bogofilter v1.2.1 and
> Oracle Berkeley db 4.7.25). On one machine it works as expected and the
> other machine gives the error:
>
> imapfilter: bogotest5.lua:26: required argument left out

Hm, this is strange...

>
> Line 26 is the line containing "flag = pipe_to('bogofilter', text)".
> What is going wrong here???

Maybe you can print the print(text) variable before passing it to bogofilter...

>
> Any hint to solve this mystery is appreciated.
> Best,
>        Mike


More information about the Imapfilter-devel mailing list