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

Re: How to deal with new mail?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, February 15 at 01:09 PM, quoth Vladimir Marek:
>> I recently switched from evolution to mutt, and I wonder how to 
>> deal with new mail. In evolution, all received mail was sorted in 
>> diffenrent folders, but I had a special folder where all new unread 
>> mails would show up. I guess it was called a "search"-folder which 
>> only contained links to the mails in their "real" folders or 
>> something. If I marked mails as read they would not show up in that 
>> search folder any more, but in their "real" folders. This was a 
>> very convinient way to deal with new mail...
>
> I'm afraid that this is not possible with mutt, as it does not have 
> virtual folders, at least not ones containing mails from several 
> maildirs.

True, sad but true. Being able to view multiple folders at the same 
time would be an awesome feature.

>> I set up mutt with fetchmail and procmail, with procmail sorting 
>> mails in mboxes. So when I start mutt, I get the index view of the 
>> spoolfile with new mails in it. But what if I got new mail that was 
>> sorted by procmail into other mboxes? How do I know there is new 
>> mail without checking each mbox?
>> 
>> I've defined the mboxes according to the mutt manual,
>> 
>> set folder="$HOME/mail" 
>> mailboxes =mboxname

To get mutt to check all of the mboxes that can have new mail in them, 
you have to list ALL of them in the mailboxes command. For example, if 
your procmail script can deliver mail to "family", "friends", "mutt", 
and "work" folders, you would need a mailboxes line something like 
this:

     set folder="$HOME/mail"
     mailboxes =family =friends =mutt =work =
               ^       ^        ^     ^     ^-- $folder
               |       |        |     `-------- $folder/work
               |       |        `-------------- $folder/mutt
               |       `----------------------- $folder/friends
               `------------------------------- $folder/family

Then mutt will check all of those folders for new mail. They won't be 
displayed in the status-bar, but you will be notified of new mail just 
below the status bar. Also, as Vladimir said, you can press '.' 
(period) to get the list, or, after pressing 'c' to change folders, 
you can press '?' to show just the mailboxes that have new mail (this 
is known as the "buffy list").

>> I also don't get this sentence from the manual (3.11 Defining 
>> mailboes which receive mails):
>> 
>> "When changing folders, pressing space will cycle through folders with 
>> new mail."

When changing folders (i.e. after you've pressed 'c'), the first 
mailbox (that you've told mutt to check, via the 'mailboxes' command) 
that has new mail in it is listed as a suggestion. Pressing space will 
cycle to the next one, provided that 1) you've specified multiple 
mailboxes and 2) another of them has new mail in it.

>> Another way for dealing with new mail i thought of was this one:
>> 
>> 1:   Every mail goes to the spoolfile, procmail just filters spam 
>> 2:   Mails in the spoolfile are displayed sorted and coloured 
>> according to their scoring, mail from friends first for example 
>> 3:   Set up some kind of folder-hook-magic to save the mails from the 
>> spoolfile to their folders when exiting mutt.
>> 
>> Would this be possible? I fear I've read something about "mutt can only 
>> save to one mbox on exit"...
>
> I'm not sure about step 3 :)

I am. You can absolutely set up a big long macro to do it (you'd need 
the devel version of mutt, because the macro would rely on 
<tag-prefix-cond>). And you can set mutt to trigger that big macro any 
way you like (e.g. before quitting, before changing folders, or 
whatever).

What you read about saving to an mbox is related to a different mutt 
behavior. Mutt was designed, in part, for people who rely on the 
standard sendmail "spool" method of delivering email. In other words, 
sendmail would deliver mail to /var/spool/mail/$username, and that 
user would need to read mail from that file (aka the $spoolfile) and 
move that mail elsewhere as soon as possible. Mutt made that 
convenient by allowing the user to specify a $spoolfile and a $mbox 
which have the relationship such that any mail in $spoolfile is 
automatically moved to $mbox when mutt is done reading $spoolfile. But 
that's not what you're using mutt for, so you can ignore that feature.

Hope that makes things a little clearer for you,
~Kyle
- -- 
We will be a better country when each religious group can trust its 
members to obey the dictates of their own religious faith without 
assistance from the legal structure of their country.
                                                       -- Margaret Mead
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHtbjJBkIOoMqOI14RAgG4AKCR0rHVRxskWTSvDhNjqCd5yS+6qgCfUo6V
b5TKvqMVg2QjoiuYDNmO7aA=
=XW6h
-----END PGP SIGNATURE-----