summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/cmd3.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/cmd3.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/cmd3.c')
-rw-r--r--usr.bin/mail/cmd3.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c
index bb0c1e5..b4d7d44 100644
--- a/usr.bin/mail/cmd3.c
+++ b/usr.bin/mail/cmd3.c
@@ -187,9 +187,9 @@ respond(msgvec)
int *msgvec;
{
if (value("Replyall") == NOSTR)
- return (_respond(msgvec));
+ return (dorespond(msgvec));
else
- return (_Respond(msgvec));
+ return (doRespond(msgvec));
}
/*
@@ -197,7 +197,7 @@ respond(msgvec)
* message header and send them off to mail1()
*/
int
-_respond(msgvec)
+dorespond(msgvec)
int *msgvec;
{
struct message *mp;
@@ -252,6 +252,9 @@ _respond(msgvec)
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 = skin(hfield("message-id", mp));
mail1(&head, 1);
return(0);
}
@@ -581,9 +584,9 @@ Respond(msgvec)
int *msgvec;
{
if (value("Replyall") == NOSTR)
- return (_Respond(msgvec));
+ return (doRespond(msgvec));
else
- return (_respond(msgvec));
+ return (dorespond(msgvec));
}
/*
@@ -592,13 +595,14 @@ Respond(msgvec)
* reply.
*/
int
-_Respond(msgvec)
+doRespond(msgvec)
int msgvec[];
{
struct header head;
struct message *mp;
register int *ap;
register char *cp;
+ char *mid;
head.h_to = NIL;
for (ap = msgvec; *ap != 0; ap++) {
@@ -608,6 +612,7 @@ _Respond(msgvec)
if ((cp = skin(hfield("from", mp))) == NOSTR)
cp = skin(nameof(mp, 2));
head.h_to = cat(head.h_to, extract(cp, GTO));
+ mid = skin(hfield("message-id", mp));
}
if (head.h_to == NIL)
return 0;
@@ -618,6 +623,9 @@ _Respond(msgvec)
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 = mid;
mail1(&head, 1);
return 0;
}
OpenPOWER on IntegriCloud