bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] folder_create() on $HOME/Mail fails with ENOENT in C


From: Joachim Nilsson
Subject: Re: [bug-mailutils] folder_create() on $HOME/Mail fails with ENOENT in CVS code.
Date: Sun, 03 Apr 2005 10:54:13 +0200

Hi!

This is a followup/repost of the below patch.  The history for this
patch goes as follows; in mailutils 0.4.1 local folder listings suddenly
stopped working.  When 0.5 was released I thought I had found the error
and sent in a clumsy fix.  After some discussion I tried to fix it up
but never heard back from anyone.

So now I try again.  This time I have cleaned up the patch a bit further
and also added a small test case to demonstrate the results.

$ mkdir ~/tmp-mailtest && cd ~/tmp-mailtest
$ wget http://vmlinux.org/jocke/gnu/mailutils/local-folder-listing.tgz
$ tar xfz local-folder-listing.tgz && cd local-folder-listing
$ make
$ ./folders

Same archive in extracted form, suitable for browsing at

        http://vmlinux.org/jocke/gnu/mailutils/local-folder-listing/

Regards
 /Jocke

On Tue, 2004-07-13 at 15:07 +0200, Joachim Nilsson wrote:
> On Tue, 2004-07-13 at 13:13, Sergey Poznyakoff wrote:
> > Joachim Nilsson <address@hidden> wrote:
> > > > But it effectively disables is_dir method for MH and maildir formats...
> > > Sorry, I don't follow, what do you mean?  Does the method in
> > > mailbox/mbox/folder.c:_path_is_scheme() run for the MH and maildir
> > > formats as well?
> > There is a feature called 'mailbox format autodetection': if a mailbox
> > is specified by an absolute file name (as opposed to giving a fully
> > qualified URL) mailutils tries to detect the format of the mailbox
> > in question. In order to do so, the library tries each registered
> > format in turn and calls its `is_scheme' method until one of these
> > returns true or the list of formats is exhausted. With your patch applied,
> > autodetection will always end up on 'mbox:' handlers, no matter what
> > the actual mailbox format is.
> 
> Aha, now I understand, thanks.
> 
> If I look at the problem from my point of view (rather egotistically)
> then I see at least two quick workarounds:
> 
> 1. In mailbox/folder.c:folder_create(), there could be an explicit 
>    last check if (!found && IS_DIR...) after the iterator loop before
>    we bail out.  That if() would setup f_init() and u_init() as ptrs
>    to the path_record functions.
> 
> 2. In mailbox/folder.c:folder_create(), when calling the function 
>    registrar_get_list() that function always returns a sorted list
>    with the path_record always being the last record.
> 
> Option (2) could be implemented in (at least) two ways: either the
> registrar_get_list() function always sorts the list before returning
> or registar_record() prepends all records but the path_record which
> it appends.
> 
> Personally I prefer option (2) with the fix only being made to the
> registrar_record() function.  I've attached a new patch implementing
> this rather clumsily.
> 
> Regards
>  /Jocke






reply via email to

[Prev in Thread] Current Thread [Next in Thread]