Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 373197 - mutt-1.5.21: handle IMAP (specifically courier-IMAP) properly in sidebar patch
Summary: mutt-1.5.21: handle IMAP (specifically courier-IMAP) properly in sidebar patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
: 368519 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-27 12:41 UTC by Donnie Berkholz (RETIRED)
Modified: 2012-03-15 20:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sidebar-dotted.patch (sidebar-dotted.patch,2.54 KB, text/plain)
2011-06-27 12:41 UTC, Donnie Berkholz (RETIRED)
Details
sidebar-sorted.patch (sidebar-sorted.patch,2.25 KB, patch)
2011-06-27 12:41 UTC, Donnie Berkholz (RETIRED)
Details | Diff
Correct bug in "basename" replacement (file_373197.txt,1.21 KB, text/plain)
2012-03-12 13:00 UTC, Vincent Brillault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Donnie Berkholz (RETIRED) gentoo-dev 2011-06-27 12:41:19 UTC
Created attachment 278331 [details]
sidebar-dotted.patch

Here are two patches to fix bugs in the sidebar patch.

sidebar-dotted.patch will properly indent and remove prefixes for Courier IMAP servers, which split subfolders with '.' rather than '/'.

sidebar-sort.patch will cause IMAP folders to be sorted instead of displaying them in a random (and useless) order.

These patches are from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523774
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2011-06-27 12:41:47 UTC
Created attachment 278333 [details, diff]
sidebar-sorted.patch
Comment 2 Fabian Groffen gentoo-dev 2011-06-27 13:19:46 UTC
do these patches apply on the sidebar patch we have for 1.5.21-r3 (http://prefix.gentooexperimental.org:8000/mutt-patches/file/413f13820028/sidebar.patch)?
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2011-06-27 15:50:18 UTC
It applies clean on top of -r3 using the ebuild in my overlay.
Comment 4 Fabian Groffen gentoo-dev 2011-07-09 08:59:21 UTC
Sorted should not be necessary since the 1.5.20 patch should already have this included.

Is your dotted patch with or without the free() fixes?
Comment 5 Fabian Groffen gentoo-dev 2011-07-09 11:32:21 UTC
*** Bug 368519 has been marked as a duplicate of this bug. ***
Comment 6 Fabian Groffen gentoo-dev 2011-07-09 13:07:24 UTC
fixed in mutt-1.5.21-r4
Comment 7 Thomas Kahle (RETIRED) gentoo-dev 2011-07-13 13:05:17 UTC
Hi, 
it seems to me that the sidebar-dotted.patch is not applied.  

The muttrc manpage shows the option "sidebar_sort", but not "sidebar_shortpath".  Shortening also breaks the display of folders if you don't have them sorted b/c 

A.INBOX
B.INBOX
A.archive
B.archive

gets displayed as 

A
  INBOX
B 
  INBOX
  archive
  archive

Something is wrong.  The problem is present in -r5
Comment 8 Fabian Groffen gentoo-dev 2011-07-14 06:40:16 UTC
I didn't apply the dotted patch because it's broken by design.  Instead I wrote a patch that is a little less broken.

The behaviour you see is the original behaviour of the sidebar patch for "normal" folders (those that have a / as path separator).  Perhaps it makes little to no sense not to sort the list here.  However, as I suspected before, the sidebar patch itself is also of questionable quality.  I'd say the workaround here is to sort your folder list.

Note that the sidebar patch doesn't try to reconstruct a tree or something.  It just replaces leading "directories" by spaces and assumes the tree is built of a properly setup buffy (your mailboxes thing).
Comment 9 Thomas Kahle (RETIRED) gentoo-dev 2011-07-14 08:50:05 UTC
(In reply to comment #8)
> I didn't apply the dotted patch because it's broken by design.  Instead I wrote
> a patch that is a little less broken.
> 
> The behaviour you see is the original behaviour of the sidebar patch for
> "normal" folders (those that have a / as path separator).  Perhaps it makes
> little to no sense not to sort the list here.  However, as I suspected before,
> the sidebar patch itself is also of questionable quality.  I'd say the
> workaround here is to sort your folder list.
> 
> Note that the sidebar patch doesn't try to reconstruct a tree or something.  It
> just replaces leading "directories" by spaces and assumes the tree is built of
> a properly setup buffy (your mailboxes thing).

Maybe there are some unintended consequences of your patch.  I sync my IMAP folders from various accounts to a local maildir.  I use dots to indicate folder separators on the remote server, that is my folder layout on the file system

A
-> a    (this the inbox)
-> a.x  (this is a folder)
-> a.y  

B
-> b
-> b.x
-> b.y

When I sort them like I want them (inboxes first), then -r3 displays them as 

a
b
a.x
a.y
b.x
b.y 

-r5 displays them as 
a
b 
 x
 y
 x
 y

That makes me believe that something is wrong with the patch?
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2011-07-14 13:10:42 UTC
Thomas, you could try also applying the 'sorted' patch in your ebuild and see if it helps.
Comment 11 Fabian Groffen gentoo-dev 2011-07-14 19:12:37 UTC
Tomas,

Yes and no.  It's not per-se my patch, rather than that you use . and now see behaviour that is intended for /.  I'm willing to accept that you perhaps want to control the characters to split on instead of always taking / and ., like imap_delim_chars.  The rest is just implicit to what sidebar does.  It should have done better to build a graph internally and fill in the nodes with numbers if they happen to be watched or something so your example would result in something more expected.
Comment 12 Fabian Groffen gentoo-dev 2011-07-28 19:42:16 UTC
updated patch is here in case you want to try it (feedback appreciated)
http://prefix.gentooexperimental.org:8000/mutt-patches/file/e31dea94d61b/sidebar-dotpathsep.patch
Comment 13 Thomas Kahle (RETIRED) gentoo-dev 2011-07-29 06:51:43 UTC
set sidebar_delim_chars = "/" brings back the 'old' behaviour.  
+1
Many thanks.  -> Reclosing.
Comment 14 Fabian Groffen gentoo-dev 2011-07-29 08:17:44 UTC
I still need to update the patch ball and commit it, sorry.  Thanks a lot for testing and reporting back.  I'll commit it tonight.
Comment 15 Fabian Groffen gentoo-dev 2011-07-29 17:38:41 UTC
committed in -r6, thanks
Comment 16 Vincent Brillault 2012-03-12 13:00:52 UTC
Created attachment 304987 [details]
Correct bug in "basename" replacement

I think there is an error in the current sidebar-dotpathsep.patch that replaces the standard "basename" function. If "tmp->path" ends with "/foobar/", the current patch will return "" and not "foobar" as basename does.

In my case this results in lines as the following for the "/"(/INBOX) of imap mailboxes:
"                        5221| [... (mails) ...]"

This is a simple patch that skip the last character in order to correct this behavior.
Comment 17 Fabian Groffen gentoo-dev 2012-03-15 07:55:39 UTC
please reopen bugs in the future, or they'll easily get lost in the pile of other bugmails...

Thanks for your patch, I think it's ok.  I'll look into applying it later.
Comment 19 Fabian Groffen gentoo-dev 2012-03-15 20:07:54 UTC
in -r8 (without a bump).