[4394] in SIPB bug reports

home help back first fref pref prev next nref lref last post

"Reply-to" functionality for pmail

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Wed Feb 23 02:56:00 1994

Date: Tue, 22 Feb 1994 13:47:16 -0500
From: "Jonathan I. Kamens" <jik@security.ov.com>
To: bug-sipb@MIT.EDU
Cc: zchi@MIT.EDU

A while back, someone (I believe it was zchi@mit.edu) asked me to add
support for Reply-To to pmail.  I've done that in my master version,
and I thought you might want to install the patches in the SIPB
version as well.  I've appended them below.

BTW, you guys are going to mail me the Solaris patches so they can be
folded back into the master version, right?

  jik

*** cmd3.c	1991/11/10 23:21:00	1.5
--- cmd3.c	1994/02/22 18:36:29
***************
*** 229,234 ****
--- 229,235 ----
  	} else
  		head.h_cc = NIL;
  	head.h_bcc = NIL;
+ 	head.h_reply_to = extract(value("reply-to"), GREPLY_TO);
  	head.h_smopts = NIL;
  	mail1(&head, 1);
  	return(0);
***************
*** 587,592 ****
--- 588,594 ----
  	head.h_subject = reedit(head.h_subject);
  	head.h_cc = NIL;
  	head.h_bcc = NIL;
+ 	head.h_reply_to = extract(value("reply-to"), GREPLY_TO);
  	head.h_smopts = NIL;
  	mail1(&head, 1);
  	return 0;
*** collect.c	1991/11/10 23:21:37	1.5
--- collect.c	1994/02/22 18:16:10
***************
*** 207,213 ****
  			/*
  			 * Grab a bunch of headers.
  			 */
! 			grabh(hp, GTO|GSUBJECT|GCC|GBCC);
  			goto cont;
  		case 't':
  			/*
--- 207,213 ----
  			/*
  			 * Grab a bunch of headers.
  			 */
! 			grabh(hp, GTO|GSUBJECT|GCC|GBCC|GREPLY_TO);
  			goto cont;
  		case 't':
  			/*
***************
*** 323,329 ****
  			 */
  			rewind(collf);
  			printf("-------\nMessage contains:\n");
! 			puthead(hp, stdout, GTO|GSUBJECT|GCC|GBCC|GNL);
  			while ((t = getc(collf)) != EOF)
  				(void) putchar(t);
  			goto cont;
--- 323,330 ----
  			 */
  			rewind(collf);
  			printf("-------\nMessage contains:\n");
! 			puthead(hp, stdout,
! 				GTO|GSUBJECT|GCC|GBCC|GREPLY_TO|GNL);
  			while ((t = getc(collf)) != EOF)
  				(void) putchar(t);
  			goto cont;
*** def.h	1992/12/17 20:35:40	1.2
--- def.h	1994/02/22 18:03:06
***************
*** 137,148 ****
  #define	GSUBJECT 2		/* Likewise, Subject: line */
  #define	GCC	4		/* And the Cc: line */
  #define	GBCC	8		/* And also the Bcc: line */
! #define	GMASK	(GTO|GSUBJECT|GCC|GBCC)
  				/* Mask of places from whence */
  
! #define	GNL	16		/* Print blank line after */
! #define	GDEL	32		/* Entity removed from list */
! #define	GCOMMA	64		/* detract puts in commas */
  
  /*
   * Structure used to pass about the current
--- 137,149 ----
  #define	GSUBJECT 2		/* Likewise, Subject: line */
  #define	GCC	4		/* And the Cc: line */
  #define	GBCC	8		/* And also the Bcc: line */
! #define GREPLY_TO 16		/* And also the Reply-to: line */
! #define	GMASK	(GTO|GSUBJECT|GCC|GBCC|GREPLY_TO)
  				/* Mask of places from whence */
  
! #define	GNL	32		/* Print blank line after */
! #define	GDEL	64		/* Entity removed from list */
! #define	GCOMMA	128		/* detract puts in commas */
  
  /*
   * Structure used to pass about the current
***************
*** 154,159 ****
--- 155,161 ----
  	char *h_subject;		/* Subject string */
  	struct name *h_cc;		/* Carbon copies string */
  	struct name *h_bcc;		/* Blind carbon copies */
+ 	struct name *h_reply_to;	/* Reply-To addresses */
  	struct name *h_smopts;		/* Sendmail options */
  };
  
*** mail.1	1992/01/22 02:13:59	1.7
--- mail.1	1994/02/22 18:44:45
***************
*** 2799,2804 ****
--- 2799,2808 ----
  option)
  rather than in
  .Pa /var/spool/mail/$USER.
+ .Tp Ar reply-to
+ Specifies an address to place in the "Reply-to:" header of outgoing
+ mail messages.  The Reply-to header can be edited with the \&~h
+ escape.
  .Tp Ar Replyall
  Reverses the sense of
  .Ic reply
*** main.c	1991/11/10 23:21:57	1.8
--- main.c	1994/02/22 18:36:10
***************
*** 212,218 ****
  	 */
  	load(expand("~/.mailrc"));
  	if (!rcvmode) {
! 		mail(to, cc, bcc, smopts, subject);
  		/*
  		 * why wait?
  		 */
--- 212,219 ----
  	 */
  	load(expand("~/.mailrc"));
  	if (!rcvmode) {
! 		mail(to, cc, bcc, extract(value("reply-to"), GREPLY_TO),
! 		     smopts, subject);
  		/*
  		 * why wait?
  		 */
*** send.c	1992/01/22 02:08:01	1.5
--- send.c	1994/02/22 18:41:20
***************
*** 231,238 ****
   * Interface between the argument list and the mail1 routine
   * which does all the dirty work.
   */
! mail(to, cc, bcc, smopts, subject)
! 	struct name *to, *cc, *bcc, *smopts;
  	char *subject;
  {
  	struct header head;
--- 231,238 ----
   * Interface between the argument list and the mail1 routine
   * which does all the dirty work.
   */
! mail(to, cc, bcc, reply_to, smopts, subject)
! 	struct name *to, *cc, *bcc, *reply_to, *smopts;
  	char *subject;
  {
  	struct header head;
***************
*** 241,246 ****
--- 241,247 ----
  	head.h_subject = subject;
  	head.h_cc = cc;
  	head.h_bcc = bcc;
+ 	head.h_reply_to = reply_to;
  	head.h_smopts = smopts;
  	mail1(&head, 0);
  	return(0);
***************
*** 260,265 ****
--- 261,267 ----
  	head.h_subject = NOSTR;
  	head.h_cc = NIL;
  	head.h_bcc = NIL;
+ 	head.h_reply_to = extract(value("reply-to"), GREPLY_TO);
  	head.h_smopts = NIL;
  	mail1(&head, 0);
  	return(0);
***************
*** 423,429 ****
  		return(fi);
  	}
  	(void) remove(tempMail);
! 	(void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA);
  	c = getc(fi);
  	while (c != EOF) {
  		(void) putc(c, nfo);
--- 425,431 ----
  		return(fi);
  	}
  	(void) remove(tempMail);
! 	(void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GREPLY_TO|GNL|GCOMMA);
  	c = getc(fi);
  	while (c != EOF) {
  		(void) putc(c, nfo);
***************
*** 460,466 ****
  	FILE *fo;
  {
  	register int gotcha;
! 	char *name, string[256];
  	struct name np;
  
  	name = getenv("NAME");
--- 462,468 ----
  	FILE *fo;
  {
  	register int gotcha;
! 	char *name;
  	struct name np;
  
  	name = getenv("NAME");
***************
*** 478,484 ****
  		fmt("Cc:", hp->h_cc, fo, w&GCOMMA), gotcha++;
  	if (hp->h_bcc != NIL && w & GBCC)
  		fmt("Bcc:", hp->h_bcc, fo, w&GCOMMA), gotcha++;
! 
  	if (gotcha && w & GNL)
  		(void) putc('\n', fo);
  	return(0);
--- 480,487 ----
  		fmt("Cc:", hp->h_cc, fo, w&GCOMMA), gotcha++;
  	if (hp->h_bcc != NIL && w & GBCC)
  		fmt("Bcc:", hp->h_bcc, fo, w&GCOMMA), gotcha++;
! 	if (hp->h_reply_to != NIL && w & GREPLY_TO)
! 		fmt("Reply-to:", hp->h_reply_to, fo, w&GCOMMA), gotcha++;
  	if (gotcha && w & GNL)
  		(void) putc('\n', fo);
  	return(0);
*** tty.c	1991/11/10 23:22:24	1.5
--- tty.c	1994/02/22 18:10:00
***************
*** 111,116 ****
--- 111,126 ----
  		hp->h_bcc =
  			extract(readtty("Bcc: ", detract(hp->h_bcc, 0)), GBCC);
  	}
+ 	if (gflags & GREPLY_TO) {
+ #ifndef TIOCSTI
+ 		if (!ttyset && hp->h_reply_to != NIL)
+ 			ttyset++, stty(fileno(stdin), &ttybuf);
+ #endif
+ 		hp->h_reply_to =
+ 			extract(readtty("Reply-to: ",
+ 					detract(hp->h_reply_to, 0)),
+ 				GREPLY_TO);
+ 	}
  out:
  	signal(SIGTSTP, savetstp);
  	signal(SIGTTOU, savettou);

home help back first fref pref prev next nref lref last post