[imapfilter-devel] move/copy problem
Lefteris Chatzimparmpas
lefcha at hellug.gr
Tue Jul 6 18:50:50 EEST 2010
Hello,
Can you run again with the -v option so as to see, if there is something
strange is happening?
On 06/29/2010 03:14 PM, Michael M. Tung wrote:
> Hi everybody,
>
> I am quite desperate in getting an imapfilter script to move and copy my
> mail with a bogofilter pipe. The following code is based from somewhere
> on the web (obviously I don't include the account definitions):
>
> ------------------------------------------------------------------------
> results = mymailserver.INBOX:select_all()
> spam = {}
> unsure = {}
> text = mymailserver.INBOX:fetch_message(results)
> if (text ~= nil ) then
> for msgid, msgtxt in pairs(text) do
> exitstatus = pipe_to('bogofilter', msgtxt)
> if (exitstatus == 0) then
> table.insert(spam, msgid)
> elseif (exitstatus == 2) then
> table.insert(unsure, msgid)
> end
> end
> print( string.format("%d messages in 'INBOX' classified SPAM", table.getn(spam)) )
> print( string.format("%d messages in 'INBOX' classified UNSURE", table.getn(unsure)) )
> mymailserver.INBOX:move_messages(upv['Junk'], spam)
> mymailserver.INBOX:copy_messages(upv['Junk/Unsure'], unsure)
> else
> print( "found no messages in 'INBOX'" )
> end
> ------------------------------------------------------------------------
>
> Running it seems O.K. The output is something like:
>
> 0 messages in 'INBOX' classified SPAM
> 5 messages in 'INBOX' classified UNSURE
> 5 messages copied from user at mymailserver/INBOX to user at mymailserver/Junk/Unsure.
>
> However, nothing actually happens on the IMAP server. I tried this on
> several of my accounts, but without success.
>
> I can't really see what is going on. Can you please help?
>
> Thanx. Best, Mike
>
> _______________________________________________
> Imapfilter-devel mailing list
> Imapfilter-devel at lists.hellug.gr
> http://lists.hellug.gr/mailman/listinfo/imapfilter-devel
More information about the Imapfilter-devel
mailing list