[sork] vacation program db formats

Derek J. Balling dredd@megacity.org
Fri, 12 Jul 2002 06:54:40 -0400


At 11:20 PM -0500 7/11/02, Eric Rostetter wrote:
>Not all vacation programs have -f, and as you say, this could be painful
>since different servers may use different formats...

True. Possible documentation might be: "Create the vacation database 
file as you normally would for a vacationing user. For some sites 
this would simply be 'touch vacation.db', for others it might require 
'vacation -i'. Determine the method your vacation program uses, and 
then move the resulting file [...]"

>We can make a per realm setting that lets you select database types of
>(for example) null, ndbm, gdbm, db2, db3.  Null would be the default and
>would do the same as now (create and copy an empty file).  The others
>would check for the needed db functions being in your php, and if not
>there then generate an error (or default back to null??? probably the error
>is best).  Assuming the needed db extensions are there, then generate
>a database of the correct type (empty, but an actual database) and then
>copy that.

Well, it's possible that webhost only has db2 but mailhost has db3.

It might not be too hard to simply toss "pre-created" .db files of 
each type in the distribution, and reference those. For example, 
include:
	v_template.null
	v_template.db2
	v_template.db3
	[etc]

and then just ftp-put "The appropriate file". Then if someone needs 
to define a new one, there's no special logic. They just create a new 
file with the different extension, use THAT extension as their 
db-type setting, and they copy over their blank file.

>This assumes that the files should be empty, but valid database files.

Correct.

>I'm not sure if this is true or not for all versions of vacation.

Well, for vacations that support '-i' (which I believe many/most 
do?), that's not much of an issue, because the -i will initialize the 
db however vacation wants it initialized. Even if you can't force it 
output to a particular file, you can safely create a .vacation.db in 
a user's homedir (for the short-term creation/moving to the webhost) 
so long as you don't ALSO create the .forward while it's there... :-)

D
-- 
--
+------------------------------+--------------------------------+
| Derek J. Balling             | "You can get more with a kind  |
| dredd@megacity.org           |  word and a two-by-four, than  |
| www.megacity.org/blog/       |  you can with just a kind      |
|                              |  word."               - Marcus |
+---------------------------------------------------------------+