Date: Thu, 2 Dec 1999 13:14:38 -0500 (EST) From: Mikhail Teterin <mi@misha.cisco.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/15227: New option for vacation(1) -- dir to use instead of $HOME Message-ID: <199912021814.NAA60391@misha.cisco.com>
next in thread | raw e-mail | index | archive | help
>Number: 15227 >Category: bin >Synopsis: New option for vacation(1) -- dir to use instead of $HOME >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Dec 2 10:20:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Mikhail Teterin >Release: FreeBSD 3.3-STABLE i386 >Organization: Virtual Estates, Inc. >Environment: >Description: The existing vacation(1) program is nice, but you can only have one database and message with it. Yet, I found it neccessary on several occasions to have different responses send in response to different e-mails, and even created a special user once, just for that. You still need some smart mail-handling software such as procmail, but using it can be much simpler if you do not need to script what vacation(1) already provides. >How-To-Repeat: >Fix: Before the patches below are committed, the only alternative is to use home-cooked scripts. --- vacation.c.orig Tue Sep 28 18:42:09 1999 +++ usr.bin/vacation/vacation.c Thu Dec 2 12:45:08 1999 @@ -117,2 +117,3 @@ int ch, iflag, lflag, mfail, ufail; + char *dir = NULL; @@ -120,3 +121,3 @@ interval = -1; - while ((ch = getopt(argc, argv, "a:dIilr:")) != -1) { + while ((ch = getopt(argc, argv, "a:dIilr:D:")) != -1) { switch((char)ch) { @@ -150,2 +151,5 @@ break; + case 'D': + dir = optarg; + break; case '?': @@ -183,5 +187,7 @@ } - if (chdir(pw->pw_dir)) { + if (!dir) + dir = pw->pw_dir; + if (chdir(dir)) { msglog(LOG_NOTICE, - "vacation: no such directory %s.\n", pw->pw_dir); + "vacation: %s: %s.\n", dir, strerror(errno)); exit(1); --- vacation.1.orig Mon Aug 30 03:15:30 1999 +++ usr.bin/vacation/vacation.1 Thu Dec 2 12:56:49 1999 @@ -45,2 +45,3 @@ .Op Fl r Ar interval +.Op Fl D Ar dir .Nm vacation @@ -48,4 +49,6 @@ .Fl l +.Op Fl D Ar dir .Nm vacation .Op Fl d +.Op Fl D Ar dir .Op Fl a Ar alias @@ -78,2 +81,10 @@ Enable debugging mode. See below. +.It Fl D Ar dir +Use +.Ar dir +instead of the user's home directory. This can be used +to allow the same user respond differently to different +messages, or to simply speed up mail processing by placing +the database "closer" to the mailserver (local filesystem +vs. NFS, for example). .It Fl i >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912021814.NAA60391>