summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/vacation
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-04-10 03:05:00 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-04-10 03:05:00 +0000
commit9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84 (patch)
tree348e6162af337e0b74db963f6e4dcc567e2f99e9 /contrib/sendmail/vacation
parent1a7e50d796833cbb4346a251bc88555ea2c58e94 (diff)
downloadFreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.zip
FreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.tar.gz
Import sendmail 8.12.3
Diffstat (limited to 'contrib/sendmail/vacation')
-rw-r--r--contrib/sendmail/vacation/vacation.167
-rw-r--r--contrib/sendmail/vacation/vacation.c15
2 files changed, 59 insertions, 23 deletions
diff --git a/contrib/sendmail/vacation/vacation.1 b/contrib/sendmail/vacation/vacation.1
index 666070e..299df64 100644
--- a/contrib/sendmail/vacation/vacation.1
+++ b/contrib/sendmail/vacation/vacation.1
@@ -9,12 +9,12 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: vacation.1,v 8.26 2001/11/21 04:21:35 gshapiro Exp $
+.\" $Id: vacation.1,v 8.29 2002/03/23 19:17:36 gshapiro Exp $
.\"
-.TH VACATION 1 "$Date: 2001/11/21 04:21:35 $"
+.TH VACATION 1 "$Date: 2002/03/23 19:17:36 $"
.SH NAME
vacation
-\- return ``I am not here'' indication
+\- E-mail auto-responder
.SH SYNOPSIS
.B vacation
.RB [ \-a
@@ -41,8 +41,14 @@ vacation
.I login
.SH DESCRIPTION
.B Vacation
-returns a message to the sender of a message telling them that you
-are currently not reading your mail. The intended use is in a
+returns a message,
+.IR ~/.vacation.msg
+by default, to the sender informing them that you are currently not
+reading your mail.
+The message is only sent to each sender once per reply interval (see
+.B \-r
+below).
+The intended use is in a
.I .forward
file. For example, your
.I .forward
@@ -80,6 +86,9 @@ with incorrect arguments, or with non-existent
.IR login s,
are logged in the system log file, using
syslog(8).
+This should only be used on the command line, not in your
+.I .forward
+file.
.TP
.BI \-f " filename"
Use
@@ -97,11 +106,24 @@ Initialize the vacation database files. It should be used
before you modify your
.I .forward
file.
+This should only be used on the command line, not in your
+.I .forward
+file.
.TP
.B \-I
Same as
.B \-i
(for backwards compatibility).
+This should only be used on the command line, not in your
+.I .forward
+file.
+.TP
+.B \-l
+List the content of the vacation database file including the address
+and the associated time of the last auto-response to that address.
+This should only be used on the command line, not in your
+.I .forward
+file.
.TP
.BI \-m " filename"
Use
@@ -112,10 +134,6 @@ Unless the
.I filename
starts with / it is relative to ~.
.TP
-.B \-l
-List the content of the vacation database file including the address
-and the associated time of the last auto-response to that address.
-.TP
.BI \-r " interval"
Set the reply interval to
.I interval
@@ -124,6 +142,12 @@ An interval of ``0'' or
``infinite''
(actually, any non-numeric character) will never send more than
one reply.
+The
+.B \-r
+option should only be used when the vacation database is initialized
+(see
+.B \-i
+above).
.TP
.BI \-s " address"
Use
@@ -144,13 +168,16 @@ The -f and -m options must be used to specify the database and message file
since there is no home directory for the default settings for these options.
.TP
.B \-x
-reads an exclusion list from stdin (one address per line).
+Reads an exclusion list from stdin (one address per line).
Mails coming from an address
in this exclusion list won't get a reply by
.BR vacation .
It is possible to exclude complete domains by specifying
``@domain''
as element of the exclusion list.
+This should only be used on the command line, not in your
+.I .forward
+file.
.TP
.B \-z
Set the sender of the vacation message to
@@ -159,6 +186,16 @@ instead of the user.
This probably violates the RFCs since vacation messages are
not required by a standards-track RFC to have a null reverse-path.
.PP
+.B Vacation
+reads the first line from the standard input for a
+UNIX
+``From''
+line to determine the sender.
+Sendmail(8)
+includes this
+``From''
+line automatically.
+.PP
No message will be sent unless
.I login
(or an
@@ -213,16 +250,6 @@ I am on vacation until July 22. If you have something urgent,
please contact Keith Bostic <bostic@CS.Berkeley.EDU>.
--eric
.fi
-.PP
-.B Vacation
-reads the first line from the standard input for a
-UNIX
-``From''
-line to determine the sender.
-Sendmail(8)
-includes this
-``From''
-line automatically.
.SH FILES
.TP 1.8i
~/.vacation.db
diff --git a/contrib/sendmail/vacation/vacation.c b/contrib/sendmail/vacation/vacation.c
index ec69541..fa9c96d 100644
--- a/contrib/sendmail/vacation/vacation.c
+++ b/contrib/sendmail/vacation/vacation.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1987, 1993
* The Regents of the University of California. All rights reserved.
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
The Regents of the University of California. All rights reserved.\n\
Copyright (c) 1983 Eric P. Allman. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Id: vacation.c,v 8.131 2001/12/12 00:02:42 gshapiro Exp $")
+SM_IDSTR(id, "@(#)$Id: vacation.c,v 8.134 2002/03/01 20:45:00 ca Exp $")
#include <ctype.h>
@@ -319,7 +319,7 @@ main(argc, argv)
SM_CF_OPT_T mbdbname;
SM_MBDB_T user;
- cfpath = getcfname(0, 0, SM_GET_SENDMAIL_CF, NULL);
+ cfpath = getcfname(0, 0, SM_GET_SENDMAIL_CF, cfpath);
mbdbname.opt_name = "MailboxDatabase";
mbdbname.opt_val = "pw";
(void) sm_cf_getopt(cfpath, 1, &mbdbname);
@@ -370,6 +370,15 @@ main(argc, argv)
RunAsGid = user_info.smdbu_group_id = getegid();
sff |= SFF_OPENASROOT;
}
+ if (getuid() == 0)
+ {
+ /* Allow root to initialize user's vacation databases */
+ sff |= SFF_OPENASROOT|SFF_ROOTOK;
+
+ /* ... safely */
+ sff |= SFF_NOSLINK|SFF_NOHLINK|SFF_REGONLY;
+ }
+
result = smdb_open_database(&Db, dbfilename,
O_CREAT|O_RDWR | (iflag ? O_TRUNC : 0),
OpenPOWER on IntegriCloud