Package: vacation
Version: 3.3.0-0.2
Severity: wishlist
Tags: patch
hi,
vacation can't be used from MDA, sice it's supposed to be run by a
priviledged user, as it invokes sendmail with -f.
Perhaps that's not stressed enough in the docs.
However my typical use would be from procmail, ie it'd run as normal user.
So I added a -u switch to tell vacation to use sendmail -t instead - pls
see diff below of my current deb-src against 3.3.0-0.2.
WFM.
--
paolo
#--------------------------------------------------------------------------
diff -b -urN vacation-3.3.0/debian/changelog vacation-3.3.0-1/debian/changelog
--- vacation-3.3.0/debian/changelog Wed May 3 22:00:05 2006
+++ vacation-3.3.0-1/debian/changelog Thu Mar 8 10:49:10 2007
@@ -1,3 +1,9 @@
+vacation (3.3.0-1) unstable; urgency=low
+
+ * added -u option: don't try to use sendmail -f,use sendmail -t instead
+
+ -- paolop <[EMAIL PROTECTED]> Thu, 8 Mar 2007 10:49:01 +0100
+
vacation (3.3.0-0.2) unstable; urgency=low
* NMU
diff -b -urN vacation-3.3.0/test vacation-3.3.0-1/test
--- vacation-3.3.0/test Thu Jan 1 01:00:00 1970
+++ vacation-3.3.0-1/test Thu Mar 8 00:52:39 2007
@@ -0,0 +1,5 @@
+From: [EMAIL PROTECTED]
+Subject; (prova): $SUBJECT
+
+messaggio vacation di prova
+
diff -b -urN vacation-3.3.0/vacation.1 vacation-3.3.0-1/vacation.1
--- vacation-3.3.0/vacation.1 Sun Jun 15 03:53:43 2003
+++ vacation-3.3.0-1/vacation.1 Thu Mar 8 20:55:06 2007
@@ -51,6 +51,7 @@
.Op Fl f Ar db
.Op Fl m Ar msg
.Op Fl j
+.Op Fl u
.Op Fl z
.Ar login
.Sh DESCRIPTION
@@ -118,6 +119,9 @@
dangerous, as it allows mailers to get into
.Dq I am on vacation
loops.
+.It Fl u
+Allows usage of vacation from MDA, or whenever the invoking user (process)
+is not allowed to set return-path (sendmail's -f option).
.It Fl x
Reads a list of addresses from standard input, one per line, and adds
them to the vacation database.
diff -b -urN vacation-3.3.0/vacation.c vacation-3.3.0-1/vacation.c
--- vacation-3.3.0/vacation.c Sun Jun 15 03:44:56 2003
+++ vacation-3.3.0-1/vacation.c Thu Mar 8 20:59:04 2007
@@ -141,7 +141,7 @@
int recent(void);
time_t lookup(const char *, size_t);
void setreply(const char *, size_t, time_t);
-void sendmessage(const char *, const char *);
+void sendmessage(const char *, const char *, int);
void usage(void);
void listdb(void);
int isdelim(int);
@@ -156,14 +156,14 @@
struct passwd *pw;
ALIAS *cur;
time_t interval;
- int ch, iflag, lflag, xflag, zflag;
+ int ch, iflag, lflag, uflag, xflag, zflag;
char *dbfilename = (char *)VDB;
char *msgfilename = (char *)VMSG;
openlog("vacation", LOG_PERROR, LOG_MAIL);
- opterr = iflag = lflag = xflag = zflag = 0;
+ opterr = iflag = lflag = uflag = xflag = zflag = 0;
interval = -1;
- while ((ch = getopt(argc, argv, "a:df:Iijlm:r:t:xz")) != -1)
+ while ((ch = getopt(argc, argv, "a:df:Iijlm:r:t:xuz")) != -1)
switch((char)ch) {
case 'a': /* alias */
cur = xmalloc(sizeof(ALIAS));
@@ -205,6 +205,9 @@
case 't':
break;
*/
+ case 'u':
+ uflag = 1;
+ break;
case 'x':
xflag = 1;
break;
@@ -279,7 +282,7 @@
if (!recent()) {
setreply(from, strlen(from), time(NULL));
(db->close)(db);
- sendmessage(zflag ? "<>" : pw->pw_name, msgfilename);
+ sendmessage(zflag ? "<>" : pw->pw_name, msgfilename, uflag);
}
else
(db->close)(db);
@@ -502,7 +505,7 @@
* sendmessage --
* exec sendmail to send the vacation file to sender
*/
-void sendmessage(const char *myname, const char *msgfile)
+void sendmessage(const char *myname, const char *msgfile, int uflag)
{
FILE *mfp, *sfp;
int i;
@@ -528,6 +531,9 @@
close(pvect[0]);
close(pvect[1]);
fclose(mfp);
+ if (uflag)
+ execl(_PATH_SENDMAIL, "sendmail", "-oi", "-t", NULL);
+ else
execl(_PATH_SENDMAIL, "sendmail", "-f", myname, "--",
from, NULL);
msglog(LOG_ERR, "can't exec %s: %m", _PATH_SENDMAIL);
@@ -553,7 +559,7 @@
void usage(void)
{
- msglog(LOG_NOTICE, "uid %u: usage: vacation [-i] [-r interval] [-a
alias] [-f db] [-m msg] [-j] [-l] [-x] [-z] login\n",
+ msglog(LOG_NOTICE, "uid %u: usage: vacation [-i] [-r interval] [-a
alias] [-f db] [-m msg] [-j] [-l] [-u] [-x] [-z] login\n",
getuid());
exit(1);
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]