[imapfilter-devel] Imapfilter sometimes doesn't filter

David DeSimone fox at verio.net
Sun Jul 25 00:42:55 EEST 2004


I have had some good success with imapfilter, but I still occasionally
see messages not being filtered correctly.  Since it is a very
occasional problem (perhaps once every day or two), I am not keen to
leave debug output turned on forever, especially since the behavior I
see is not repeatable.  I am curious, though, if others see the same.

In my configuration, my incoming mail is delivered to INBOX of course. 
However, I want to have my mail sorted into various folders before I
read it.  That way, messages are prioritized, and I don't have to keep
figuring out which mail is list-mail, and which is for me personally. 
My solution is to have imapfilter take all mail in INBOX, filter it into
various folders, and then put all the remaining unfiltered messages into
another folder called "Default".  I then tell my IMAP mail client to
watch this Default folder instead of INBOX.  That way, I never see
unfiltered mail.

Here's my config:

-- Some details ommitted.

    options.timeout	= 120
    options.uid		= true
    options.starttls	= true

    exists, recent, unseen = check(account, "INBOX")

    if (exists > 0)
    then

-- Filter list-mail to another folder

	query =
	{
	    {
		'header "List-Id" "cnet-admin.verio.net"',
		'header "List-Id" "firewall-support.verio.net"'
	    }
	}

	results = match(account, "INBOX", query)

	if (results ~= nil)
	then
	    move(account, "INBOX", account, "network", results)
	end

-- Move remaining messages into the default mailbox.

	results = match(account, "INBOX", {})

	if (results ~= nil)
	then
	    move(account, "INBOX", account, "Default", results)
	end
    end


This works nearly every time.  However, occasionally a message for
cnet-admin will show up in my Default folder.  If I simply move the
message back to INBOX, the next time imapfilter runs, it will put the
message into the "network" folder where it should have gone.  Since I
don't modify the message, I fail to understand how it missed being
filtered the first time.

-- 
David DeSimone || Network Admin || fox at verio.net
  "It took me fifteen years to discover that I had no
   talent for writing, but I couldn't give it up because
   by that time I was too famous.  -- Robert Benchley




More information about the Imapfilter-devel mailing list