summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/send.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1998-01-02 16:44:13 +0000
committerjoerg <joerg@FreeBSD.org>1998-01-02 16:44:13 +0000
commit00289accda875898bb2dc93c3681d29d455634b9 (patch)
treec5616b133fbc09fe9fe5be1eed1d4fb141ca377f /usr.bin/mail/send.c
parent197f0b69d78a1b5722ee9fea48afbe26936aa5f2 (diff)
downloadFreeBSD-src-00289accda875898bb2dc93c3681d29d455634b9.zip
FreeBSD-src-00289accda875898bb2dc93c3681d29d455634b9.tar.gz
Teach boring old mail(1) about the use of the REPLYTO environment
variable which is de-facto standard for MUAs. Teach bomail to generate an in-reply-to header so threading MUAs and mail->news gateways won't lose context. While i was at it, removed two gratuitous standard violations for functions starting with an underscore.
Diffstat (limited to 'usr.bin/mail/send.c')
-rw-r--r--usr.bin/mail/send.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c
index 063e6ad..f9b7c87 100644
--- a/usr.bin/mail/send.c
+++ b/usr.bin/mail/send.c
@@ -251,9 +251,9 @@ statusput(mp, obuf, prefix)
* which does all the dirty work.
*/
int
-mail(to, cc, bcc, smopts, subject)
+mail(to, cc, bcc, smopts, subject, replyto)
struct name *to, *cc, *bcc, *smopts;
- char *subject;
+ char *subject, *replyto;
{
struct header head;
@@ -262,6 +262,8 @@ mail(to, cc, bcc, smopts, subject)
head.h_cc = cc;
head.h_bcc = bcc;
head.h_smopts = smopts;
+ head.h_replyto = replyto;
+ head.h_inreplyto = NOSTR;
mail1(&head, 0);
return(0);
}
@@ -282,6 +284,9 @@ sendmail(str)
head.h_cc = NIL;
head.h_bcc = NIL;
head.h_smopts = NIL;
+ if ((head.h_replyto = getenv("REPLYTO")) == NULL)
+ head.h_replyto = NOSTR;
+ head.h_inreplyto = NOSTR;
mail1(&head, 0);
return(0);
}
@@ -437,7 +442,7 @@ infix(hp, fi)
return(fi);
}
(void) rm(tempMail);
- (void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GNL|GCOMMA);
+ (void) puthead(hp, nfo, GTO|GSUBJECT|GCC|GBCC|GREPLYTO|GINREPLYTO|GNL|GCOMMA);
c = getc(fi);
while (c != EOF) {
(void) putc(c, nfo);
@@ -483,6 +488,10 @@ puthead(hp, fo, w)
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_replyto != NOSTR && w && GREPLYTO)
+ fprintf(fo, "Reply-To: %s\n", hp->h_replyto), gotcha++;
+ if (hp->h_inreplyto != NOSTR && w && GINREPLYTO)
+ fprintf(fo, "In-Reply-To: <%s>\n", hp->h_inreplyto), gotcha++;
if (gotcha && w & GNL)
(void) putc('\n', fo);
return(0);
OpenPOWER on IntegriCloud