From gpalmer@orion.webspan.net  Fri Sep  6 08:25:24 1996
Received: from orion.webspan.net (root@orion.webspan.net [206.154.70.41])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA00861
          for <freebsd-gnats-submit@freebsd.org>; Fri, 6 Sep 1996 08:25:23 -0700 (PDT)
Received: from localhost (gpalmer@localhost [127.0.0.1]) 
          by orion.webspan.net (8.7.5/8.6.12) with SMTP id LAA23940
          for <freebsd-gnats-submit@freebsd.org>; Fri, 6 Sep 1996 11:25:14 -0400 (EDT)
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.4]) 
          by orion.webspan.net (8.7.5/8.6.12) with ESMTP id AAA14952
          for <gpalmer@webspan.net>; Fri, 6 Sep 1996 00:54:27 -0400 (EDT)
Received: (from nobody@localhost)
          by freefall.freebsd.org (8.7.5/8.7.3) id VAA21206;
          Thu, 5 Sep 1996 21:50:16 -0700 (PDT)
Message-Id: <199609060450.VAA21206@freefall.freebsd.org>
Date: Thu, 5 Sep 1996 21:50:16 -0700 (PDT)
From: sef@kithrup.com
To: gnats-admin@freebsd.org
Subject: mail -f foo does not look in current directory of .mailrc has chdir
X-Send-Pr-Version: www-1.0

>Number:         1577
>Category:       bin
>Synopsis:       mail -f foo does not look in current directory of .mailrc has chdir
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep  6 08:30:01 PDT 1996
>Closed-Date:    Sun Nov 7 19:52:57 PST 1999
>Last-Modified:  Sun Nov  7 19:55:25 PST 1999
>Originator:     Sean Eric Fagan
>Release:        2.1.5-RELEASE
>Organization:
Kithrup Enterprises, Ltd.
>Environment:
FreeBSD garth.kithrup.com 2.1.5-RELEASE FreeBSD 2.1.5-RELEASE #0: Wed Aug 28 19:46:19 PDT 1996     root@garth.kithrup.com:/usr/src/sys/compile/GARTH  i386

>Description:
Mail handles -f options after it processes the .mailrc; this results in
"mail -f foo" not having the desired effect if there is a "cd" command
in the $HOME/.mailrc file.

>How-To-Repeat:
echo "cd $HOME" >> $HOME/.mailrc
cd /tmp
create_a_mail_file_some_how_in_/tmp
mail -f mail_file

>Fix:

>Release-Note:
>Audit-Trail:

From: A Joseph Koshy <koshy@india.hp.com>
To: freebsd-gnats-submit@freebsd.org, sef@kithrup.com
Cc: phk@freebsd.org
Subject: Re: bin/1577: mail -f foo does not look in current directory of .mailrc has chdir
Date: Fri, 17 Apr 1998 14:23:43 +0530

 I just looked at PR bin/1577.  
 
 To me it seems that the behaviour of `mail' is consistent.  Given that
 
 (a) .mailrc (and the system RC files) are read in before anything else
     is done
 
 		AND
 
 (b) the RC files support most user commands including "chdir"
 
 the behaviour of "-f" is what a user would expect.
 
 Here is a patch to the documentation that specifies the startup behaviour,
 for v1.15 of "/usr/src/usr.bin/mail/mail.1": (should patch cleanly in
 both -STABLE and -CURRENT)
 
 (In /usr/src/usr.bin/mail):
 ================================================
 --- ./mail.1	Tue Apr 14 18:06:28 1998
 +++ /tmp/mail.1	Fri Apr 17 14:29:10 1998
 @@ -112,6 +112,23 @@
  .Pp
  .Dl mail -f /var/mail/user
  .El
 +.Ss Startup actions
 +At startup time
 +.Nm mail 
 +will execute commands in the system command files
 +.Pa /usr/share/misc/mail.rc , 
 +.Pa /usr/local/etc/mail.rc 
 +and
 +.Pa /etc/mail.rc 
 +in order unless explicitly told not to by using the
 +.Fl n
 +option.  Next, the commands in the users personal command file 
 +.Pa ~/.mailrc 
 +are executed.
 +.Nm mail
 +then examines its command line options to determine whether the user
 +requested a new message to be sent or existing messages in a mailbox
 +to be examined.
  .Ss Sending mail
  To send a message to one or more people,
  .Nm mail
 ================================================
 
 
 Regards,
 Koshy					<<My Personal Opinions Only>>
Responsible-Changed-From-To: freebsd-bugs->	peter 
Responsible-Changed-By: phk 
Responsible-Changed-When: Sun Apr 26 23:57:01 PDT 1998 
Responsible-Changed-Why:  
->peter 
State-Changed-From-To: open->closed 
State-Changed-By: jkoshy 
State-Changed-When: Sun Nov 7 19:52:57 PST 1999 
State-Changed-Why:  
Fixed in rev 1.17 of src/usr.bin/mail/mail.1. 
>Unformatted:
