Re: A wish for the mailboxes command

2010-06-26 Thread Chris G
On Fri, Jun 25, 2010 at 05:01:23PM +0200, Alex Huth wrote:
 On Fri, Jun 25, 2010 at 03:33:07PM +0100, Chris G wrote:
  On Fri, Jun 25, 2010 at 03:23:55PM +0200, Alex Huth wrote:
  Only if it knows which ones have new mail in them!  That's where we
  came in.
  
 
 That´s what i am talking about. I am using sidebar with lot of maildirs
 and the following in the config:
 set check_new=yes
 set mail_check=60
 
 Works perfect!
 
Fine, and 'c[hange to directory with new mail]' will work perfectly
too, without the sidebar.

-- 
Chris Green



Re: A wish for the mailboxes command

2010-06-25 Thread Chris G
On Thu, Jun 24, 2010 at 09:07:01AM -0700, Chip Camden wrote:
 On Jun 24 16:09, Chris G wrote:
  After all the recent discussion of detecting new mail etc. it occurs
  to me that it would be very useful to be able to tell mutt that it
  should scan all files in a particular directory for new mail.
  
  If one does have more than one (and non-standard) incoming mail
  destinations then it's almost inevitable that they will be in one
  place, or at most two or three places.
  
  In my case I have:-
  
  ~/Mail/In with inbox, junk and bcs in it
  ~/Mail/Li with all my mailing list incoming mail, each to its own 
  file/folder
  
  If I could just say:-
  mailboxes ~/Mail/In ~/Mail/Li 
  it would make my life a whole lot simpler.
  
  (I guess I might want to unmailboxes ~/Mail/In/junk)
  
  -- 
  Chris Green
 
 I don't rely on mutt to tell  me when new mail arrives.  For one thing, I
 usually have a different workspace active.  So I display it in an xmobar
 section, and use this ruby script to test for new mail in each mbox file:
 
I don't really want to know when new mail arrives, what I want is the
ability to quickly go to all the mailboxes which have new incoming
mail when I'm running mutt.  I don't have any need to respond quickly
to messages, just a need to be able to find them.  Mutt usually sits
running in a dedicated terminal on one of my workspaces with the
'main' inbox displayed so I just need to glance at that to see any
non-list E-Mails.

-- 
Chris Green



Two alternative proposed fixes [Was: Re: A wish for the mailboxes command]

2010-06-25 Thread Erik Christiansen
On Fri, Jun 25, 2010 at 10:47:29AM +0100, Chris G wrote:
 I don't really want to know when new mail arrives, what I want is the
 ability to quickly go to all the mailboxes which have new incoming
 mail when I'm running mutt.  I don't have any need to respond quickly
 to messages, just a need to be able to find them.  Mutt usually sits
 running in a dedicated terminal on one of my workspaces with the
 'main' inbox displayed so I just need to glance at that to see any
 non-list E-Mails.

That is also my usage pattern.

If a script like Chip Camden's, or one in Gawk, running as a coprocess to
mutt, could steer mutt's mail Newness decisions, then mutt's current
erroneous behaviour could be fixed, possibly using more effort than is
necessary. I would be delighted to write, debug, and maintain the
coprocess, if it were necessary to go that way.

While that would be a lot of fun, mutt itself does seem able to be cured
of its current fibbing behaviour. (Try copying this message to this mail
folder. Mutt says New mail in this mailbox. What hokum.)

Mutt needs to check the size and/or atime of the destination folder
_before_ it writes, rather than cookily doing it _after_. Then the
erroneous and misleading immediate message would go away.

To fix the problem of mutt adding the transfer recipient folder to its
list of New folders on its next scan, another small bugfix is also
required. Once the recipient file has been written, mutt needs to update
its current values for file size and atime, so that the Newness
reference will be correct.

Would that not put an end to its fibbing ways?

Erik

-- 
Never worry about theory as long as the machinery does what it's
supposed to do.
  -- Robert A. Heinlein



Re: Two alternative proposed fixes [Was: Re: A wish for the mailboxes command]

2010-06-25 Thread Michael Ludwig
Erik Christiansen schrieb am 25.06.2010 um 20:48 (+1000):

 While that would be a lot of fun, mutt itself does seem able to be
 cured of its current fibbing behaviour. (Try copying this message to
 this mail folder. Mutt says New mail in this mailbox. What hokum.)

Confirmed :-)

 Mutt needs to check the size and/or atime of the destination folder
 _before_ it writes, rather than cookily doing it _after_. Then the
 erroneous and misleading immediate message would go away.
 
 To fix the problem of mutt adding the transfer recipient folder to its
 list of New folders on its next scan, another small bugfix is also
 required. Once the recipient file has been written, mutt needs to
 update its current values for file size and atime, so that the
 Newness reference will be correct.
 
 Would that not put an end to its fibbing ways?

Sounds like it would!

One more example, I have the following setting to store mail
conversations as threads:

  set spoolfile   = +Neu  # c!
  set record  = +Neu  # c

So when I send a message that is not going to a list, it goes to +Neu,
and I'm notified of a new message in +Neu, which is technically correct,
but as I put it there myself I don't need to be told about it.

Checking for new mail before a user-triggered write operation, as you
suggested, would, I think, fix the issue.

-- 
Michael Ludwig


Re: A wish for the mailboxes command

2010-06-25 Thread Alex Huth
On Fri, Jun 25, 2010 at 10:47:29AM +0100, Chris G wrote:
 On Thu, Jun 24, 2010 at 09:07:01AM -0700, Chip Camden wrote:
  
 I don't really want to know when new mail arrives, what I want is the
 ability to quickly go to all the mailboxes which have new incoming
 mail when I'm running mutt.  I don't have any need to respond quickly
 to messages, just a need to be able to find them.  Mutt usually sits
 running in a dedicated terminal on one of my workspaces with the
 'main' inbox displayed so I just need to glance at that to see any
 non-list E-Mails.

Hmmm, if i understand it right sidebar will be your friend. It shows all
folders/files with new mails and give you quick acces to them.

Greetings

Alex Huth


Re: A wish for the mailboxes command

2010-06-25 Thread Chris G
On Fri, Jun 25, 2010 at 03:23:55PM +0200, Alex Huth wrote:
 On Fri, Jun 25, 2010 at 10:47:29AM +0100, Chris G wrote:
  On Thu, Jun 24, 2010 at 09:07:01AM -0700, Chip Camden wrote:
   
  I don't really want to know when new mail arrives, what I want is the
  ability to quickly go to all the mailboxes which have new incoming
  mail when I'm running mutt.  I don't have any need to respond quickly
  to messages, just a need to be able to find them.  Mutt usually sits
  running in a dedicated terminal on one of my workspaces with the
  'main' inbox displayed so I just need to glance at that to see any
  non-list E-Mails.
 
 Hmmm, if i understand it right sidebar will be your friend. It shows all
 folders/files with new mails and give you quick acces to them.
 
Only if it knows which ones have new mail in them!  That's where we
came in.

-- 
Chris Green



Re: Two alternative proposed fixes [Was: Re: A wish for the mailboxes command]

2010-06-25 Thread Erik Christiansen
On Fri, Jun 25, 2010 at 02:46:23PM +0200, Michael Ludwig wrote:

 Checking for new mail before a user-triggered write operation, as you
 suggested, would, I think, fix the issue.

Thank you. 

After checking 114 fleas which mentioned New mail, I've added ticket
#3424.

Erik

-- 
The reasonable man adapts himself to the world; the unreasonable
one persists in trying to adapt the world to himself.
Therefore all progress depends on the unreasonable man.
   - George Bernard Shaw



Re: A wish for the mailboxes command

2010-06-25 Thread Alex Huth
On Fri, Jun 25, 2010 at 03:33:07PM +0100, Chris G wrote:
 On Fri, Jun 25, 2010 at 03:23:55PM +0200, Alex Huth wrote:
 Only if it knows which ones have new mail in them!  That's where we
 came in.
 

That´s what i am talking about. I am using sidebar with lot of maildirs
and the following in the config:
set check_new=yes
set mail_check=60

Works perfect!

Greetings

Alex Huth


Re: A wish for the mailboxes command

2010-06-24 Thread Jostein Berntsen
On 24.06.10,16:09, Chris G wrote:
 After all the recent discussion of detecting new mail etc. it occurs
 to me that it would be very useful to be able to tell mutt that it
 should scan all files in a particular directory for new mail.
 
 If one does have more than one (and non-standard) incoming mail
 destinations then it's almost inevitable that they will be in one
 place, or at most two or three places.
 
 In my case I have:-
 
 ~/Mail/In with inbox, junk and bcs in it
 ~/Mail/Li with all my mailing list incoming mail, each to its own 
 file/folder
 
 If I could just say:-
 mailboxes ~/Mail/In ~/Mail/Li 
 it would make my life a whole lot simpler.
 
 (I guess I might want to unmailboxes ~/Mail/In/junk)

Have you tried something like this in your .muttrc?

mailboxes `echo ~/Mail/In*/*`

Jostein




Re: A wish for the mailboxes command

2010-06-24 Thread Chip Camden
On Jun 24 16:09, Chris G wrote:
 After all the recent discussion of detecting new mail etc. it occurs
 to me that it would be very useful to be able to tell mutt that it
 should scan all files in a particular directory for new mail.
 
 If one does have more than one (and non-standard) incoming mail
 destinations then it's almost inevitable that they will be in one
 place, or at most two or three places.
 
 In my case I have:-
 
 ~/Mail/In with inbox, junk and bcs in it
 ~/Mail/Li with all my mailing list incoming mail, each to its own 
 file/folder
 
 If I could just say:-
 mailboxes ~/Mail/In ~/Mail/Li 
 it would make my life a whole lot simpler.
 
 (I guess I might want to unmailboxes ~/Mail/In/junk)
 
 -- 
 Chris Green

I don't rely on mutt to tell  me when new mail arrives.  For one thing, I
usually have a different workspace active.  So I display it in an xmobar
section, and use this ruby script to test for new mail in each mbox file:


#!/usr/bin/env ruby
newmail=0
in_hdr=false
$.each do |line|
  case line
when /^From /
  newmail += 1
  in_hdr = true
when /^Status: RO/
  newmail -= 1 if in_hdr
when /^\s*$/
  in_hdr = false
  end
end
puts newmail

That prints the number of new messages in each mbox file to stdout, which
gets piped to xmobar for display at the top of all workspaces.

-- 
Sterling (Chip) Camden
http://camdensoftware.com | http://chipstips.com | http://chipsquips.com