junk status not shown for courier imap servers



15 years ago
10 years ago


(Reporter: mscott, Assigned: Bienvenu)


Windows XP

Firefox Tracking Flags

(Not tracked)



(2 attachments)



15 years ago
from an aim conversation with david:

if we are talking to a server that does not support custom flags (like courier),
 could we easily fall back & store junk flag status in the summary file?

David's answer on how we would do this:
 in the destination db, record enough information about the msg hdrs that got
moved into it so that when we download the new headers, we'd recognize them as
messages that need to have the flags set.  if you switch machines, it'll fall
down...but it would work OK for most users. 

it should be easy enough to only do this when the server doesn't support user
defined keywords. We could probably just hash the headers and store the date
header and use those two to match

Comment 1

15 years ago
there is an other possibility - if the imap server supports COPYUID, then we
*will* know what the destination uids will be. Scott, if you generate a protocol
log of copying messages between two imap folders on your server, does the copy
response look like this?

5 OK [COPYUID 1055340261 121:124 16:19] Completed

or does it just say 

5 OK completed?

Comment 2

15 years ago
taking - I'm going to try to do this this weekend.
Assignee: scott → bienvenu

Comment 3

15 years ago
Created attachment 130416 [details] [diff] [review]
work in progress

this cleans up some unused methods in the msg db code and starts work on a
method for adding pending hdr info to imap db's. Remaining work is to actually
set the properties in the db, to play back the changes when a matching hdr is
added, and to hook up this call in the imap code.

Comment 4

15 years ago
I have the db code done; I just need to figure out where to hook it up in the
imap code. Currently, the db code I've written only sets one custom property;
that's probably sufficient for junk mail (we'd set the junk score) but it's not
very general. Perhaps the thing to do is, in
nsImapMailFolder::OnMessageClassified, if the destination is an imap folder, add
a pending hdr to the dest folder. Unfortunately, we don't know at this point if
the folder/server does support custom keywords because that information is only
stored in the protocol object. We probably should store this kind of information
in the imap folder object and/or the db.

Comment 5

15 years ago
FYI: the latest versiona of courier-imap (2.1+) DO support the IMAP keyword
extension . . .

Comment 6

15 years ago
Created attachment 131564 [details] [diff] [review]
proposed fix

oy gevalt, that was a little tricky. But it seems to work now. I made the db
functionality fairly general, so you can set an arbitrary number of extra
properties on pending headers, and those will be restored when the hdr is


15 years ago
Attachment #131564 - Flags: superreview?(scott)

Comment 7

15 years ago
Comment on attachment 131564 [details] [diff] [review]
proposed fix

I take it:
 nsIMdbRow *row = msgHdr->GetMDBRow();

GetMDRow does not addref the returned result.

2) small spacing issue here:
+  attribute unsigned long supportedUserFlags;
Attachment #131564 - Flags: superreview?(scott) → superreview+

Comment 8

15 years ago
thx, no, GetMDBRow() definitely doesn't do an AddRef :-)

I've cleaned up the pre-existing tabs in that file.

Comment 9

15 years ago
fix checked in - and Scott says it works for him...
Last Resolved: 15 years ago
Resolution: --- → FIXED


15 years ago
Blocks: 219336
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.