Closed Bug 179958 Opened 22 years ago Closed 22 years ago

"Run now" button on mail filter window fails with IMAP error

Categories

(MailNews Core :: Filters, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jonathan.courtney, Assigned: cavin)

Details

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.3a) Gecko/20021112
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.3a) Gecko/20021112

Selecting "run now' on the mail filter window for any given filter fails with
the following IMAP error:

---
The current command did not succeed.  The mail server responded: SELECT failed:
/home/courtney/.netscape/imap_mail (file /home/courtney/.netscape/Imap_mail/) is
not in valid mailbox format.
---

  This seeems to be a regression.



Reproducible: Always

Steps to Reproduce:
1. Tools -> Message filters
2. Select a filter
3. Press "run now"


Actual Results:  
IMAP error described above appears on pop-up window.


This error occurs whether or not there are messages that match the filter in the
selected mail box.
Confirmed using FizzillaCFM/2002110808 on 10.1.5.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirmed with build 2002111408 and Cyrus IMAP server.

Actual error received is:

The current command did not succeed.  The mail server responded: Mailbox does
not exist
The problem is that in runSelectedFilters() (FilterListDialog.js) the following 
statement is not getting the right folder uri:

var folderURI = gRunFiltersFolderPicker.getAttribute("uri");

If your account is set up as user 'qatest20' at host 'nsmail-2' the uri is like:

  imap://qatest20@nsmail-2

Since this is not the folder the selected filter is targeted for everything is 
wrong from there on. We should be using the folder defined for the filter.
> We should be using the folder defined for the filter.
>
Actually we should be using the folder currently selected in the folder pane 
(ie, something like "imap://qatest20@nsmail-2/INBOX").

For the sake of testing I manually changed:

  var resource = gRDF.GetResource(folderURI);
to
  var resource = gRDF.GetResource("imap://qatest20@nsmail-2/INBOX");

and it ran fine.
Attached patch Proposed patch, v1 (obsolete) — Splinter Review
In runSelectedFilters(), use the currently selected folder uri and return if
it's a server folder (ie, does not contain any msgs).
Because the filter dialog is not modal, it's possible that the selected folder 
is changed (ie, from INBOX to Status folder for example) and the filters are 
then applied to the newly selected folder. In this case the above patch will not 
work right because the selected folder will stay the same due to the fact that 
'args[0]' is not changed/refreshed when a new folder is selected/opened (ie, 
filtering is performed off the previously selected folder, not the new one).

I have not yet figured out a way to get the selected folder uri on the fly.
Attached patch Proposed patch, v2 (obsolete) — Splinter Review
Latest one.
Attachment #110419 - Attachment is obsolete: true
Attachment #110523 - Flags: superreview?(sspitzer)
I don't think this is the right fix.

It looks like the problem is that if you have a server selected in the folder
pane, we are selecting the server (instead of the inbox) in target folder picker
in the filters dialog.

(I just tested, and we do the this for news, pop and imap servers).

We should fix it so that if we don't have a folder to select, we should select
the inbox on the selected account, and if no inbox (like with news), we should
select the first folder (in the case of news, this will be the first newsgroup).

in addition, we should fix it so that the run now button is disabled if a server
(and not a folder) is selected.  but that will be an infrequent edge case once
we implement the fix I suggest, and we should spin it off to a new bug.

re-assigning to cavin.
Assignee: naving → cavin
note, you can't manually select a server in the target folder picker.

we've had (or still have) other instances of this "server selected in folder
pane causes server to be selected in a folder only picker" problem.

we deal with it by automatically selecting a folder, usually the inbox.
Comment on attachment 110523 [details] [diff] [review]
Proposed patch, v2

not the right fix.
Attachment #110523 - Flags: superreview?(sspitzer) → superreview-
Seth pointed me to the filter folder picker dropdown list that I totally missed
earlier. This is a better patch.
Attachment #110523 - Attachment is obsolete: true
Attachment #110913 - Flags: superreview?(sspitzer)
Comment on attachment 110913 [details] [diff] [review]
Proposed patch, v3

sorry for the delay, cavin

r/sr=sspitzer
Attachment #110913 - Flags: superreview?(sspitzer) → superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: laurel → esther
Using trunk build 20030418 on winxp, macosx and linux this is fixed.  Verified. 
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: