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

Re: How to deal with new mail?



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

On Friday, February 15 at 07:21 PM, quoth Benjamin Buch:
> I did set up my .muttrc now like this:
>
> mailboxes /var/mail/benni =freunde =kassette =listmutt =lists =mbox 
> =root =sent =uni
>
> As I wrote to Vladimir, pressing '.' does nothing, and I don't get 
> any notification about new mail below the status bar.

Hmmmm... and these are all local folders? The next task is to figure 
out why mutt isn't seeing new mail in them. What sort of an 
environment are we working with? Are these folders mbox's or 
Maildir's? What sort of filesystem are they on? Are they on an NFS 
share or a filesystem that's been mounted with the noatime option?

At issue now is how mutt determines whether there's new mail in a 
folder. Maildir's are relatively easy: if there's anything in the new/ 
directory inside the maildir, then the mailbox has new mail. Mboxes 
are more difficult, because doing a thorough job requires reading 
through the whole mbox (which mutt would rather not do just to get a 
folder list). Instead, mutt relies, by default, on the timestamps of 
the file. By default, mutt depends on the access-time and modify-time 
of the file (when the mailbox is *read*, only the access-time changes, 
and when mail is *delivered*, only the modify-time (and the 
change-time) changes, thus if the modify time is more recent than the 
access-time the mbox must have new mail in it). However, on some 
filesystems, these timestamps are unreliable---for example, if your 
filesystem is mounted with the noatime option, the access time is 
never updated, and either all mailboxes appear to have new mail or 
none of them do (depending on the system). I believe NFS shares have 
other problems with timestamps that makes them unreliable. In mutt 
1.5.15 and later, there's a $check_mbox_size option that makes mutt 
use file size to guess whether an mbox has new mail in it rather than 
the timestamps. However, this isn't a perfect workaround, for several 
reasons, the biggest one being that at startup mutt assumes that all 
mailboxes have no new mail (it can only detect mail delivered after it 
recorded the size of each mbox).

What Vladimir was saying about $mark_old can throw a monkey-wrench in 
things too, depending on what you're expecting mutt to do. The idea 
makes more sense with Maildir's, so I'll explain it that way. The way 
maildirs work, there are three component folders of every maildir: 
"cur", "new", and "tmp". All messages in the "new" folder are 
absolutely considered New. However, messages can also be *marked* as 
"New" when they are stored in the "cur" folder. Mutt considers these 
messages to be "Old" (i.e. if $mark_old is set, when you open a 
Maildir with New messages, any messages that are still New when you 
close that Maildir are moved to the cur folder, and thus are still 
Unread, but are no longer New: aka "Old". If $mark_old is unset, mutt 
will leave any unread New messages in the "new" folder. Maildirs are 
only considered to have New messages if they have messages in the 
"new" folder, thus, $mark_old will make Unread messages not count as 
New if you've opened the folder before). This behavior is more 
complicated to implement with other mailbox storage mechanisms (e.g. 
IMAP, mbox, MH, etc.), but Mutt has various ways of doing it (some of 
them don't work as well as others). But, as long as you have $mark_old 
unset, we don't have to worry about the interaction of unread messages 
with detection of new messages.

> Pressing c? works, but I get a list with all folders, even if I didn't 
> specify them as mailboxes, and not just those with new mail. 
> Seems like I misconfigured something?

Ah, no, I just told you wrong. The buffy-list only puts the list of 
folders with new stuff below the status-bar. There doesn't seem to be 
a way to trim the folder-browser down to just the ones with new mail 
in them. Sorry about that. But, for what it's worth, the browser list 
should put an N next to each folder with new mail in it.

Does that help at all?
~Kyle
- -- 
The fact that we live at the bottom of a deep gravity well, on the 
surface of a gas-covered planet going around a nuclear fireball 90 
million miles away, and think this to be normal, is obviously some 
indication of how skewed our perspective tends to be...
                                                       -- Douglas Adams
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHtd8nBkIOoMqOI14RAjsGAKDhH8bMpABevo7N/b0zolAzJ5JkzACfTf2X
HymmuDvwe/tUpHrawoHOV2A=
=EZF3
-----END PGP SIGNATURE-----