[imapfilter-devel] IMAPFilter 1.0-beta - still not matching on multiple filter rules :(
Lefteris Chatzibarbas
lefcha at hellug.gr
Fri Apr 30 02:46:34 EEST 2004
On Mon, Apr 26, 2004 at 11:46:50AM -0500, Steven T Zydek wrote:
> Hello,
>
> I figured I'd wait until the new version came out to play with this again.
> I tried setting up multiple filter rules by setting up the following 'users'
> filter:
>
> users = {
> invert = true,
> 'from "user1@"',
> 'from "user2@"',
> 'from "user3@"',
> 'from "user4@"',
> 'from "user5@"',
> }
>
> When I run with this, it matches NONE of my email messages (Exchange IMAP),
> even though I have numerous messages from all the users specified.
>
> When I run it in verbose mode, I see:
>
>
> C: 3: 1008 SEARCH ALL OR OR OR OR (from "user1@") (from "user2@") (from "user3@") (from "user4@") (from "user5@")
> S: 3: 1008 OK SEARCH completed.
>
>
> -- No matches made :(
>
> When I change the config to:
>
> users = {
> invert = true,
> 'from "user1@"',
> 'from "user2@"',
> -- 'from "user3@"',
> -- 'from "user4@"',
> -- 'from "user5@"',
> }
>
>
> It matches on messages from user1 & user2, as expected. Yay!!
>
> Again, anything more than 2 (i.e., 3, 4, 5, etc..) 'from' filter rules and it
> does NOT match anything... Do you think this an issue with my server? Or am
> I just not setting something up right? When I setup 'from' filters for single
> rules, I have no problems. It's only when I try to combine 3 or more.
I believe this is a problem with your server, and because we have a "Microsoft
Exchange Server 2003 IMAP4rev1 server version 6.5.6944.0" at work and it
doesn't seem to have this problem, I would suggest contacting your
administrator and ask him if he has limited the IMAP SEARCH functionality of
your mail server in some way.
With imapfilter 1.0 (beta) you could download the "From" header from all
messages and check them locally, with something like:
results = match(myaccount, 'mymailbox', {})
headers = fetchheaders(myaccount, 'mymailbox', results, { 'from' })
results = {}
for message, from in pairs(headers) do
if (string.find(from, "user1@") or
string.find(from, "user2@") or
string.find(from, "user3@") or
string.find(from, "user4@") or
string.find(from, "user5@")) then
table.insert(results, message)
end
end
delete(mymailbox, 'mymailbox', results)
Of course, the method of sending the query to the server is probably more
efficient...
More information about the Imapfilter-devel
mailing list