summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/main.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/main.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/main.c')
-rw-r--r--usr.bin/mail/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c
index d6499bb..7c66fa4 100644
--- a/usr.bin/mail/main.c
+++ b/usr.bin/mail/main.c
@@ -61,8 +61,8 @@ main(argc, argv)
{
register int i;
struct name *to, *cc, *bcc, *smopts;
- char *subject;
- char *ef;
+ char *subject, *replyto;
+ char *ef, *cp;
char nosrc = 0;
void hdrstop();
sig_t prevint;
@@ -90,6 +90,7 @@ main(argc, argv)
bcc = NIL;
smopts = NIL;
subject = NOSTR;
+ replyto = NOSTR;
while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) {
switch (i) {
case 'T':
@@ -220,6 +221,8 @@ Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
if (*s != '\0')
load(s);
}
+ if ((cp = getenv("REPLYTO")) != NULL)
+ replyto = cp;
/*
* Expand returns a savestr, but load only uses the file name
@@ -227,7 +230,7 @@ Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
*/
load(expand("~/.mailrc"));
if (!rcvmode) {
- mail(to, cc, bcc, smopts, subject);
+ mail(to, cc, bcc, smopts, subject, replyto);
/*
* why wait?
*/
OpenPOWER on IntegriCloud