TWIG is a very useful web
based e-mail client based on the PHP programming language. TWIG is extremely
easy to use and offers a browser independent way of viewing and sending
e-mail.
We have made two versions
of TWIG available. The version that does not include address book
functionality is easier to install and is recommended for most users. If
address book functionality is required see the additional instructions at
the bottom of this page.
Installation and
Configuration
To install TWIG, Telnet or SSH to your Virtual Server and run the
following command:
% cd (change to your home directory)
Then, choose one
of the following commands:
Standard TWIG
% tar -xvf /usr/local/contrib/twig.tar
TWIG with address book
support
% tar -xvf /usr/local/contrib/twig-addr_book.tar
You will now need to edit
the TWIG config.inc file found in the directory ~/usr/local/etc/httpd/htdocs/twig/config
directory. You can either use the "pico" command in Unix to edit
the file, or you can use your favorite FTP Client to download the
file, edit the file, and upload it back to your Virtual Server (be sure to
download and upload the config.inc file from and to your Virtual
Server in ASCII mode).
You can edit the file
using either method. Your goal is to find the occurrence of "YOUR-DOMAIN.NAME"
in the config.inc file and modify it to define the domain name from
which TWIG will send mail. The occurrence of "YOUR-DOMAIN.NAME" is
very near the top of the config.inc file and should be easy to
locate.
Installing PHP
TWIG requires PHP to be installed. To install a version of PHP
compatible with TWIG on your Virtual Server, you need to simply make three
minor changes to your "httpd.conf" file located in your "~/usr/local/etc/httpd/conf"
directory. First, you will need to add the PHP dynamic module to your
Apache web server by adding a "LoadModule" directive
near the top of your httpd.conf file. The directive you must add is shown
below:
LoadModule php3_module modules/mod_php3-3.0.7-module-mysql-imap.so
Second, find and edit the
DirectoryIndex directive to include "index.php3". An
example is shown below:
DirectoryIndex index.php3 index.html index.htm
Finally, you must use the
AddType directive to identify the mime type of PHP files. The
following two lines may already exist in your httpd.conf file, but if they
don't add them in the section of the httpd.conf file where the other AddType
directives exist.
AddType application/x-httpd-php3 .php3 .phtml
AddType application/x-httpd-php3-source .phps
NOTE: If your
Virtual Server was configured before Dec 8, 1998 you should add/edit the
previous DirectoryIndex and AddType directives to
the ~/www/conf/srm.conf file instead of the ~/www/conf/httpd.conf
file.
Updating the DB
version of your Password File
In order for TWIG to properly recognize the usernames, passwords, and home
directories of the users in your Password File (~/etc/passwd), you will need
to Telnet or SSH to your Virtual Server and run the following
command:
% vpwd_mkdb ~/etc/passwd
If the text version of
your password file and the DB version of the password file get out of sync
(via manual editing, vrmuser, or iRoot) you can run the above command to
rebuild the DB version from the text version.
If you do not require
address book functionality, then the installation and configuration are
complete.
Additional
Instructions for Address Book Functionality
The address book features of TWIG require that the MySQL database program be
installed on your Virtual Server.
Installing MySQL
If you have not previously installed MySQL on your Virutal Server,
you will need to do so in order to take advantage of the contact directory
and schedule capabilities of TWIG. To install MySQL, simply Telnet or SSH
to your Virtual Server and run the following command:
% installmysql
Once you have MySQL
running on your Virtual Server, you need to create a twig user with
appropriate privileges and some twig tables in the MySQL database. This is
easily done using two MySQL command files we have created for you and
included in the TWIG installation archive you have already installed. Telnet
or SSH to your Virtual Server and run the following commands:
% mysql -u root < ~/usr/local/etc/httpd/htdocs/twig/twig.table.mysql
% mysqladmin -u root reload
NOTE: If you have
previously installed MySQL on your Virtual Server and have already
set a root password for MySQL, use the following commands instead of those
above:
% mysql -u root -pPASSWD
< ~/usr/local/etc/httpd/htdocs/twig/twig.table.mysql
% mysqladmin -u root -pPASSWD reload
Substitute the password
you have set for MySQL for PASSWD above.
Using TWIG
After TWIG is properly installed and configured, you will be able to read
your e-mail with any browser (e.g. Netscape or MSIE). You simply need to
access the URL- "http://your.domain.name/twig/". TWIG will prompt
you for your e-mail username and password. After successful authentication,
the contents of your mailbox will be displayed.
NOTE: TWIG uses IMAP
to access the incoming mail folder and can be used to create additional mail
folders to sort and store incoming mail. Any additional mail folders that a
user creates will be created in the user's home directory as listed in your
local password file (~/etc/passwd). If the user's home directory
happens to be defined as a directory in the ~/www/htdocs/ or ~/www/vhosts
directory structure (typically created in this fashion such that the user
can upload and download content to and from a Virtual Subhost via FTP) then
any mail folders these users create using TWIG will be accessible to anyone
via a web client. Therefore, it is highly recommended that these users
create any additional mail folders under a Mail subdirectory and
create a .htaccess file and store it in such a Mail directory
to protect the confidentiality of the mail stored therein. Contents of a
suitable .htaccess file is shown below:
<Limit GET POST PUT DELETE>
deny from all
</Limit>