Install Dada Mail Manually
- Manually Installing Dada Mail
Manually Installing Dada Mail
First, a Word
Unless you like to or need to, it's much easier now to use the Dada Mail Installer - both these instructions and the Dada Mail installer will install and Configure Dada Mail in basically the same way.
In these directions, I'll be giving examples of shell commands you may issue to complete each step. They may need to be slightly modify to work with your particular environment. Noting too tricky, though.
Command Line Installer
To help disuade you even further with installing Dada Mail "Manually", consider that the Installer has a command line interface! No need to re-invent the wheel:
http://dadamailproject.com/support/documentation-7_4_1/install_dada-command_line.pod.html
Download Dada Mail at:
http://dadamailproject.com/download
Either uncompress the distribution on your desktop and upload the, dada
directory into your cgi-bin
, or,
upload the .tar.gz
distribution itself into your cgi-bin
and uncompress on your hosting account (you'll need an ssh connection).
gunzip dada-4_x_x.tar.gz; tar -xvf dada-4_x_x.tar; cd dada
Change the permissions of the, mail.cgi
file to, 755
:
chmod 755 mail.cgi
Visit the, mail.cgi
script in your web browser. You should see a "Welcome" screen, that also tells you that Dada Mail has not been configured.
Note the URL that you used to access the mail.cgi
script. We'll be using that later.
Step #2 Create the .dada_files directory and directory hierarchy
In your home directory (preferably), create a directory called, .dada_files
. In this directory, create the following directories:
.archives
.backups
.configs
.lists
.logs
.templates
.tmp
You may use the following command:
cd; mkdir .dada_files; cd .dada_files; mkdir .archives .backups \
.configs .lists .logs .templates .tmp
Step #3 Create the .dada_config file
A ready-to-use copy of the .dada_config
file is located in the, dada/extras/examples/example_dada_config.txt file. Copy the file/contents from this file into the .dada_files/.configs directory we just set up, in a file named, .dada_config
cd; cp public_html/cgi-bin/dada/extras/examples/example_dada_config.txt .dada_files/.configs/.dada_config
In the above command, public_html/cgi-bin/dada is the path to the dada directory, inside the cgi-bin
- change to fit your environment.
Step #4 Edit the .dada_config file
To start off, the .dada_config
file needs two variables changed and they are the first two variables on top of the file. They are:
$DIR
Set,
$DIR
to the absolute path of the.dada_files
directory we just set up. If you don't know the absolute path, change into your .dada_files directory, and issue the,pwd
command:cd; cd .dada_files; pwd
(prints,
/home/example/.dada_files
, for example)Set the $DIR variable to this, like so:
my $DIR = '/home/example/.dada_files';
$PROGRAM_URL
Set
$PROGRAM_URL
to the URL we used to access the,mail.cgi
script in the web browser.
$SUPPORT_FILES
Dada Mail needs a location for its static files - images, css files, javascript files, etc. In your account's public_html directory, create a new directory, called, dada_mail_support_files
:
mkdir /home/example/public_html/dada_mail_support_files
Then, copy the static
directory that's comes in the, dada
directory, into this new directory:
cp -R /home/example/public_html/cgi-bin/dada/static /home/example/public_html/dada_mail_support_files/static
Set the variable, $SUPPORT_FILES
to the absolute server path, and URL of this directory:
$SUPPORT_FILES = {
dir => '/home/example/public_html/dada_mail_support_files',
url => 'http://example.com/dada_mail_support_files',
};
$PROGRAM_ROOT_PASSWORD - The Dada Mail Root Password
You'll also want to set the main, Dada Mail Root Password for Dada Mail in the .dada_config file. It's saved in the variable, $PROGRAM_ROOT_PASSWORD
. There's two ways to do this:
The first is to set the, $PROGRAM_ROOT_PASSWORD
variable to the Dada Mail Root Password you'd like to use:
# Start Root Password
$PROGRAM_ROOT_PASSWORD = 'sneaky';
$ROOT_PASS_IS_ENCRYPTED = 0;
# End Root Password
The second method is to set an encrypted version of our Dada Mail Root Password. This is what we seriously recommend.
To do so, visit your Dada Mail (in your web browser, go to the URL you're setting in the $PROGRAM_URL
variable) with this query string: ?f=pass_gen
. You're entire URL will look like this:
http://example.com/cgi-bin/dada/mail.cgi?f=pass_gen
if, http://example.com/cgi-bin/dada/mail.cgi is the URL to your Dada Mail.
Follow the instructions to encrypt your Dada Mail Root Password. You'll want to set the encrypted Dada Mail Root Password in the, $PROGRAM_ROOT_PASSWORD
variable as well as setting the, $ROOT_PASS_IS_ENCRYPTED
to, 1:
# Start Root Password
$PROGRAM_ROOT_PASSWORD = '8PnbnHfLVeBra';
$ROOT_PASS_IS_ENCRYPTED = 1;
# End Root Password
SQL Backend
This step is really optional, but we do encourage you to use the MySQL or PostgreSQL backend. It involves more editing of the .dada_config
.
You'll need to remove the following lines in your .dada_config
file:
# start cut for SQL Backend
=cut
and,
=cut
# end cut for SQL Backend
This will enable the SQL configuration
Next, create a new SQL database, specifically for Dada Mail. In these instructions, we're going to use MySQL, but there are other choices.
Note the server, database, username and password you've set up.
Then, create the necessary tables in that database. The schema needed will be in the, dada/extras/SQL directory. The one specific for MySQL is called,
dada/extras/SQL/mysql_schema.sql
Now, just fill out the variables in the .dada_config file. Here's the lines you're interested in:
# May just be, "localhost"
dbserver => 'localhost',
database => 'dadamail',
# MySQL: 3306
# PostgreSQL: 5432
port => '3306',
# MySQL: mysql
# PostgreSQL: Pg
# SQLite: SQLite
dbtype => 'mysql',
user => 'dadauser',
pass => 'dadapass',
For my database, I set the name as, "dadamail" the user as, "dadauser" and the password as, "dadapass". You should be able to spot them, in the code above.
All Set!
We are done setting up and configuring the .dada_config
file -
but do feel free to add to this outside configuration file whenever you like - most any variable located in the Config.pm
file can be added to this file. Any variable you do add, overrides the value you set in the Config.pm
itself. Think of the Config.pm file as where the default configuration of Dada Mail lives and your outside configuration file (.dada_config
) is where you'll want to set your customizations to make Dada Mail work with your own setup.
Step #5 Setting up the Config.pm file
The only thing the Config.pm
file needs to know, is the directory the .dada_config
file lives in. If you set the $DIR
variable inside the .dada_config
file to,
/home/example/.dada_files
the directory it lives in will be:
/home/example/.dada_files/.configs
Open up the Config.pm
file that's located in the dada/DADA directory and set the variable named, $PROGRAM_CONFIG_FILE_DIR
to the directory the outside config file lives in, like so:
$PROGRAM_CONFIG_FILE_DIR = '/home/example/.dada_files/.configs';
Save your changes.
Visit the, mail.cgi
script in your web browser again. If everything worked correctly, you should see the "Congrats" screen. All set!