[imapfilter-devel] Searches only return first matching result? (v2.2.2)
Jesse Connell
jesse08 at gmail.com
Wed Jan 19 03:51:03 EET 2011
Haha, I just thought I'd found an odd workaround-- glad that did the
trick, though. I've been very happy with how imapfilter's been doing
on GMail already, and having it available to do some serious filtering
on an Exchange mailbox also takes a load of drudgery off my shoulders
(and I can't imagine I'm the only one who would find this useful).
So, thanks for the program :)
2011/1/15 Lefteris Chatzimparmpas <lefcha at hellug.gr>:
> Hello,
>
> Great work! You found the bug! :-)
>
> You're right, that line (response.c:550) shouldn't be there at all, since
> the pointer is incremented for the space in the previous line.
>
> Thanks for reporting this and debugging it, too!
>
> L.
>
> On 01/14/2011 04:50 PM, Jesse Connell wrote:
>> Hi again,
>>
>> Thanks! Here's a resulting debug file, using the config text below.
>>
>> account = IMAP {
>> server = 'localhost',
>> port = 1143,
>> username = 'jesse08'
>> }
>> account.INBOX:check_status()
>> test = account.INBOX:select_all()
>>
>> I also tried investigating this a bit myself, and particularly looked at
>> the string manipulation in response_search(). It looked to me like when
>> the pointer "m" gets incremented by a space's worth (line 550-ish?) it
>> skips over the NULL character in the buffer instead of positioning it
>> right at that spot. Printing a fixed-size chunk of the messages buffer
>> in hex showed a bunch of message numbers separated by both NULL and
>> space-- and commenting out that m += strlen(" "); line trims out the
>> inner NULLs and actually made it work! (And what really confuses me is
>> that this modified version still worked for my GMail account, rather
>> than segfaulting or doing something awful.)
>>
>> I'd give you a concrete example, but I hadn't saved my work from before
>> and I can't seem to replicate it (strings and pointers in C are not my
>> strong point), and on top of that my Exchange account is apparently
>> broken. I'll see if I can get it again when things are working, though.
>> Thanks very much for your help on this.
>>
>> Jesse
>>
>> On 01/08/2011 12:01 PM, Lefteris Chatzimparmpas wrote:
>>> Hello,
>>>
>>> Can you apply the attached patch against 2.2.2 and reproduce the problem
>>> while running with the -d option. For example here are some
>>> instructions, without the need to install:
>>>
>>> $ tar zxf imapfilter-2.2.2.tar.gz
>>> $ cd imapfilter-2.2.2
>>> $ patch< ~/debug-search.diff
>>> $ make SHAREDIR=.
>>> $ ./imapfilter -d
>>>
>>> Thank you!
>>>
>>>
>>> On 12/20/2010 05:45 PM, Jesse Connell wrote:
>>>> On 12/20/2010 09:42 AM, Jesse Connell wrote:
>>>>> Hi there,
>>>>>
>>>>> I've compiled and installed imapfilter 2.2.2 and I'm trying to run some
>>>>> filters on my Microsoft Exchange account at work through davmail
>>>>> gateway
>>>>> -- http://davmail.sourceforge.net/ . I'm basically connecting to an
>>>>> IMAP
>>>>> server running locally, which converts the requests to Microsoft
>>>>> moon-speak on the fly and then delivers the results.
>>>>>
>>>>> Most things work fine, but whenever I try any sort of search function
>>>>> (like select_all, contain_subject, etc.) it only seems to return the
>>>>> first message it finds that matches the criteria. Here's my testing
>>>>> config.lua and the output I actually see:
>>>>>
>>>>>
>>>>> account = IMAP {
>>>>> server = 'localhost',
>>>>> username = 'jesse08',
>>>>> port = 1143
>>>>> }
>>>>> account.INBOX:check_status()
>>>>> test = account.INBOX:select_all()
>>>>> print('messages in INBOX:')
>>>>> for _, message in ipairs(test) do
>>>>> mailbox, uid = unpack(message)
>>>>> print(mailbox[uid]:fetch_field('Subject:'))
>>>>> end
>>>>>
>>>>>
>>>>> Enter password for jesse08 at localhost:
>>>>> 235 messages, 235 recent, 0 unseen, in jesse08 at localhost/INBOX.
>>>>> messages in INBOX:
>>>>> Subject: Tuition Exchange Program Notification for 2011-2012
>>>>>
>>>>>
>>>>> I can't quite tell if it's imapfilter, davmail, or my own inexperience
>>>>> with lua that's to blame. In davmail's defense, its running log shows
>>>>> all messages in the INBOX being listed, and then a request for the
>>>>> subject field of that single message. Any ideas? Thanks,
>>>>>
>>>>> Jesse
More information about the Imapfilter-devel
mailing list