Changes in Zot-DispatchThe source for Zot-Dispatch 2.0 can be found here.
Zot-Dispatch now has a configuration file. Nearly everything that needs to
be configured can be done so in that file. Only the proper path to the perl
interpreter must be changed in ZD's source. The configuration file must
reside in the same directory as ZD and it must be called zd.conf.
Many of the new features of ZD described in this document are configurable in the configuration file. Read the configuration file document for information on how to configure Zot-Dispatch properly.
In Zot-Dispatch version 1.0 it was possible to place a template either inline
in an HTML document, or in an external file readable by the server. Templates
placed inline in the document were specified in a ZD-Method
variable as "body:Template Body.....". If the template was
placed in an external file the full pathname of that file was specified as
"file:/dir/dir2/file".
Now in Zot-Dispatch you can also specify an HTTP URL as the location of the
template. Simply place the full URL of the template document where you
would normally put "body:Template Body....." or
"file:/dir/dir2/file".
Example:
<INPUT type=hidden NAME="ZD-Method"
VALUE="ZD-Reflect;;http://www.oac.uci.edu/">
In order to save server resources Zot-Dispatch now spawns a child process which will sleep a predetermined (configurable) amount of time and upon awakening will kill the parent process if it is still running. If the parent process completes before the child awakens, the parent kills the child.
The amount of time that the child sleeps, in seconds, can be set in the configuration file. The default time is 120 seconds.
It is now possible to have ZD limit the amount of data that is appended or mailed. In the configuration file, the maximum number of characters to be appended or e-mailed can be set separately to allow protection against possible problems with appending or e-mailing unlimited amounts of data.
If the number of characters allowed is equal to zero (the default) then there is no limit.
The hosts to which ZD can e-mail, and from which it can retrieve templates via HTTP can be limited separately in the configuration file.
ZD can now be configured to chop off all characters after the "@" in e-mail addresses. Doing so will effectively limit all e-mail to users on the server machine. Truncating is turned off as the default.
E-mail aliases can now be specified in Zot-Dispatch's configuration file. All e-mail addresses that ZD sends to are first checked against the alias list. If an alias exists for an address, the address is replaced with the alias.
If desired, ZD can be set in the configuration file to not allow mail sent to users on the server machine. This functionality is separate from the host limiting and truncating functionalities, and only stops e-mail addresses that do not have a host specified (which would go to the server machine).
The default is to allow local mail.
The directories/files to which ZD is allowed to append can be specified in the configuration file. Entire directories, specific files, and filenames matching simple patterns can be specified as allowed or unallowed.
ZD 1.0 could send mail to form owners if an error occured with their form data and ZD. Now ZD can mail general errors that occur in ZD itself to a user specified in the configuration file.
In ZD's configuration file collections of hidden variables (names and values) can be specified and associated with a single name. This name can be placed in the extra path information of a URL that accesses ZD (see example below). ZD will recognize the macro name and read in all of the associated hidden variables.
Macros variables are read in prior to reading any other variables entered in the form. Any other variables entered in through the regular form interface will act as though they came after the macro variables in the form, possibly overriding them.
If the user doesn't need to enter in any extra data to use your form, then ZD may be called from a standard HTML link without requiring a form or the button associated with it.
An example definition of a Macro Variable is:
<macro form1>
ZD-Method = "ZD-Mail;lmegliol@uci.edu;"
ZD-Method = "ZD-Reflect;;body:Thank You!"
</macro>
An example of using this Macro Variable might be:
<FORM METHOD=POST ACTION="http://www.oac.uci.edu/cgi-bin/zd.cgi/form1">
<INPUT TYPE=TEXT NAME="User-Name">
<INPUT TYPE=TEXT NAME="User-Message">
<INPUT TYPE=submit>
</FORM>
In this case, most of the ugly Zot-Dispatch variables have been removed. Macro
Variables can also be used to call Zot-Dispatch from a simple text link as
opposed to a submit button (however, no user input will be available).
For example:
<A HREF="http://www.oac.uci.edu/cgi-bin/zd.cgi/form2">
Comment Form</A>
The comment link at the bottom of this page is an example of using a macro
variable in this way. It dynamically creates a e-mail form specially tailored
for the document it was referred to by.
direct. If anything other than this word is found, the behavior
of ZD will be the same as before. If this word is found, however, one of the
following will happen: If the template is a file, the contents of that file
will be returned without substituting variable values into it. If the
template is a body, the body will be returned without substituting variables
into it (There is a problem doing it this way). If the
template is a URL
(a string that begins with http:, telnet:, ftp:, gopher:, news:, mailto:,
nntp:, wais:, prospero:, cid:, or mid:), ZD will send back the
Location: header redirecting the client to the URL. If the
template does not fit any of these three, then the default response is returned.
Problem: Because Zot-Dispatch does substitutions
in the three fields of the ZD-Method variable, and then also does a substitution
on the template, if your template is defined in the ZD-Method variable, then
values may be substituted into the template during the first substitution. This
will cause the ouput when using direct to not output the correct
template source.
This has been the method for templates also.
Examples:
<INPUT TYPE=text SIZE=40 NAME=addresses>
<INPUT TYPE=hidden NAME=addresses VALUE="lmegliol@uci.edu">
<INPUT TYPE=hidden NAME=ZD-Method
VALUE="ZD-Mail;$addresses#;">
In this case, both values of addresses will be substituted into
the destination field.
<INPUT TYPE=text SIZE=40 NAME=addresses>
<INPUT TYPE=hidden NAME=addresses VALUE="lmegliol">
<INPUT TYPE=hidden NAME=ZD-Method
VALUE="ZD-Mail;$addresses#@uci.edu;">
In this case, only the last value of the variable would be substituted into
the destination field.