summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail
diff options
context:
space:
mode:
authormikeh <mikeh@FreeBSD.org>2001-06-14 01:08:30 +0000
committermikeh <mikeh@FreeBSD.org>2001-06-14 01:08:30 +0000
commit3979a82a111d0d9b1fcc24137b7826d4eba0de01 (patch)
treed65f1671eab412f8ae3e9598a873cd82b801a3ac /usr.bin/mail
parent2f9709c0f1e1952c3be380e8b407a98632986680 (diff)
downloadFreeBSD-src-3979a82a111d0d9b1fcc24137b7826d4eba0de01.zip
FreeBSD-src-3979a82a111d0d9b1fcc24137b7826d4eba0de01.tar.gz
Respect REPLYTO in mailrc.
PR: bin/8322 Submitted by: Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de> MFC after: 2 weeks
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/cmd3.c6
-rw-r--r--usr.bin/mail/mail.13
-rw-r--r--usr.bin/mail/main.c6
-rw-r--r--usr.bin/mail/send.c3
4 files changed, 8 insertions, 10 deletions
diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c
index 6cb5c1d..4ead961 100644
--- a/usr.bin/mail/cmd3.c
+++ b/usr.bin/mail/cmd3.c
@@ -260,8 +260,7 @@ dorespond(msgvec)
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 = value("REPLYTO");
head.h_inreplyto = skin(hfield("message-id", mp));
mail1(&head, 1);
return (0);
@@ -626,8 +625,7 @@ doRespond(msgvec)
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 = value("REPLYTO");
head.h_inreplyto = mid;
mail1(&head, 1);
return (0);
diff --git a/usr.bin/mail/mail.1 b/usr.bin/mail/mail.1
index bd0e7fe..ed67cc3 100644
--- a/usr.bin/mail/mail.1
+++ b/usr.bin/mail/mail.1
@@ -821,6 +821,9 @@ commands.
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 is not set,
+.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 --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c
index 633febc..0421a88 100644
--- a/usr.bin/mail/main.c
+++ b/usr.bin/mail/main.c
@@ -93,7 +93,6 @@ main(argc, argv)
bcc = NULL;
smopts = NULL;
subject = NULL;
- replyto = NULL;
while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) {
switch (i) {
case 'T':
@@ -219,14 +218,13 @@ Usage: %s [-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
* for fopen, so it's safe to do this.
*/
load(expand("~/.mailrc"));
+
+ replyto = value("REPLYTO");
if (!rcvmode) {
mail(to, cc, bcc, smopts, subject, replyto);
/*
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c
index 4d4e2de..0e6886c 100644
--- a/usr.bin/mail/send.c
+++ b/usr.bin/mail/send.c
@@ -287,8 +287,7 @@ sendmail(str)
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 = value("REPLYTO");
head.h_inreplyto = NULL;
mail1(&head, 0);
return (0);
OpenPOWER on IntegriCloud