Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Derek Martin
On Tue, Sep 22, 2020 at 05:46:53PM +0100, Chris Green wrote:
> Does mutt still use the (IMHO silly) maildir hierarchy where mail
> 'folders' are simply represented by another '.' and name in the
> maildir directory name?

I'm not sure why you think Mutt is doing this...  I have my maildir
folders set up in exactly the way you say you want and they work fine.
But Mutt, by and large, isn't what created that mailbox structure--it
was procmail.  Presumably it's also true for you that whatever is
delivering your mail is creating the directory structure, and mutt is
just consuming it.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



signature.asc
Description: PGP signature


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Cameron Simpson
On 23Sep2020 14:58, Kurt Hackenberg  wrote:
>On 2020-09-23 04:07, Chris Green wrote:
>
>>I think I might try that second idea, I can run mb2md (as you say)
>>2354 times and get the layout I want.  Then I can try mutt on it and
>>see if it's practical.
>
>
>Does mb2md convert message attributes? (Message has been read, message 
>has been replied to, etc.)

Easy to test though. And easy to patch mb2md if lacking.

>In mbox files, I believe Mutt stores that stuff in the common but 
>non-standard headers Status:, X-Status:, and X-Label:. Maildir instead 
>encodes much of that in message pathnames. Basic maildir has no way to 
>encode labels/keywords, but Dovecot has added its own mechanism for 
>that. I don't know how Mutt stores labels in maildir.

The label %Y displays comes from X-Label. I use it extensively.

One can also remember that you can convert mailboxes using mutt, in 
which case you're assures that the results will be mutt compatible :-)

Here's a line from the guts of my mboxify script, which I use to bulk 
convert Maildir to mbox (I keep my archive folders as mbox, more 
compact):

mutt -n -F /dev/null -f "$mailbox" -e "set sort=mailbox-order; set 
confirmappend=no; set delete=yes; push 
'.$mailboxtmp'"

where $mailbox is the source mail folder and $mailboxtmp is a scratch 
mbox folder (intially just an empty file of course), which gets renamed 
if the mutt succeeds.

Cheers,
Cameron Simpson 


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Kurt Hackenberg

On 2020-09-23 04:07, Chris Green wrote:


I think I might try that second idea, I can run mb2md (as you say)
2354 times and get the layout I want.  Then I can try mutt on it and
see if it's practical.



Does mb2md convert message attributes? (Message has been read, message 
has been replied to, etc.)


In mbox files, I believe Mutt stores that stuff in the common but 
non-standard headers Status:, X-Status:, and X-Label:. Maildir instead 
encodes much of that in message pathnames. Basic maildir has no way to 
encode labels/keywords, but Dovecot has added its own mechanism for 
that. I don't know how Mutt stores labels in maildir.


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Kurt Hackenberg

On 2020-09-23 03:22, Francesco Ariis wrote:


Il 23 settembre 2020 alle 13:52 Kevin Shell ha scritto:

In mail/news discussion,
some reply messages have no In-Reply-To/References headers,
what cause reply messages don't have In-Reply-To/References headers?


A possible explanation: the sender clicked «New message» and copy/pasted
the Subject instead of clicking «Reply».



Another possibility is that the sender's mail reader just doesn't do 
that. Those two headers are optional, not required; some mail readers 
just don't create them in replies.


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Cameron Simpson
On 23Sep2020 09:11, Chris Green  wrote:
>> I don't browse from within mutt (but see Kevin's reply) but I do have 
>> a
>> directory hierarchy. Admittedly it is shallow and does not have Maildirs
>> inside Maildirs, but my own folders are like this:
>>
>> ~/mail/foldername   # top level "current" folders
>> ~/mail/OLD//foldername  # archived folders
>> ~/mail/O/foldername # this year's archived folders
>>
>> I've just got (d)elete bound to move messages into
>> "O/current-folder-name", and "O" is just a symlink to
>> "OLD/the-current-year".
>>
>> So no Maildirs inside Maildirs, but several subdirectories.
>>
>I don't think I want Maildirs inside Maildirs, mbox can't do that so I
>don't expect it.

Then you should be fine. Make whatever structure you'd like.

Cheers,
Cameron Simpson 


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Christian Ebert

* Francesco Ariis on Wednesday, September 23, 2020 at 10:30:09 +0200:

Il 23 settembre 2020 alle 15:55 Kevin Shell ha scritto:

On Wed, Sep 23, 2020 at 09:22:02AM +0200, Francesco Ariis wrote:

By default mutt checks In-Reply-To/References to group threads; *also*,
messages with the same Subject are grouped together in «pseudo threads»
(reference [1]).
Does this answer your questions?


I know, but I ask what those messages linked to, root/first message?


Checking my mutt, pseudo thread are linked to the «highest» message
with the same title


If you don't like the result of a pseudo thread, you can
link-threads (bound to & by default) manually.

--
LAST SHIP HOME  --->> https://lastshiphome.de
Official Selection  DOK.fest München 2018
German Ocean Film AwardCineMare Kiel 2019
Best Documentary Feature   Wales International Film Festival 2020


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Kevin Shell
On Wed, Sep 23, 2020 at 10:30:09AM +0200, Francesco Ariis wrote:
> Il 23 settembre 2020 alle 15:55 Kevin Shell ha scritto:
> > On Wed, Sep 23, 2020 at 09:22:02AM +0200, Francesco Ariis wrote:
> > > By default mutt checks In-Reply-To/References to group threads; *also*,
> > > messages with the same Subject are grouped together in «pseudo threads»
> > > (reference [1]).
> > > Does this answer your questions?
> >
> > I know, but I ask what those messages linked to, root/first message?
>
> Checking my mutt, pseudo thread are linked to the «highest» message
> with the same title
> —F

What's "«highest»" message?

My mutt draw those messages with three special characters "├*>",
but I don't know where should mutt linked those messages to,
some linked to root/first message, some are elsewhere.

--
kevin


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Francesco Ariis
Il 23 settembre 2020 alle 15:55 Kevin Shell ha scritto:
> On Wed, Sep 23, 2020 at 09:22:02AM +0200, Francesco Ariis wrote:
> > By default mutt checks In-Reply-To/References to group threads; *also*,
> > messages with the same Subject are grouped together in «pseudo threads»
> > (reference [1]).
> > Does this answer your questions?
> 
> I know, but I ask what those messages linked to, root/first message?

Checking my mutt, pseudo thread are linked to the «highest» message
with the same title
—F


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Chris Green
On Wed, Sep 23, 2020 at 08:20:11AM +1000, Cameron Simpson wrote:
> On 22Sep2020 17:46, Chris Green  wrote:
> >Does mutt still use the (IMHO silly) maildir hierarchy where mail
> >'folders' are simply represented by another '.' and name in the
> >maildir directory name?
> 
> Are you talking about browsing a Maildir hierarchy from mutt, or just 
> the physical structure on disc?
> 
The actual structure on disk, as I explained I often move stuff around
and/or rename things, or check on space usage directly from the
command line and the maildir++ format makes this *very* difficult.


> I don't browse from within mutt (but see Kevin's reply) but I do have a 
> directory hierarchy. Admittedly it is shallow and does not have Maildirs 
> inside Maildirs, but my own folders are like this:
> 
> ~/mail/foldername   # top level "current" folders
> ~/mail/OLD//foldername  # archived folders
> ~/mail/O/foldername # this year's archived folders
> 
> I've just got (d)elete bound to move messages into 
> "O/current-folder-name", and "O" is just a symlink to 
> "OLD/the-current-year".
> 
> So no Maildirs inside Maildirs, but several subdirectories.
> 
I don't think I want Maildirs inside Maildirs, mbox can't do that so I
don't expect it.


> Oh, don't forget: don't name any of your folders "tmp" or "cur" or 
> "new", those names are special for Maildir.
> 
Yes, easily forgotten, especially tmp. :-)

-- 
Chris Green


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Chris Green
On Tue, Sep 22, 2020 at 10:40:09PM -0400, Kurt Hackenberg wrote:
> On 2020-09-22 13:30, Chris Green wrote:
> 
> > > Does mutt still use the (IMHO silly) maildir hierarchy where mail
> > > 'folders' are simply represented by another '.' and name in the
> > > maildir directory name?
> > > 
> > > Is there some way I can get to use real directories to represent my
> > > hierarchy of mail?
> 
> 
> Originally maildirs had no subfolders; the '.' names were invented by Sam
> Varshavcik, I think a long time ago.[1] What you want also exists; it may be
> more recent. The IMAP server Dovecot, at least, can be configured to name
> maildir subfolders either way.
> 
Yes, exactly, it used to work the 'right' way! :-)


> I think Mutt can read or create a maildir at any pathname you supply,
> including the pathname of either kind of subfolder. What Kevin said about
> the new function  sounds like a handy shortcut.
> 
> > I just run mb2md on my existing mail folders, I ended up with a single
> > directory (~/Maildir) containing 2354 files mostly with ridiculously
> > long names!  This just isn't a sensible way to organise my mail.
> 
> 
> Do you mean you have 2354 mbox files, and now 2354 maildir subfolders? Maybe

Yes.


> you can write a shell script that renames all those maildir subfolders to
> the pathnames you want. Or a script that runs mb2md 2354 times, with an
> input and output pathname each time, if it can be used that way. Or use a
> different conversion tool.
> 
I think I might try that second idea, I can run mb2md (as you say)
2354 times and get the layout I want.  Then I can try mutt on it and
see if it's practical.


-- 
Chris Green


Re: Can mutt be persuaded to use a sensible maildir hierarchy?

2020-09-23 Thread Chris Green
On Wed, Sep 23, 2020 at 09:44:22AM +1000, raf wrote:
> On Tue, Sep 22, 2020 at 06:30:52PM +0100, Chris Green  wrote:
> 
> > On Tue, Sep 22, 2020 at 05:46:53PM +0100, Chris Green wrote:
> > > Does mutt still use the (IMHO silly) maildir hierarchy where mail
> > > 'folders' are simply represented by another '.' and name in the
> > > maildir directory name?
> > > 
> > > Is there some way I can get to use real directories to represent my
> > > hierarchy of mail?  I manually rearrange my mail sometimes and to deal
> > > with very long directory names isn't really practical. For example I
> > > might decide to move mail as follows:-
> > > 
> > > ~/Mail/folder/travel/zelmaFrance 
> > > 
> > > to
> > > 
> > > ~/Mail/folder/travel/france/zelma
> > > 
> > > With real directories such a move isn't too difficult but with the
> > > default maildir naming it becomes painful.
> > > 
> > > Some software I believe does work the way I want with maildir but the
> > > dotted hierarchy seems to be becoming the standard.  Is there no way
> > > round this?  I'd really like to move to maildir but I really can't see
> > > it being practical for me as it is.
> > > 
> > I just run mb2md on my existing mail folders, I ended up with a single
> > directory (~/Maildir) containing 2354 files mostly with ridiculously
> > long names!  This just isn't a sensible way to organise my mail.
> > 
> > -- 
> > Chris Green
> 
> I might be talking nonsense, but that maildir hierarchy
> probably is the correct thing, as defined by whoever
> came up with it, and is what is needed for all(?) mail
> software that deals with maildir to work. But if you
> want to manipulate the hierarchy separately from mail
> software, and still have all mail software work
> correctly, you might be able to implement (or convince
> someone to implement) a userspace fuse file system that
> provides an alternative view of the real maildir file
> system, that can be mounted alongside the real maildir
> directory. Then, whatever mail software you want to use
> can work with the real maildir hierarchy, and you can
> manipulate it in the way you want outside of mail
> software. I have no idea how much effort would be
> involved in such a fuse file system, though.
> 
The only things dealing with the maildirs are my own mail filter
written in Python and mutt, nothing else.

Way back when maildir first appeared and I used qmail the way I want
things to work was the way it *did* work.  It's the maildir++ thing
that's broken it.


> An alternative, if the only problem is renaming
> folders, is to write a shell script or something that
> renames maildir folders. That would be a lot less
> effort.
> 
> But I really don't know what I'm talking about. I use
> mbox.
> 
> Perhaps you can rename/move folders in a mail client
> and then you don't need to look at the guts underneath.
> That would be the easiest way. I know that GUI IMAP
> clients can do that. Can mutt do that? I found this:
> 
>   https://unix.stackexchange.com/questions/44508/mutt-rename-imap-folder
> 
No IMAP, no POP3. :-)

-- 
Chris Green


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Kevin Shell
On Wed, Sep 23, 2020 at 09:22:02AM +0200, Francesco Ariis wrote:
> Hello Kevin,
>
> Il 23 settembre 2020 alle 13:52 Kevin Shell ha scritto:
> > In mail/news discussion,
> > some reply messages have no In-Reply-To/References headers,
> > what cause reply messages don't have In-Reply-To/References headers?
>
> A possible explanation: the sender clicked «New message» and copy/pasted
> the Subject instead of clicking «Reply».
>
This is only one possible scenario, expecially newbies.

> > What message these reply messages
> > linked to with regard to mutt message threading?
>
> By default mutt checks In-Reply-To/References to group threads; *also*,
> messages with the same Subject are grouped together in «pseudo threads»
> (reference [1]).
> Does this answer your questions?
> —F

I know, but I ask what those messages linked to, root/first message?

--
kevin


Re: Message threading: reply message and In-Reply-To/References

2020-09-23 Thread Francesco Ariis
Hello Kevin,

Il 23 settembre 2020 alle 13:52 Kevin Shell ha scritto:
> In mail/news discussion,
> some reply messages have no In-Reply-To/References headers,
> what cause reply messages don't have In-Reply-To/References headers?

A possible explanation: the sender clicked «New message» and copy/pasted
the Subject instead of clicking «Reply».

> What message these reply messages
> linked to with regard to mutt message threading?

By default mutt checks In-Reply-To/References to group threads; *also*,
messages with the same Subject are grouped together in «pseudo threads»
(reference [1]).
Does this answer your questions?
—F

[1] http://www.mutt.org/doc/manual/#strict-threads