<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] IMAP old message status on read-only folders



On Friday, 20 January 2006 at 16:25, Phil Pennock wrote:
> If Cyrus (at least) does not grant the connecting user the "w" (write)
> permission, then mutt can't store "old".  The standard "read"
> permissions are "lrs", where the "s" lets the \Seen flag be set.
> 
> The new parse code broke mutt's ability to show unseen non-recent mails
> as "O", instead always showing them as "N".

This code was rewritten because the recent flag tends to disappear a
lot (if you use multiple clients, including biffs). You get a lot of
messages marked O that should be N. Now you lose the O flag if you
can't write to the mailbox, but I believe this is how other mailbox
formats work too.

> Also, a cut&paste error meant that the parsing was going wrong because
> the current offset was not being offset sufficiently on the \Recent
> flag, only going up by 5 chars instead of 7.

I've patched this just now, thanks, but it was pretty harmless. The
offset was being increased correctly, it was just the strncmp that was
wrong. This would only matter if there were another flag starting with
\Rece.

> I'm not quite sure how, but this seems to have affected mutt's
> visibility of the \* flag, so mutt didn't think that it could write the
> "old" flag if it didn't already exist, so mutt would refuse to flag
> mails as old.  I can't see why this should have been the case though,
> since mutt should just have seen a flag called "nt" and one called "\*"
> (assuming no other flags between \Recent and \*).  My diagnosis of why
> mutt wasn't writing out old might be wrong here.

this doesn't seem likely. imap_has_flag might be a good place to
look. It must have worked when I first did the new Old code, because
that's how I got Old into my permanentflags to begin with...

> Attached is (for sure, thanks to the Attach: pseudo-header (Yaay!)) a
> patch which, if "old" is _NOT_ present in the flags, will include unseen
> non-recent mails as "old", despite the lack of the old.

this takes us back to mutt's old behaviour, which was too vulnerable
to the whims of the recent flag. I like the current behaviour better.

> If it's acceptable to flag all unseen non-recent mails as "old",
> regardless of mutt's own flag, then the patch could be made simpler
> and less intrusive code-wise, but I opted for less intrusive semantics.

for the same reason I am not in favour of this approach.

I'm a little confused about why you don't have write access to your
folders, but I think mutt's "old" response is now basically the same
for IMAP and mbox.