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

Reply via email to