[imp] ingo (imp) filter question

Jeff Tucker jeff at jltnet.com
Fri Dec 5 21:32:46 PST 2003


--On Thursday, December 04, 2003 2:19 PM -0700 Michael M Slusarz 
<slusarz at bigworm.colorado.edu> wrote:

>
> I've implemented this in IMP.  Two problems I still have with allowing
> filters on other mailboxes:
>
> 1. Strange/unwanted behavior of messages that have been delivered to a
> mailbox and never been processed through a filter before.  See my comments
> in the help file.

Michael,

In imp/mailbox.php, can I suggest the following patch which changes the 
logic of what you wrote.

Basically, my patch moves the "filter_on_display" functionality back to the 
inbox only. Other folders are allowed to be filtered, but they must be 
manually filtered.

As you noted, your patch has a problem when filtering in folders into which 
messages were filtered. Basically, they get filtered to that same folder 
again. With "filter_on_display", just entering the folder makes the filters 
run and you see all the same messages being filtered to that folder again.

With my patch, a user can have their Inbox automatically filter messages 
into folders. However, if some external process is delivering messages to a 
folder, then they can enter that folder and manually run their filters. If 
they enter a folder which is the target of Imp filters and manually run 
their filters, they may see messages filtered from that folder back into 
that folder. I guess the answer there is "don't do that".

Jeff

--- mailbox.php.orig    Fri Dec  5 23:55:58 2003
+++ mailbox.php Sat Dec  6 00:23:34 2003
@@ -305,12 +305,13 @@
 $search_mbox = ($imp['mailbox'] == IMP_SEARCH_MBOX);

 /* Deal with filter options. */
-if ($imp['filteravail'] &&
-    (($imp['mailbox'] == 'INBOX') ||
-     ($prefs->getValue('filter_any_mailbox') && !$search_mbox))) {
-    if ($prefs->getValue('filter_on_display')) {
+if ($imp['filteravail']) {
+    if (($imp['mailbox'] == 'INBOX') &&
+        ($prefs->getValue('filter_on_display'))) {
         $do_filter = true;
-    } else {
+    }
+    elseif (($imp['mailbox'] == 'INBOX') ||
+             ($prefs->getValue('filter_any_mailbox') && !$search_mbox)) {
         $filter_url = Util::addParameter($mailbox_url, 'actionID', 
'filter');
     }
 }




More information about the imp mailing list