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

Re: mboxes and maildirs in .muttrc



* Paul E Condon <pecondon@xxxxxxxxxxxxxxxx> [20090202 07:02]:
> On 2009-01-31_0244.36, sigi wrote:
> > Hi, 
> > 
> > is it possible to mix local mboxes (processed by fetchmail) and local 
> > mirrored maildirs through offlineimap in one muttrc, in a way that they 
> > both show up in the folder-menu of mutt?
> > 
> > I tried to do this, but it seems I'd have to decide between fetchmailed 
> > mboxes or maildirs with offlineimap. 
> > 
> > Any hints? 
> 
> Yes, it is possible, but the results can be confusing. I discovered I
> was mixing by accident. Mutt will read an mbox file and a maildir
> directory indifferently, if both are present in ~/Mail or in ~/Maildir
> or in whatever directory you have specified in muttrc. When reading,
> it recognizes the format that is actually there in each individual
> mailbox and treats it according.

I use this on a daily basis and have not found it to be confusing. I
even mix mbox (getmail/procmail), maildir (offlineimap) and direct
imaps:// to servers. mutt is more than capable of handling this.

I use this method of mixing mbox and maildir as I have the compressed
folders patch applied to mutt and I archive mailing lists I receive to
bzip'ed mboxes. mairix will read these quite happily allowing me to
index and search through easily enough. Very useful when working
remote or at customer site, having all this local on the laptop.

> When creating a new mailbox it will create the type that you have told
> it to use in muttrc. It doesn't get confused, but you very likely
> will.  Consider this a hint as to what you should do.

Correct. If you tell mutt to create an mbox by default that is what
it'll do. Creating a destination folder for maildir is trivial
however.

$ mkdir -p ~/Mail/newmdfolder/{cur,new,tmp}

And you can save your mail to =newmdfolder as you would with another
maildir.

I use mutt 1.5.18 by the way.

> There is a program mb2md that converts mbox format to maildir format.
> I have found it difficult to use, but I have made it work. mb2md might
> work very nicely if you give it a clean, well maintained mbox format
> email directory, but it sounds like that is not what you have, so I
> recommend using bash and core-utils to clean up the mess somehow. I
> have been doing that myself for the past couple of weeks.

I think there is some Perl or Python tools, but you could actually
just use mutt itself to sort and move the mail around.

> Procmail uses both mbox and maildir, and knows which to use by the
> address you give it - if the address ends in a slash (/) it uses
> maildir, otherwise it uses mbox. This might also be the case for mutt,
> but I haven't tested.

Cheers,

-- 
Anders Rayner-Karlsson <anders@xxxxxxxxxxxxxx>
All-Round Linux Tinkerer, RHCE and PITA DeLuxe