[gnu.emacs.bug] rmail.el should obey bash's MAILPATH

pinard@EDDIE.MIT.EDU (Francois Pinard) (12/27/89)

In GNU Emacs 18.54.2 of Fri May 12 1989 on ouareau (berkeley-unix)

When rmail-primary-inbox-list is nil, rmail.el(rmail) dynamically
constructs it using rmail-spool-directory, then $LOGNAME or $USER.
Under bash, the user inbox is described by $MAILPATH.  I believe rmail
should first check for the existence of $MAILPATH first.

It would also be nice if, rmail-spool-directory being preset to nil,
rmail.el(rmail-insert-inbox-text) was able to deduce it dynamically
first using $MAILPATH or as per in paths.el.

On this site, primary inbox names depend upon the NFS location of the
home directory.  So, the value of rmail-spool-directory cannot be made
unique for all users in paths.el.  If one manages to have MAILPATH
properly set, everything else should ideally fall in place.

-- 
Franc,ois Pinard                                    pinard@iro.umontreal.ca
(514) 588-4656           ``Vivement GNU!''          ...!uunet!iros1!pinard

rlk@think.com (Robert Krawitz) (12/28/89)

In article <8912261600.AA01743@ouareau.IRO.UMontreal.CA>, mcgill-vision!iros1!pinard@EDDIE (Francois Pinard) writes:
]When rmail-primary-inbox-list is nil, rmail.el(rmail) dynamically
]constructs it using rmail-spool-directory, then $LOGNAME or $USER.
]Under bash, the user inbox is described by $MAILPATH.  I believe rmail
]should first check for the existence of $MAILPATH first.

Does any program but bash actually use this convention?

]On this site, primary inbox names depend upon the NFS location of the
]home directory.  So, the value of rmail-spool-directory cannot be made
]unique for all users in paths.el.  If one manages to have MAILPATH
]properly set, everything else should ideally fall in place.

1)  What do mail/Mail/mh users do?  None of these programs, from
straight out of the can, use MAILPATH to the best of my knowledge.

2)  This is simple enough to do, in any event.  Simply put the following
in default-profile.el:

(setq rmail-spool-directory (or (getenv "MAILPATH") rmail-spool-directory))

(you may wish to set rmail-primary-inbox-list or whatnot).

Putting everyone's favorite site-specific hack into rmail (or any other
emacs lisp program) is a bad idea.  It increases the amount of clutter,
which makes the code harder to maintain and configure.  The whole point
of having an extension language like emacs lisp is to enable individuals
and sites to do significant customizations themselves.
-- 
ames >>>>>>>>>  |	Robert Krawitz <rlk@think.com>	245 First St.
bloom-beacon >  |think!rlk	(postmaster)		Cambridge, MA  02142
harvard >>>>>>  .	Thinking Machines Corp.		(617)876-1111

chet@cwns1.CWRU.EDU (Chet Ramey) (12/29/89)

In article <32484@news.Think.COM> rlk@think.com (Robert Krawitz) writes:
>In article <8912261600.AA01743@ouareau.IRO.UMontreal.CA>, mcgill-vision!iros1!pinard@EDDIE (Francois Pinard) writes:

>]Under bash, the user inbox is described by $MAILPATH.  I believe rmail
>]should first check for the existence of $MAILPATH first.
>
>Does any program but bash actually use this convention?

bash, sh, ksh, ash -- basically any post-Sys V.2 sh implementation uses it
(which means sh on almost any system but 4.3 BSD or Ultrix).  It's a
generalization of $MAIL that lets you watch a number of different files and
specify a custom message for each file watched. 

Here's a quote from a manual page:

          MAILPATH
               A colon (:) separated list of filenames.  If  this
               parameter  is  set,  the shell informs the user of
               the arrival of mail in any of the specified files.
               Each  filename  can be followed by % and a message
               that will be printed when  the  modification  time
               changes.  The default message is "you have mail."

(For ksh and bash, the message is `you have mail in $_', where $_ expands
to the filename.)


-- 
Chet Ramey
Network Services Group				"Where's my froggie?"
Case Western Reserve University
chet@ins.CWRU.Edu			

jbw@bucsf.bu.edu (Joe Wells) (01/21/90)

In article <8912261600.AA01743@ouareau.IRO.UMontreal.CA> mcgill-vision!iros1!pinard@EDDIE.MIT.EDU (Francois Pinard) writes:

   When rmail-primary-inbox-list is nil, rmail.el(rmail) dynamically
   constructs it using rmail-spool-directory, then $LOGNAME or $USER.
   Under bash, the user inbox is described by $MAILPATH.  I believe rmail
   should first check for the existence of $MAILPATH first.

The contents of the environment variable MAILPATH do not necessarily have
anything to do with the mail spool files that should be checked for new
mail.  MAILPATH is used to have ksh/bash check timestamps on certain files
and print certain messages.  These files are not necessarily mail spool
files, nor do they need to belong to the user.

In summary, it is dangerous to presume that the contents of the
environment variable MAILPATH point to the user's mail spool files.

-- 
Joe Wells <jbw@bucsf.bu.edu>
jbw%bucsf.bu.edu@bu-it.bu.edu
...!harvard!bu-cs!bucsf!jbw