Paul E Condon | 2 Feb 07:00

Re: mboxes and maildirs in .muttrc

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.

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.

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.

(Continue reading)

Paul E Condon | 2 Feb 07:14

line wrap in the index?

I have several verbose correspondents who write little essays in the
Subject header.  If I could put Subject: field last, I could see
several fields, like From; that are more important. But these other
fields are variable lenth, and that messes up threading, which is
keyed to the start of the Subject: field in each line, I think.

But rather than line wrap in the index, is there a way to truncate the
print of the subject field?  I think I can tell whether I want to open
an email on the basis of the first twenty or thirty letters of the
subject.

Thanks,
--

-- 
Paul E Condon           
pecondon <at> mesanetworks.net

Picon

Re: mboxes and maildirs in .muttrc

* Paul E Condon <pecondon <at> mesanetworks.net> [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.

(Continue reading)

Christian Brabandt | 2 Feb 11:05

Re: question about saving emails

Hi Kyle!

On Fri, 30 Jan 2009, Kyle Wheeler wrote:

> On Friday, January 30 at 03:26 PM, quoth Paul E Condon:
> > What would be a save-hook that delivers equivalent logic to what 
> > is built in?
> 
> There isn't one. To my knowledge, the target of a save-hook cannot 
> depend on the matched pattern.

Yes you can. You can use %-expandos of the index format. See the 
manual. So something like this should work (untested, I have never 
used save-hooks, just remember having read it somewhere):

save-hook . ./%F

(I think this is the default behaviour)

regards,
Christian
--

-- 
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.

Christian Brabandt | 2 Feb 11:23

Re: mboxes and maildirs in .muttrc

Hi Anders!

On Mon, 02 Feb 2009, Anders Rayner-Karlsson wrote:

> > 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.

I have done something like this:
Consider this minimal .muttrc
,----
| # Specify which type, use any of
| # Maildir, MH, mbox und MMDF
| set mbox_type=Maildir
| 
| # Where to store, dir must exist!
| set my_archivedir="~/mutt_archive/$mbox_type"
| 
| # Create without confirmation
| set confirmcreate=no
| 
| # append without confirmation
| set confirmappend=yes
(Continue reading)

Patrick Shanahan | 2 Feb 15:29
Picon

Re: mboxes and maildirs in .muttrc

* Paul E Condon <pecondon <at> mesanetworks.net> [02-02-09 01:03]:
> 
> 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.
> 

not necessary.  You may use mutt to change files from either format to
the other.  If mutt is set to mbox, you may open a maildir format box
and copy/save the contents to another new box and they will be in the
mbox format.  Also, the opposite is true, if mutt is set to use
maildir format, opening an mbox file and copy/save to a new box, the
new box will be in maildir format.

--

-- 
Patrick Shanahan         Plainfield, Indiana, USA        HOG # US1244711
http://wahoo.no-ip.org     Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535                    @ http://counter.li.org

Kyle Wheeler | 2 Feb 16:04

Re: line wrap in the index?


On Sunday, February  1 at 11:14 PM, quoth Paul E Condon:
> I have several verbose correspondents who write little essays in the 
> Subject header.  If I could put Subject: field last, I could see 
> several fields, like From; that are more important. But these other 
> fields are variable lenth, and that messes up threading, which is 
> keyed to the start of the Subject: field in each line, I think.

...I assume you're talking about index view? Then you probably want to 
set up $index_format.

> But rather than line wrap in the index, is there a way to truncate 
> the print of the subject field?

In the index? Absolutely! The $index_format variable takes printf-like 
length specifications. So, if you wanted to limit the subject (denoted 
by %s in the $index_format) to a mere twenty characters, you'd use 
this: %.20s

That will left-align the subjects. If, on the other hand, you wanted 
to align them all to the right, use this: %20.20s

~Kyle
--

-- 
A fanatic is one who can't change his mind and won't change the 
subject.
                                     -- Winston Churchill, July 5, 1954
Kyle Wheeler | 2 Feb 16:06

Re: question about saving emails


On Monday, February  2 at 11:05 AM, quoth Christian Brabandt:
> On Fri, 30 Jan 2009, Kyle Wheeler wrote:
>> On Friday, January 30 at 03:26 PM, quoth Paul E Condon:
>>> What would be a save-hook that delivers equivalent logic to what 
>>> is built in?
>> 
>> There isn't one. To my knowledge, the target of a save-hook cannot 
>> depend on the matched pattern.
>
> Yes you can. You can use %-expandos of the index format. See the 
> manual. So something like this should work (untested, I have never 
> used save-hooks, just remember having read it somewhere):
>
> save-hook . ./%F
>
> (I think this is the default behaviour)

Huh! Learn something new every day... Cool!

~Kyle
--

-- 
Human beings are the only creatures that allow their children to come 
back home.
                                                          -- Bill Cosby
Paul E Condon | 2 Feb 20:21

question marks in default index_format

I'm puzzled by the default index_format which is, I think:

set index_format="%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s"

I don't understand the string inside parentheses. Where can
I find an explanation? Question marks often invoke some sort
of conditional action, but I don't see them in printf docs.

TIA
--

-- 
Paul E Condon           
pecondon <at> mesanetworks.net

Kyle Wheeler | 2 Feb 22:16

Re: question marks in default index_format


On Monday, February  2 at 12:21 PM, quoth Paul E Condon:
>I'm puzzled by the default index_format which is, I think:
>
>set index_format="%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s"
>
>I don't understand the string inside parentheses. Where can
>I find an explanation? Question marks often invoke some sort
>of conditional action, but I don't see them in printf docs.

Mutt doesn't rely strictly on printf; the semantics are printf-LIKE. 
:)

I don't know where it's documented, but yes, those are conditional. 
Basically, it works like an if-else statement, like so: 
%?condition?ifTrue&ifFalse? Additionally, conditional statements 
cannot be nested inside each other.

The "condition" is not very complicated - it's only allowed to be one 
of the valid %-letter letters. For example, in %?l?____&****?, you're 
testing the %l value (i.e. the number of lines in the message). If 
that value is zero or undefined, it's considered false. For example, 
unless mutt has scanned the message and formatted it, it does not know 
how many lines are in the message. Thus, in the default index_format, 
if the number of lines in the message is unknown, it will print %4c 
(i.e. the size of the message), but if the number of lines IS known, 
it will print that instead.

As another example, a pattern that I use in my index_format setting is 
this:
(Continue reading)


Gmane