From abc@froggy.anchorage.ptialaska.net  Wed Oct 14 20:28:44 1998
Received: from froggy.anchorage.ptialaska.net (froggy.anchorage.ptialaska.net [208.151.119.238])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA23555
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 Oct 1998 20:28:12 -0700 (PDT)
          (envelope-from abc@froggy.anchorage.ptialaska.net)
Received: (from abc@localhost)
	by froggy.anchorage.ptialaska.net (8.8.8/8.8.8) id DAA03188;
	Thu, 15 Oct 1998 03:29:06 GMT
	(envelope-from abc)
Message-Id: <199810150329.DAA03188@froggy.anchorage.ptialaska.net>
Date: Thu, 15 Oct 1998 03:29:06 GMT
From: groggy@iname.com
Reply-To: groggy@iname.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Mail doesn't respect REPLYTO in .mailrc
X-Send-Pr-Version: 3.2

>Number:         8322
>Category:       bin
>Synopsis:       Mail doesn't respect REPLYTO in .mailrc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mikeh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 14 20:30:01 PDT 1998
>Closed-Date:    Wed Jun 27 16:14:56 PDT 2001
>Last-Modified:  Wed Jun 27 16:15:37 PDT 2001
>Originator:     Steve Howe
>Release:        FreeBSD 2.2.7-RELEASE i386
>Organization:
none
>Environment:
sh shell

	sh and ~/.mailrc

>Description:

	if you (according to the manpage) say "set REPLYTO=abc@xyz.net"
        in your ~/.mailrc file, the "Reply-To:" field remains unaltered.

>How-To-Repeat:

	Insert a "set REPLYTO=abc@xyz.net" line in your
        ~/.mailrc file.

>Fix:
	
	you must work around this problem by saying
        "export REPLYTO=abc@xyz.net" in the sh shell
        before starting Mail.  (It would be nice to
        be able to set "From:" also, which is not
        currently possible.  it is VERY necessary
        when mailing from CGI scripts (internet
        shops, etc) so that you can mail on the
        command line without the sendee getting
        mail from Apache (ie - From: Unprivelaged User
        <nobody@xyz.net> )

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Sun Jun 3 21:55:21 PDT 2001 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=8322 

From: Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de>
To: freebsd-gnats-submit@FreeBSD.org, groggy@iname.com,
	mikeh@FreeBSD.org
Cc:  
Subject: Re: bin/8322: Mail doesn't respect REPLYTO in .mailrc
Date: Mon, 4 Jun 2001 15:14:34 +0200

 The first patch does a bit of cleaning up.
 The second patch replaces 'replyto=getenv("REPLYTO")' with
 'replyto=value("REPLYTO")', which looks at mail's internal
 variables first. This fixes the main bug mentioned in this PR.
 It also mentions in the man page that mail(1) will fall back
 to environment variables.
 
 I also have a patch to make the "From:" header configurable
 which I'll send in a second followup to this PR.
 
 
 
 diff -ru -x CVS mail/cmd3.c mail.new/cmd3.c
 --- mail/cmd3.c	Mon Jun  4 09:16:53 2001
 +++ mail.new/cmd3.c	Mon Jun  4 02:20:10 2001
 @@ -260,8 +260,7 @@
  		head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	if ((head.h_replyto = getenv("REPLYTO")) == NULL)
 -		head.h_replyto = NULL;
 +	head.h_replyto = getenv("REPLYTO");
  	head.h_inreplyto = skin(hfield("message-id", mp));
  	mail1(&head, 1);
  	return (0);
 @@ -626,8 +625,7 @@
  	head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	if ((head.h_replyto = getenv("REPLYTO")) == NULL)
 -		head.h_replyto = NULL;
 +	head.h_replyto = getenv("REPLYTO");
  	head.h_inreplyto = mid;
  	mail1(&head, 1);
  	return (0);
 diff -ru -x CVS mail/send.c mail.new/send.c
 --- mail/send.c	Mon Jun  4 09:16:54 2001
 +++ mail.new/send.c	Mon Jun  4 09:12:43 2001
 @@ -287,8 +287,7 @@
  	head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	if ((head.h_replyto = getenv("REPLYTO")) == NULL)
 -		head.h_replyto = NULL;
 +	head.h_replyto = getenv("REPLYTO");
  	head.h_inreplyto = NULL;
  	mail1(&head, 0);
  	return (0);
 
 
 
 
 
 
 diff -ru -x CVS mail/cmd3.c mail.new/cmd3.c
 --- mail/cmd3.c	Mon Jun  4 02:20:10 2001
 +++ mail.new/cmd3.c	Mon Jun  4 09:19:35 2001
 @@ -260,7 +260,7 @@
  		head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	head.h_replyto = getenv("REPLYTO");
 +	head.h_replyto = value("REPLYTO");
  	head.h_inreplyto = skin(hfield("message-id", mp));
  	mail1(&head, 1);
  	return (0);
 @@ -625,7 +625,7 @@
  	head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	head.h_replyto = getenv("REPLYTO");
 +	head.h_replyto = value("REPLYTO");
  	head.h_inreplyto = mid;
  	mail1(&head, 1);
  	return (0);
 diff -ru -x CVS mail/mail.1 mail.new/mail.1
 --- mail/mail.1	Mon Jun  4 02:11:30 2001
 +++ mail.new/mail.1	Sun Jun  3 13:48:05 2001
 @@ -821,6 +821,9 @@
  Options may be either binary, in which case it is only
  significant to see whether they are set or not; or string, in which
  case the actual value is of interest.
 +If an option has not been set then
 +.Nm
 +will look for an environment variable of the same name.
  The binary options include the following:
  .Bl -tag -width append
  .It Ar append
 diff -ru -x CVS mail/main.c mail.new/main.c
 --- mail/main.c	Mon Jun  4 01:55:10 2001
 +++ mail.new/main.c	Sun Jun  3 12:19:31 2001
 @@ -219,7 +219,7 @@
  			if (*s != '\0')
  				load(s);
  	}
 -	if ((cp = getenv("REPLYTO")) != NULL)
 +	if ((cp = value("REPLYTO")) != NULL)
  		replyto = cp;
  		
  	/*
 diff -ru -x CVS mail/send.c mail.new/send.c
 --- mail/send.c	Mon Jun  4 09:12:43 2001
 +++ mail.new/send.c	Mon Jun  4 09:20:04 2001
 @@ -287,7 +287,7 @@
  	head.h_cc = NULL;
  	head.h_bcc = NULL;
  	head.h_smopts = NULL;
 -	head.h_replyto = getenv("REPLYTO");
 +	head.h_replyto = value("REPLYTO");
  	head.h_inreplyto = NULL;
  	mail1(&head, 0);
  	return (0);
State-Changed-From-To: open->analyzed 
State-Changed-By: mikeh 
State-Changed-When: Wed Jun 13 18:10:50 PDT 2001 
State-Changed-Why:  
Fix has been applied to current, hold onto until MFC. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=8322 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mikeh 
State-Changed-When: Wed Jun 27 16:14:56 PDT 2001 
State-Changed-Why:  
Fix has been MFC'd. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=8322 
>Unformatted:
