Sync from SUSE:SLFO:Main vacation revision b65d6381dabcc65243766d8226a5a268

This commit is contained in:
Adrian Schröter 2025-02-27 18:47:42 +01:00
commit 2d6a4029e7
11 changed files with 1146 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,63 @@
Basedo on 2ee6b2d137da843737fadd2fcdd7349600020f77 Mon Sep 17 00:00:00 2001
From: Chris Samuel <chris@csamuel.org>
Date: Sun, 1 Dec 2013 23:28:50 +1100
Subject: [PATCH] Patch to handle long (folded) headers from Zdenek Havranek
---
ChangeLog | 3 +++
vacation.c | 23 +++++++++++++++++++----
5 files changed, 33 insertions(+), 18 deletions(-)
--- ChangeLog
+++ ChangeLog 2015-09-08 12:14:58.201720884 +0000
@@ -1,3 +1,6 @@
+2013/12/01
+- Patch to handle long (folded) headers from Zdenek Havranek
+
2011/11/06
- Fix location for tarballs in the vacation.spec file.
- Tagged and released Vacation 1.2.7.1.
--- vacation.c
+++ vacation.c 2015-09-08 12:20:01.137625786 +0000
@@ -394,13 +394,25 @@ readheaders (void)
register ALIAS *cur;
register char *p;
int tome, cont;
- char buf[MAXLINE];
+ char buf[MAXLINE]; /* actual line */
+ char buf2[MAXLINE]; /* next line */
char uucpfrom[MAXLINE];
/* char sender[MAXLINE]; */
/* char domain[MAXLINE]; */
cont = tome = 0;
- while (fgets (buf, sizeof (buf), stdin) && *buf != '\n')
+ fgets (buf, sizeof (buf), stdin);
+ if (*buf != '\n')
+ fgets (buf2, sizeof (buf2), stdin);
+ while (*buf != '\n')
+ {
+ while (*buf2 != '\n' && ((buf2)[0] == ' ' || (buf2)[0] == '\t') &&
+ strlen (buf) + strlen (buf2) < MAXLINE) /* only to buf capacity */
+ { /* it's OK for "From:" and it doesn't matter for "To:" and "Cc:" */
+ (buf)[strlen (buf) - 1] = '\0'; /* remove '\n' */
+ strlcat (buf, buf2, MAXLINE);
+ fgets (buf2, sizeof (buf2), stdin);
+ }
switch (toupper (*buf))
{
case 'F': /* "From: " or "From " */
@@ -527,8 +539,11 @@ readheaders (void)
findme:
for (cur = names; !tome && cur; cur = cur->next)
tome += nsearch (cur->name, buf);
- } /* switch(toupper(*buf)) */
-
+ }
+ strlcpy (buf, buf2, MAXLINE);
+ if (*buf != '\n')
+ fgets (buf2, sizeof (buf2), stdin);
+ }
if (!jflag && !tome)
EXITIT (0);
if (!*from)

View File

@ -0,0 +1,19 @@
---
vacation.c | 6 ++++++
1 file changed, 6 insertions(+)
--- vacation.c
+++ vacation.c 2017-02-01 09:26:42.073222511 +0000
@@ -520,6 +520,12 @@ readheaders (void)
cont = 0;
if (strncasecmp(buf, "X-Spam-Flag: YES", 16) == 0)
EXITIT (0);
+ if (strncasecmp(buf, "X-Is-Junk: YES", 14) == 0)
+ EXITIT (0);
+ if (strncasecmp(buf, "X-AMAZON", 8) == 0)
+ EXITIT (0);
+ if (strncasecmp(buf, "X-LinkedIn", 10) == 0)
+ EXITIT (0);
case 'C': /* "Cc:" */
if (strncasecmp (buf, "Cc:", 3))
break;

View File

@ -0,0 +1,19 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
Date: 2020-09-08
Do not leak internal info in vacation mails
Index: vacation-1.2.7.1/vacation.c
===================================================================
--- vacation-1.2.7.1.orig/vacation.c
+++ vacation-1.2.7.1/vacation.c
@@ -350,6 +350,9 @@ main (int argc, char **argv)
readheaders ();
if (!recent ())
{
+ char *comma = strchr(pw->pw_gecos, ',');
+ if(comma && getenv("NO_STRIP_GECOS")==NULL)
+ *comma = 0; // end GECOS string here to not leak internal info
setreply ();
(void) gdbm_close (db);
if (vdomain)

531
vacation-1.2.7.1.diff Normal file
View File

@ -0,0 +1,531 @@
---
vacation-1.2.7.1/Makefile | 11 --
vacation-1.2.7.1/vacation-en.man | 38 +++++++
vacation-1.2.7.1/vacation.c | 195 ++++++++++++++++++++++++++++++++-------
vacation-1.2.7.1/vaclook | 16 ---
4 files changed, 199 insertions(+), 61 deletions(-)
--- vacation-1.2.7.1/Makefile
+++ vacation-1.2.7.1/Makefile 2017-02-01 09:10:03.746060561 +0000
@@ -13,17 +13,8 @@ CFLAGS = $(RPM_OPT_FLAGS) -g -Wall
ifeq "$(ARCH)" "x86_64"
# Uncomment below for backwards compatibility of gdbm files.
# CFLAGS = $(CFLAGS) -m32
-else
-ifeq "$(ARCH)" "ppc"
- CFLAGS = $(CFLAGS) -fsigned-char
-else
-ifeq "$(ARCH)" "ppc64"
- CFLAGS = $(CFLAGS) -fsigned-char
-endif
-endif
endif
-LFLAGS = -Xlinker -warn-common
IFLAGS =
LIBS = -lgdbm
@@ -45,7 +36,7 @@ endif
BINDIR = $(PREFIX)/bin
VACATION = $(BINDIR)/vacation
VACLOOK = $(BINDIR)/vaclook
-MANDIR = $(PREFIX)/man/man
+MANDIR = $(PREFIX)/share/man/man
MANEXT1 = 1
VERSION = 1
--- vacation-1.2.7.1/vacation-en.man
+++ vacation-1.2.7.1/vacation-en.man 2017-02-01 09:10:03.746060561 +0000
@@ -25,8 +25,9 @@ vacation \- reply to mail automatically
.SH SYNOPSIS
.B vacation
[
-.B \-I | \-i
-]
+.B \-I | \-i | \-l
+] [
+.B \-F
.br
.B vacation
[
@@ -48,6 +49,7 @@ vacation \- reply to mail automatically
.B \-?
]
.I username
+.br
.SH DESCRIPTION
.IX vacation "" "\fLvacation\fR \(em automatic mail replies"
.LP
@@ -162,9 +164,39 @@ Initialize the
.B \&.vacation.db
file and start
.BR vacation .
+This should only be used on the command line, not
+in the
+.B \&.forward
+file.
+.TP
+.B \-F
+Force creation of
+.B \&.vacation.db
+even if the
+.B $\s-1HOME
+directory is identified as a NFS file system.
+Please note that the used data base is not portable
+between 32bit and 64bit architectures and also not
+portable between little and big endianess architectures
+even same bit-wide is used for. Therefore the
+initial creation of the
+.B \&/.vacation.db
+should always happen on the server used for receiving
+mails for the specific user.
+.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 the
+.B \&.forward
+file.
.LP
If the
-.B \-I
+.BR \-I, \ \-i
+or
+.B \-l
flag is not specified, and a
.I user
argument is given,
--- vacation-1.2.7.1/vacation.c
+++ vacation-1.2.7.1/vacation.c 2017-02-01 09:16:24.158138617 +0000
@@ -76,6 +76,7 @@ static char rcsid[] __attribute__ ((unus
#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/vfs.h>
#include <fcntl.h>
#include <pwd.h>
#include <gdbm.h>
@@ -91,6 +92,13 @@ static char rcsid[] __attribute__ ((unus
#include "tzfile.h"
#include "vacation.h"
+static void eatmsg (void);
+#define EXITIT(excode) { eatmsg(); if (db) gdbm_close(db); exit(excode);}
+#define EXITM(excode) { if (!iflag & !lflag) eatmsg(); if (db) gdbm_close(db); exit(excode); }
+#ifndef NFS_SUPER_MAGIC
+# define NFS_SUPER_MAGIC 0x6969
+#endif
+
/* Extern definitions for getopt(3) */
extern int optind, opterr;
extern char *optarg;
@@ -110,14 +118,15 @@ main (int argc, char **argv)
struct passwd *pw;
ALIAS *cur;
time_t interval;
- int ch, iflag, nflag;
+ int ch, iflag, nflag, mfail, lflag, fflag, flags;
char *vacation;
char *vdomain;
char *vusername;
char tmpusername[ 1024 ];
openlog ("vacation", LOG_PID, LOG_MAIL);
- opterr = iflag = nflag = rflag = 0;
+ db = (GDBM_FILE)0;
+ opterr = iflag = nflag = rflag = mfail = lflag = fflag = 0;
interval = -1;
vdomain = NULL;
#ifdef _PATH_VACATION
@@ -125,16 +134,16 @@ main (int argc, char **argv)
#else
vacation = argv[0];
#endif
- if (argc == 1)
+ if (argc == 1 || (argc == 2 && (strcmp(argv[1], "-F") == 0)))
nflag = 1;
- while ((ch = getopt (argc, argv, "a:h:Iit:jrv")) != EOF)
+ while ((ch = getopt (argc, argv, "a:h:Iit:jrlF")) != EOF)
switch ((char) ch)
{
case 'a': /* alias */
if (!(cur = (ALIAS *) malloc ((u_int) sizeof (ALIAS))))
{
- perror ("malloc");
- exit (-1);
+ mfail++;
+ break;
}
cur->name = optarg;
cur->next = names;
@@ -163,6 +172,12 @@ main (int argc, char **argv)
case 'r': /* "Reply-To:" overrides "From:" */
rflag = 1;
break;
+ case 'l': /* List ~/vacation.db */
+ lflag = 1;
+ break;
+ case 'F': /* Force creation of ~/vacation.db on NFS HOME */
+ fflag = 1;
+ break;
case 'v': /* Output vacation version number */
printf ("Linux Vacation %s\n", VACVERS);
exit (0);
@@ -175,32 +190,68 @@ main (int argc, char **argv)
argc -= optind;
argv += optind;
+ if (mfail) {
+ syslog(LOG_NOTICE, "vacation: can't allocate memory for alias.\n");
+ closelog();
+ EXITM(-1);
+ }
+
if (argc != 1)
{
- if (!iflag && !nflag)
+ if (!iflag && !nflag && !lflag)
usage ();
if (!(pw = getpwuid (getuid ())))
{
syslog (LOG_ERR, "vacation: no such user uid %u.\n", getuid ());
- exit (1);
+ closelog();
+ EXITM(1);
}
}
else if (!(pw = getpwnam (*argv)))
{
snprintf( tmpusername, 1023, "%s", *argv );
syslog (LOG_ERR, "vacation: no such user %s.\n", tmpusername);
- exit (1);
+ closelog();
+ EXITM(1);
}
if (chdir (pw->pw_dir))
{
syslog (LOG_NOTICE, "vacation: no such directory %s.\n", pw->pw_dir);
- exit (1);
+ closelog();
+ EXITM(1);
}
+ if (iflag || nflag) {
+ struct statfs fs;
+ flags = GDBM_NEWDB;
+ if (fflag == 0) {
+ if (statfs(pw->pw_dir, &fs) < 0) {
+ syslog(LOG_ERR, "vacation: can not stat %s %s.\n", pw->pw_dir, strerror(errno));
+ closelog();
+ EXITM(1);
+ }
+ if (fs.f_type == NFS_SUPER_MAGIC) {
+ fprintf(stderr, "vacation: Warning %s is mounted via NFS which may cause\n"
+ " a corrupted ~/.vacation.db database file!\n\n"
+ ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"
+ "Please run vacation on the mail delivering server, which is\n"
+ "normally the NFS server, or retry with the added option -F to\n"
+ "force the creation of ~/.vacation.db\n\n"
+ ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n",
+ pw->pw_dir);
+ syslog(LOG_NOTICE, "vacation: no database on NFS file system created\n");
+ closelog();
+ EXITM(1);
+ }
+ }
+ } else if (lflag)
+ flags = GDBM_READER|GDBM_NOLOCK;
+ else
+ flags = GDBM_WRITER;
+
do
{
- db = gdbm_open ((char *) VDB, 128, ((iflag || nflag) ? GDBM_NEWDB : GDBM_WRITER),
- 0644, NULL);
+ db = gdbm_open ((char *) VDB, 128, flags, 0644, NULL);
if (!db && errno == ENOENT)
{
db = gdbm_open ((char *) VDB, 128, GDBM_NEWDB, 0644, NULL);
@@ -210,12 +261,56 @@ main (int argc, char **argv)
}
while (!db && errno == EAGAIN);
- if (!db)
- {
- syslog (LOG_NOTICE, "vacation: %s: %s\n", VDB, strerror (errno));
- exit (1);
+ if (!db) {
+ char *errm;
+ if (errno == 0)
+ errm = gdbm_strerror(gdbm_errno);
+ else
+ errm = gdbm_strerror(errno);
+ if (lflag || iflag || nflag) {
+ fprintf(stderr, "vacation: %s: %s\n", (char *) VDB, errm);
+ close(0);
+ }
+ syslog(LOG_NOTICE, "vacation: %s: %s\n", (char *) VDB, errm);
+ closelog();
+ EXITM(1);
+ }
+
+ if (lflag) {
+ datum key, next = gdbm_firstkey (db);
+
+ while(next.dptr) {
+ key = next;
+ next = gdbm_nextkey(db, key);
+
+ if (key.dptr) {
+ datum data = gdbm_fetch(db, key);
+
+ if (data.dptr) {
+ time_t was;
+
+ if (data.dsize == (sizeof(was) >> 1)) {
+ /* We read on 64bit system 32bit time_t input */
+ int32_t in;
+
+ bzero(&was, sizeof(was));
+ bcopy(data.dptr, &in, sizeof(in));
+ was = (time_t)in;
+ } else
+ bcopy(data.dptr, &was, sizeof(was));
+
+ printf("%-36.*s %.36s", key.dsize, key.dptr, ctime(&was));
+ free(data.dptr);
+ }
+
+ free(key.dptr);
+ }
}
+ (void) gdbm_close(db);
+ exit(0);
+ }
+
if (interval != -1)
setinterval (interval);
@@ -232,8 +327,11 @@ main (int argc, char **argv)
exit (0);
}
- if (!(cur = (ALIAS *) malloc ((u_int) sizeof (ALIAS))))
- exit (1);
+ if (!(cur = (ALIAS *) malloc ((u_int) sizeof (ALIAS)))) {
+ syslog(LOG_NOTICE, "vacation: can't allocate memory for username.\n");
+ closelog();
+ EXITM(-1);
+ }
cur->name = pw->pw_name;
cur->next = names;
names = cur;
@@ -250,8 +348,9 @@ main (int argc, char **argv)
{ /* add virtual domain to username */
if (!(vusername = (char *) malloc (MAXLINE)))
{
- perror ("malloc");
- exit (-1);
+ syslog(LOG_NOTICE, "vacation: cant' allocation memory for virtual domain.\n");
+ closelog();
+ EXITM(-1);
}
(void) strlcpy (vusername, pw->pw_name, MAXLINE);
strlcat (vusername, "@", MAXLINE);
@@ -266,10 +365,17 @@ main (int argc, char **argv)
}
else
(void) gdbm_close (db);
+ closelog();
exit (0);
/* NOTREACHED */
}
+static void eatmsg()
+{
+ while(getc(stdin) != EOF)
+ continue;
+}
+
/*
* readheaders --
* read mail headers
@@ -322,7 +428,7 @@ readheaders (void)
*p = '\0';
}
else
- exit (1); /* this should not occur */
+ EXITIT (1); /* this should not occur */
if ((p = rindex (uucpfrom, '!')))
strlcat (from, p + 1, MAXLINE);
else
@@ -333,7 +439,7 @@ readheaders (void)
printd (logline);
#endif
if (junkmail ())
- exit (0);
+ EXITIT (0);
break;
case 'R': /* "Reply-To: " */
cont = 0;
@@ -345,7 +451,7 @@ readheaders (void)
printd (logline);
#endif
if (junkmail ())
- exit (0);
+ EXITIT (0);
}
break;
case 'S': /* "Subject" */
@@ -360,7 +466,7 @@ readheaders (void)
printd (logline);
#endif
if (junkmail ())
- exit (0);
+ EXITIT (0);
}
break;
case 'P': /* "Precedence:" */
@@ -375,7 +481,7 @@ readheaders (void)
break;
if (!strncasecmp (p, "junk", 4) ||
!strncasecmp (p, "list", 4) || !strncasecmp (p, "bulk", 4))
- exit (0);
+ EXITIT (0);
break;
case 'A': /* "Auto-Submitted:" */
cont = 0;
@@ -388,8 +494,12 @@ readheaders (void)
if (!*p)
break;
if (strncasecmp (p, "no", 2))
- exit (0);
+ EXITIT (0);
break;
+ case 'X': /* "To:" */
+ cont = 0;
+ if (strncasecmp(buf, "X-Spam-Flag: YES", 16) == 0)
+ EXITIT (0);
case 'C': /* "Cc:" */
if (strncasecmp (buf, "Cc:", 3))
break;
@@ -400,10 +510,6 @@ readheaders (void)
break;
cont = 1;
goto findme;
- case 'X': /* Don't reply to email marked as spam by SpamAssassin */
- if (!strncasecmp (buf, "X-Spam-Status: Yes", 18))
- exit (0);
- break;
default:
if (!isspace (*buf) || !cont || tome)
{
@@ -413,13 +519,15 @@ readheaders (void)
findme:
for (cur = names; !tome && cur; cur = cur->next)
tome += nsearch (cur->name, buf);
- }
+ } /* switch(toupper(*buf)) */
+
if (!jflag && !tome)
- exit (0);
+ EXITIT (0);
if (!*from)
{
syslog (LOG_NOTICE, "vacation: no \"From:\" line.\n");
- exit (2);
+ closelog();
+ EXITIT (2);
}
if (rflag && (*replyto != 0x0))
strlcpy (from, replyto, MAXLINE);
@@ -503,7 +611,19 @@ junkmail (void)
{
"-programmers", 12},
{
- NULL, 0},};
+ "bugzilla-daemon", 15},
+ {
+ "noreply", 7},
+ {
+ "no-reply", 8},
+ {
+ "info", 4},
+ {
+ "nobody", 6},
+ {
+ "keine.Antwort", 13},
+ {
+ NULL, 0},};
register struct ignore *cur;
register int len;
register char *p;
@@ -609,6 +729,7 @@ setreply (void)
/*
* sendmessage --
* exec sendmail to send the vacation file to sender
+ * A "Precedence: bulk" header is automatically added to the message.
*/
void
sendmessage (char *myname, char *myrealname)
@@ -628,17 +749,20 @@ sendmessage (char *myname, char *myrealn
if (mfp == NULL)
{
syslog (LOG_NOTICE, "vacation: no ~%s/%s file.\n", myname, VMSG);
+ closelog();
exit (1);
}
if (pipe (pvect) < 0)
{
syslog (LOG_ERR, "vacation: pipe: %s", strerror (errno));
+ closelog();
exit (1);
}
i = fork ();
if (i < 0)
{
syslog (LOG_ERR, "vacation: fork: %s", strerror (errno));
+ closelog();
exit (1);
}
if (i == 0)
@@ -651,6 +775,7 @@ sendmessage (char *myname, char *myrealn
NULL);
syslog (LOG_ERR, "vacation: can't exec %s: %s", _PATH_SENDMAIL,
strerror (errno));
+ closelog();
exit (1);
}
close (pvect[0]);
@@ -699,7 +824,7 @@ sendmessage (char *myname, char *myrealn
void
usage (void)
{
- puts ("usage: vacation [ -I ]");
+ puts ("usage: vacation [ -I | -i | -l ] [ -F ]");
puts
("or: vacation [ -j ] [ -a alias ] [ -h hostname ] [ -tN ] [ -r ] login");
exit (1);
--- vacation-1.2.7.1/vaclook
+++ vacation-1.2.7.1/vaclook 2017-02-01 09:10:03.746060561 +0000
@@ -1,14 +1,4 @@
-#!/usr/bin/perl
+#!/bin/sh
#
-# $Id$
-
-require 5; # This script requires Perl v5.
-use GDBM_File; # Format that 'vacation' uses.
-
-# Associate the file with local hash.
-tie (%vacdb, GDBM_File, "$ENV{'HOME'}/.vacation.db", 0, undef);
-
-# Dump the contents (with converted time-stamps).
-map {
- printf ("%-36s %.36s\n", "$_:", scalar (localtime (unpack ('i', $vacdb{$_}))))
- } sort keys %vacdb;
+#
+exec /usr/bin/vacation -lF

View File

@ -0,0 +1,107 @@
---
vacation-1.2.7.1/vacation-en.man | 7 +++++++
vacation-1.2.7.1/vacation.c | 24 ++++++++++++++++--------
2 files changed, 23 insertions(+), 8 deletions(-)
--- vacation-1.2.7.1/vacation-en.man
+++ vacation-1.2.7.1/vacation-en.man 2017-02-01 09:22:09.274931674 +0000
@@ -40,6 +40,9 @@ vacation \- reply to mail automatically
.BI \-a " alias"
]
[
+.BI \-f " file"
+]
+[
.BI \-t N
]
[
@@ -241,6 +244,10 @@ Otherwise, use the
.RB ` From: '
entry.
.TP
+.BI \-f\ <file>
+use a different message file than the default, .vacation.msg.
+The path to this file is relative to the home directory of the user.
+.TP
.BI \-?
issue short usage line.
.SH USAGE
--- vacation-1.2.7.1/vacation.c
+++ vacation-1.2.7.1/vacation.c 2017-02-01 09:22:09.274931674 +0000
@@ -102,6 +102,7 @@ static void eatmsg (void);
/* Extern definitions for getopt(3) */
extern int optind, opterr;
extern char *optarg;
+char *vmsg = VMSG;
/*
* VACATION -- return a message to the sender when on vacation.
@@ -136,7 +137,7 @@ main (int argc, char **argv)
#endif
if (argc == 1 || (argc == 2 && (strcmp(argv[1], "-F") == 0)))
nflag = 1;
- while ((ch = getopt (argc, argv, "a:h:Iit:jrlF")) != EOF)
+ while ((ch = getopt (argc, argv, "a:f:h:Iit:jrlF")) != EOF)
switch ((char) ch)
{
case 'a': /* alias */
@@ -149,6 +150,13 @@ main (int argc, char **argv)
cur->next = names;
names = cur;
break;
+ case 'f':
+ if(optarg) {
+ vmsg = optarg; /* another vacation.msg file */
+ } else {
+ syslog(LOG_NOTICE, "vacation: -f option used but not file given");
+ }
+ break;
case 'h': /* hostname */
vdomain = optarg;
break;
@@ -745,10 +753,10 @@ sendmessage (char *myname, char *myrealn
printd (logline);
#endif
- mfp = fopen (VMSG, "r");
+ mfp = fopen (vmsg, "r");
if (mfp == NULL)
{
- syslog (LOG_NOTICE, "vacation: no ~%s/%s file.\n", myname, VMSG);
+ syslog (LOG_NOTICE, "vacation: no ~%s/%s file.\n", myname, vmsg);
closelog();
exit (1);
}
@@ -826,7 +834,7 @@ usage (void)
{
puts ("usage: vacation [ -I | -i | -l ] [ -F ]");
puts
- ("or: vacation [ -j ] [ -a alias ] [ -h hostname ] [ -tN ] [ -r ] login");
+ ("or: vacation [ -j ] [ -a alias ] [ -f file ] [ -h hostname ] [ -tN ] [ -r ] login");
exit (1);
}
@@ -886,11 +894,11 @@ initialize (char *path, char *myname)
printd (logline);
#endif
- if (((message = fopen (VMSG, "r")) == NULL))
+ if (((message = fopen (vmsg, "r")) == NULL))
{
- if (((message = fopen (VMSG, "w")) == NULL))
+ if (((message = fopen (vmsg, "w")) == NULL))
{
- fprintf (stderr, "vacation: cannot open %s\n", VMSG);
+ fprintf (stderr, "vacation: cannot open %s\n", vmsg);
exit (1);
}
fprintf (message, "Subject: away from my mail\n\n");
@@ -912,7 +920,7 @@ initialize (char *path, char *myname)
fclose (oldmessage);
}
fclose (message);
- snprintf (ebuf, PATH_MAX, "%s %s", editor, VMSG); /* Flawfinder: ignore */
+ snprintf (ebuf, PATH_MAX, "%s %s", editor, vmsg); /* Flawfinder: ignore */
#ifdef DEBUG
snprintf (logline, MAXLINE, "calling editor with \"%s\"\n", ebuf); /* Flawfinder: ignore */
printd (logline);

View File

@ -0,0 +1,15 @@
---
vacation-1.2.7.1/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- vacation-1.2.7.1/Makefile
+++ vacation-1.2.7.1/Makefile 2017-02-01 09:23:09.577670561 +0000
@@ -61,7 +61,7 @@ TGZFILE = vacation-$(VERSION).$(SUBVERS
all: $(BIN)
install: all
- install -s -m 755 $(BIN) $(VACATION)
+ install -m 755 $(BIN) $(VACATION)
install -m 755 vaclook $(VACLOOK)
install -m 444 vacation.man $(MANDIR)$(MANEXT1)/vacation.$(MANEXT1)
install -m 444 vaclook.man $(MANDIR)$(MANEXT1)/vaclook.$(MANEXT1)

BIN
vacation-1.2.7.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

260
vacation.changes Normal file
View File

@ -0,0 +1,260 @@
-------------------------------------------------------------------
Wed Feb 21 08:29:08 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Install german manual page as well
-------------------------------------------------------------------
Tue Feb 20 13:11:55 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Tue Nov 7 22:06:34 UTC 2023 - Dirk Müller <dmueller@suse.com>
- spec file cleanups
-------------------------------------------------------------------
Tue Sep 8 03:41:15 UTC 2020 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add vacation-1.2.7.1-nogecos.patch to strip GECOS field of most info
-------------------------------------------------------------------
Wed Feb 1 09:34:04 UTC 2017 - werner@suse.de
- Add some more senders and mail tags which should not be answered
-------------------------------------------------------------------
Tue Sep 8 12:28:48 UTC 2015 - werner@suse.de
- Add backport of upstream patch
0001-Patch-to-handle-long-folded-headers-from-Zdenek-Havr.patch
to allow long From header (two lines) handled correctly (bsc#944326)
- Add patch vacation-1.2.7.1-junkfilter.diff
to handle spam found by junkfilter
-------------------------------------------------------------------
Tue Oct 14 09:48:08 UTC 2014 - jengelh@inai.de
- Use source URLs and remove ancient specfile tags and sections
-------------------------------------------------------------------
Tue Jan 31 01:44:09 UTC 2012 - tabraham@novell.com
- update to version 1.2.7.1
* Added patch from Roberto Piola <roberto@ilpiola.it> to avoid
replying to emails that have been marked as spam by SpamAssassin
via the "X-Spam-Status: Yes" header.
* made "-i" an alias for "-I" to initialize the database and
update the man page to reflect this
* Added patch from Jacek Kalinski that automatically creates a
vacation database for users who do not have one. Stops vacation
dieing if they have forgotten to init the database.
* Added documentation for the "-h" option to specify a domain
name for email replies to be from.
* added List-Id to the headers that junkmail() searches for
* Add the Auto-Submitted: header as per RFC3834 - patch from
Dr. Tilmann Bubeck.
* Applied patch from Dr. Tilmann Bubeck to stop Vacation from
munging the GECOS information of users and instead pass it
quoted to the MTA for it to deal with.
* Abide by the RFC 3834 header "Auto-Submitted".
-------------------------------------------------------------------
Thu Dec 17 20:54:20 CET 2009 - jengelh@medozas.de
- enable parallel building
-------------------------------------------------------------------
Mon Mar 26 15:00:35 CEST 2007 - rguenther@suse.de
- Add gdbm-devel BuildRequires
-------------------------------------------------------------------
Tue Jan 9 13:50:30 CET 2007 - werner@suse.de
- Avoid illegal free()-call after reading db (#232502)
- Make comment about option -F more clear (#231471)
- Add noreply, board, and info to ignore list
-------------------------------------------------------------------
Fri Aug 25 15:58:40 CEST 2006 - werner@suse.de
- Update to version 1.2.6.2 which includes the bulk fix
-------------------------------------------------------------------
Fri May 26 12:56:28 CEST 2006 - schwab@suse.de
- Don't strip binaries.
-------------------------------------------------------------------
Wed Jan 25 21:31:05 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Thu Jul 28 17:14:41 CEST 2005 - werner@suse.de
- Close db file on emergency exit
-------------------------------------------------------------------
Fri Jul 1 16:50:56 CEST 2005 - werner@suse.de
- Remove -m486
-------------------------------------------------------------------
Fri Jul 1 12:37:19 CEST 2005 - werner@suse.de
- Remove -fsigned-char (bug #93887)
-------------------------------------------------------------------
Thu Aug 19 14:09:30 CEST 2004 - werner@suse.de
- Do not reply on SPAM mails detected by Spamassassin.
-------------------------------------------------------------------
Wed Jul 28 11:38:43 CEST 2004 - werner@suse.de
- Add some more comments in usage() and fix hint on new option -F
-------------------------------------------------------------------
Tue Jun 22 18:34:00 CEST 2004 - werner@suse.de
- Add warning message and force option for HOME dir via NFS, this
because there is no portable _and_ backward compatible db lib
available (bug #41837).
-------------------------------------------------------------------
Fri Jun 11 18:32:57 CEST 2004 - werner@suse.de
- Try to fix bug #41837 aka portable ~/.vacation.db
-------------------------------------------------------------------
Mon Jul 28 16:30:13 CEST 2003 - werner@suse.de
- Add Precedence bulk to replay header (bug #27759)
-------------------------------------------------------------------
Mon Jun 30 18:47:10 CEST 2003 - werner@suse.de
- Update to vacation 1.2.6.1
-------------------------------------------------------------------
Fri May 23 15:58:25 CEST 2003 - coolo@suse.de
- use BuildRoot
-------------------------------------------------------------------
Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de
- removed bogus self-provides
-------------------------------------------------------------------
Mon Apr 22 16:08:14 MEST 2002 - draht@suse.de
- added -f option to vacation, which now supports not only the
default message file, but also the one specified on the
commandline. Manpage changes are also complete.
-------------------------------------------------------------------
Wed Feb 28 19:30:14 CET 2001 - werner@suse.de
- Add -f to rm to avoid missing man page on ppc
-------------------------------------------------------------------
Wed Feb 28 18:53:02 CET 2001 - werner@suse.de
- Fix compile error on none ia32, ppc, and axp
-------------------------------------------------------------------
Wed Feb 28 18:19:37 CET 2001 - werner@suse.de
- Update to 1.2.5 (mostly SuSE patches!)
- Intergrate eating patch to avoid SIGPIPE to the MTA
-------------------------------------------------------------------
Thu Nov 23 13:59:53 CET 2000 - werner@suse.de
- Eat stdin at exit to avoid SIGPIPE to the MTA
-------------------------------------------------------------------
Fri Jul 14 13:42:22 CEST 2000 - werner@suse.de
- Security: avoid sendmail options within from address
-------------------------------------------------------------------
Thu Jun 8 00:28:29 CEST 2000 - ro@suse.de
- doc relocation
-------------------------------------------------------------------
Mon Mar 6 17:29:10 CET 2000 - werner@suse.de
- Rename included aliases.5 to forward.5 because this page
explains more than the those of sendmail or postfix and
it avoids an .so request of a maybe missed aliases.5.
-------------------------------------------------------------------
Fri Mar 3 13:34:10 CET 2000 - werner@suse.de
- /usr/man -> /usr/share/man
-------------------------------------------------------------------
Tue Jan 11 20:33:39 CET 2000 - werner@suse.de
- New version 1.2.1
* with bug fix (no string case compare for mail addresses)
- Fix CFLAGS so it will work on PPC
-------------------------------------------------------------------
Sun Jan 2 19:05:19 CET 2000 - kukuk@suse.de
- Fix CFLAGS so it will work on every architecture
-------------------------------------------------------------------
Wed Dec 22 19:15:44 CET 1999 - werner@suse.de
- new version 1.2.0
- install vaclook
- create and install vaclook.man
-------------------------------------------------------------------
Sat Nov 27 14:59:56 MET 1999 - kukuk@suse.de
- Use RPM_OPT_FLAGS
-------------------------------------------------------------------
Mon Nov 1 19:06:39 MET 1999 - kukuk@suse.de
- Replace vfork() with fork()
-------------------------------------------------------------------
Tue Sep 21 15:53:02 CEST 1999 - uli@suse.de
- fixed Makefile for PPC
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Wed Feb 3 00:03:59 MET 1999 - ro@suse.de
- no m486 on alpha
----------------------------------------------------------------------------
Fri Oct 30 16:27:58 MET 1998 - werner@suse.de
- man page:
* change /usr/ucb/vacation to /usr/bin/vacation
* remove empty line at begining
----------------------------------------------------------------------------
Fri Jun 6 14:04:11 CEST 1997 - bs@suse.de
- skipped man page aliases.5 (is in sendmail)
----------------------------------------------------------------------------
Mon May 26 17:36:41 MET DST 1997 - werner@suse.de
- Fix in version 1.1.1 : now /usr/bin/vacation
is compiled in static (security)

78
vacation.spec Normal file
View File

@ -0,0 +1,78 @@
#
# spec file for package vacation
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: vacation
Version: 1.2.7.1
Release: 0
Summary: A way to automatically reply to incoming e-mail
License: GPL-2.0-or-later
Group: Productivity/Networking/Email/Utilities
URL: https://www.csamuel.org/software/vacation
Source: https://downloads.sf.net/vacation/%{name}-%{version}.tar.gz
Patch0: vacation-%{version}.diff
Patch1: vacation-%{version}.multiple-vacationmsg_files.diff
Patch3: vacation-%{version}.strip.diff
# PATCH-FIX-UPSTREAM bsc#944326 - long From: header (two lines) not handled correctly
Patch4: 0001-Patch-to-handle-long-folded-headers-from-Zdenek-Havr.patch
# PATCH-FIX-SUSE Also handle junkfilter based on procmail
Patch5: vacation-%{version}-junkfilter.diff
Patch6: vacation-1.2.7.1-nogecos.patch
BuildRequires: gdbm-devel
%define add_optflags(a:f:t:p:w:W:d:g:O:A:C:D:E:H:i:M:n:P:U:u:l:s:X:B:I:L:b:V:m:x:c:S:E:o:v:) \
%global optflags %{optflags} %{**}
%description
This program answers your e-mail when you are lying on the beach.
Documentation: man vacation
%prep
%setup -q
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 3 -p1
%patch -P 4
%patch -P 5
%patch -P 6 -p1
%build
chmod -R u+w,g+r,o+r .
%add_optflags -Werror=format-security
%make_build clobber
%make_build
%install
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man{1,5}
make install MANDIR=%{buildroot}%{_mandir}/man BINDIR=%{buildroot}%{_bindir}
rm -f %{buildroot}%{_mandir}/man5/forward.5
echo '.so man5/aliases.5' > %{buildroot}%{_mandir}/man5/forward.5
chmod 0444 %{buildroot}%{_mandir}/man5/forward.5
install -D -m 444 vacation-de.man %{buildroot}%{_mandir}/de/man1/vacation.1
%files
%license COPYING
%doc ChangeLog README
%{_bindir}/vacation
%{_bindir}/vaclook
%{_mandir}/man1/vacation.1%{?ext_man}
%{_mandir}/man1/vaclook.1%{?ext_man}
%{_mandir}/man5/forward.5%{?ext_man}
%{_mandir}/de/man1/vacation.1%{?ext_man}
%changelog

28
vacation.test Normal file
View File

@ -0,0 +1,28 @@
Testform für VACATION
=====================
Datum: 30.06.2003
Version: 1.2.6.1
Maintainer: werner@suse.de
Voraussetzungen:
================
Folgende Pakete müssen installiert werden:
1. sendmail
2. einer der vi's
Aufruf(e):
========
1. man vacation
2. vacation
3. vacation -I
Ergebnis(se):
===========
~/.forward, ~/.vacation.db und ~/.vacation.msg