zsh-users
 help / color / mirror / code / Atom feed
* Re: New mail notification not working
@ 2001-09-09 17:33 Russell Hoover
  2001-09-09 18:25 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Russell Hoover @ 2001-09-09 17:33 UTC (permalink / raw)
  To: zsh-users; +Cc: Bart Schaefer

On Fri 09/07/01 at 05:11 PM +0000, Bart Schaefer
<schaefer@brasslantern.com> wrote:

> No, you don't need anything after the name of the directory; you
> don't even need the trailing slash, though it should be harmless.

Thanks  --  I asked that because the last sentence for the ``mailpath''
entry in the manual is this:

             ``If  an element is a directory instead
               of a file the shell will recursively
               check every file in every subdirectory
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               of the element."


Which might well lead one to believe that, in the case of maildirs, unless
I specified the ``new'' subdir, zsh would check the ``tmp'' and ``cur''
subdirs as well, and checking ``cur'' could be a disaster as ``cur'' might
contain dozens or hundreds of (non-new) messages.

> Anyway, mailstat() is using a single static structure to keep track of
> the last-modified time of the maildir "new" subdir. This means that it
> only works correctly if you have exactly one maildir directory in your
> mailpath -- if you have multiple maildirs, it gets confused about which
> modified-time to compare; it checks each maildir for new-ness against
> the modified time of the one preceding it in the mailpath, cycling to
> check the first maildir against the last on subsequent calls.

To understand this fully I seem to need to make a distinction: you say
"exactly one maildir directory in your mailpath"  --  Does that mean that
I must have only one *defined* in my mailpath, or only one in existence?

(I'd be quite satisfied, for now at least, to have notification working
just for my inbox.)

I have a total of two directories for all my mail:  (a)  my inbox, which
is ~/.mailspool/rj/ (with the three maildir subdirs -- ``cur'', ``new'',
and ``tmp'' -- inside of that) and  (b)  a ``Mail'' directory, containing
about a dozen subdirs of various mailing-list nicknames, etc.  (and each
of them, of course, has *its* own set of the three maildir subdirs).

Shouldn't notification be working if I just have either of these defined
in my .zshrc:

            export MAIL=$HOME/.mailspool/rj

or:         mailpath=($HOME/.mailspool/rj'?New mail has arrived.')

(btw, should the opening quote-mark above be where it is, or should it
be just before ``$HOME'', or does it matter?)

OR, does the mere fact that I have several maildirs *simply existing*
in the ``Mail'' directory (which is not defined in either ``MAIL'' or
``mailpath'' in my zsh init files)  --  does that *in and of itself*
confound mailstat?

(If it's the latter, it would seem that I'm out of luck until mailstat()
can be re-made along the lines of your suggestion.)

> So you ought to be getting notified some of the time, but it would seem
> random when you don't know what's going on.

I am only getting the (default) notification under one circumstance only,
and that is the following:

(a)  From within either mutt's index or pager, I press `e' in mutt
     to edit the raw message;

(b)  I am put into vim and I edit the message;

(c)  I write-quit out of vim and the new message appears in
     mutt's index, while the previous version of that message
     is marked for deletion;

(d)  I quickly switch to another terminal window and see
     ``You have new mail.'' appear before the zsh prompt
     after I press the RETURN key.


Thank you for your indulgence (trying not to seem too
obtuse about it all).

-- 
                                 // rj@panix.com //


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New mail notification not working
  2001-09-09 17:33 New mail notification not working Russell Hoover
@ 2001-09-09 18:25 ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2001-09-09 18:25 UTC (permalink / raw)
  To: Russell Hoover, zsh-users

On Sep 9,  1:33pm, Russell Hoover wrote:
} Subject: Re: New mail notification not working
}
} Thanks  --  I asked that because the last sentence for the ``mailpath''
} entry in the manual
} [...] might well lead one to believe that, in the case of maildirs, unless
} I specified the ``new'' subdir, zsh would check the ``tmp'' and ``cur''
} subdirs as well

The manual doesn't tell anything about maildir support, mostly because
the person who contibuted the mailstat code didn't include a man patch
to go with it.  One side-effect of that code is that when checking new
mail, zsh can't tell that maildirs are directories -- mailstat returns
data as if the folder were one huge file.  That's why it's so expensive
in the absence of the (broken) optimization.

} > Anyway, mailstat() is using a single static structure to keep track of
} > the last-modified time of the maildir "new" subdir. This means that it
} > only works correctly if you have exactly one maildir directory in your
} > mailpath
} 
} To understand this fully I seem to need to make a distinction: you say
} "exactly one maildir directory in your mailpath"  --  Does that mean that
} I must have only one *defined* in my mailpath, or only one in existence?

Exactly one named in the value of the mailpath parameter.

} (I'd be quite satisfied, for now at least, to have notification working
} just for my inbox.)

[...]

} Shouldn't notification be working if I just have either of these defined
} in my .zshrc:
} 
}             export MAIL=$HOME/.mailspool/rj
} 
} or:         mailpath=($HOME/.mailspool/rj'?New mail has arrived.')

That should work, but see below.

} (btw, should the opening quote-mark above be where it is, or should it
} be just before ``$HOME'', or does it matter?)

It does matter; you have it right.

} (a)  From within either mutt's index or pager, I press `e' in mutt
}      to edit the raw message;

If you have mutt (or any of several other mail programs) running
continuously in another window, zsh won't regularly notify you of new
mail no matter what the mailbox format is, because there is a race
between mutt and the shell to see which one finds the new message
first.  Once mutt finds the message and adds it to its index, the
file access time will have changed and zsh won't consider the message
to be new any more.

If your maildirs are on NFS-mounted file systems, NFS attribute caching
can also affect whether zsh correctly detects new mail.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New mail notification not working
  2001-08-19 18:39 Russell Hoover
@ 2001-08-19 18:55 ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2001-08-19 18:55 UTC (permalink / raw)
  To: Russell Hoover, zsh-users

On Aug 19,  2:39pm, Russell Hoover wrote:
} Subject: New mail notification not working
}
} I'm using the maildir mailbox format with mutt.
} and I cannot get the "You have new mail." to show in zsh.

If you built zsh yourself, try recompiling it with --enable-maildir-support.

Otherwise, zsh only checks for files that have changed -- that is, files
whose modify time is the same as or more recent than their access time.  If
the newly created files in your maildir "new" subdirectory don't have that
property, zsh won't report them as new mail.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* New mail notification not working
@ 2001-08-19 18:39 Russell Hoover
  2001-08-19 18:55 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Russell Hoover @ 2001-08-19 18:39 UTC (permalink / raw)
  To: zsh-users

I'm using zsh-4.0.2 on NetBSD-1.5.1 with mutt-1.2.5i (mutt compiled with S-Lang).
I'm using the maildir mailbox format with mutt.

In my .zshenv I have:

export MAIL=$HOME/.mailspool/rj
export MAILPATH=$HOME/.mailspool/rj:$HOME/Mail/trash'?New mail in trashbox.'

and I cannot get the "You have new mail." to show in zsh.


If the following is relevant (though I don't think it should be), I also have:

in .zprofile:
biff n

and in .zshrc:
setopt NO_MAIL_WARNING

Any advice welcome.

-- 
                                 // rj@panix.com //
                     GUI -- what your computer becomes after
                 spilling your coffee on it. (pronounced 'gooey')


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-09 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 17:33 New mail notification not working Russell Hoover
2001-09-09 18:25 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2001-08-19 18:39 Russell Hoover
2001-08-19 18:55 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).