This is a sample chapter of the Magicbook. The Magicbook can be purchased with Pro Dada, or by itself.

Advanced Dada Mail Setup


Introduction

A good foundation makes for a painless administrating of Dada Mail. These are advanced instructions on how to set up the program. We're going to be scuttling right through this, so please, as you read, install along. It's the best way to understand all of this.

These installation instructions are, in some ways, completely different than what is instructed on the support site. That's OK, since the goal of the installation below is ease of maintenance and ease of upgrading. These two things come at a cost: it takes a little longer to set up, but as you'll see, it'll save us dearly in the future.

The Dada Mail installation requires us to make a directory for the list information to be stored, upload the program itself into the cgi-bin of your server and to configure Dada Mail so it works with your server setup.


Download Dada Mail

Fetch Dada Mail at: https://dadamailproject.com/download

Dada Mail files are served up by Sourceforge, you can always see what else is available at:

http://sourceforge.net/project/showfiles.php?group_id=13002

From time to time, alpha and beta versions are released.

The download is in tar.gz (gnuzip) format, this is a different format than what Winzip uses, but a program like Winzip and Stuffit should have no difficulty uncompressing it, but make sure that your uncompressing utility does not change the file ending types and also keeps the file hierarchy.

Usually, when I'm doing a Dada Mail install, I'll create a directory on my desktop computer to download this file in, and then uncompress it there. This keeps me fairly organized.


Upload Dada Mail

Connect to your hosting account. In this example, I'm going to be using an FTP connection, since it's the easiest and most graphically oriented way of getting Dada Mail on the server.

In your cgi-bin, make a directory called 'dada'. You do not need to do anything fancy to this directory. In this new directory, upload the mail.cgi script and the DADA directory, with its contents in place (ie, don't move anything around). Don't worry yet about configuring the program yet. That's in just a little bit. The only thing you need to do is change the permissions of the mail.cgi script to 755.

There may be other files and directories in the directory you downloaded initially; probably an extras, extensions and plugins directories. We're not going to worry about those yet. You may want to go through the extras directory in your leisure, as it contains a copy of the documentation specific to that version of Dada Mail and a few other goodies.


Gather Configuration Information

In your web browser, go ahead and visit the program. You should see this screen:

Yikes! is right.

If you see this screen, you are witnessing the first cries of a newly born Dada Mail installation. Like a baby, it really can't yet care for itself, but it's alive and kickin'. As the parent, it's your job to, for a little while, nurture Dada Mail.

Dada Mail is telling you it hasn't been set up correctly, because, well, you haven't configured it at all. That's not your fault. We're getting to that. Like the new parent you are, we're going to be using and configuring Dada at the same time. There's a link on that screen, that says, Click Here.

Click There.

You'll be presented with a screen that will ask for your Dada Root Password. This is one of four variables you need to change. Since you haven't set one, don't worry about not knowing it, I'll tell you this time: the default value is root_password. Enter that, and click Continue.

You'll now be presented with a screen that tells you a few key bits of information -

One of these bits is your Home Directory. If you don't know your account's home directory (although you really ought to), Dada Mail tries to give you a good guess. This is very handy if you're working on a server that you are not familiar with. It seems that every server I've encountered, likes to set up things differently.

In this example, mine is /home/justin. Sometimes, FTP programs will give you a different home directory that what really exists. This is for security purposes, but can be incredibly annoying in situations, such as these. Dada Mail is taking a guess that your Public HTML directory, the directory you put files you can get to via a web server, is one directory below your home directory. If this isn't the case, Dada won't be able to find the current Home directory. You'll be on your own. Best to ask your system administrator. If you are the system administrator and don't know the home directory.... pray.

The other bit of information it gives you is your path to sendmail. It'll most likely give you a few of it's findings, but the sendmail program is usually found in either /usr/lib/sendmail or /usr/sbin/sendmail In this example, it has found /usr/sbin/sendmail, which I'll be using. Even if you use SMTP sending, I like to set the path to sendmail, as it's a good backup. If none of the values seem correct, you can always connect to your account via ssh or telnet and type in:

 which sendmail

Not too bad, Dada's just done the hardest part of our job.

What to do with this information? Usually, you'd use this information to plug in values in the first four variables inside the Config.pm file in the DADA directory. We're not exactly going to do that, we're going to make our own config file.

Before we do that, let's make those directories that Dada Mail uses to save it's information in.


Setting Up List Information Directories

Basic instructions for Dada Mail will tell you to set up a single directory for your Dada Mail files. This directory will hold each list's settings, templates, archives, blacklists, subscription lists, invitation lists, temporary files and who knows what else (birthday reminders, wedding anniversaries, art manifestos, lost left socks...). You could probably imagine that this directory gets very messy and hard to deal with if you set up a large number of lists. The easiest thing to do is to create more than one directory. I usually setup a directory called .dada_files (the dot before the name is a small security measure) and inside this directory, I create a directory called .lists, .logs, .templates, .archives, .backups and .tmp, for my subscription lists, any logs I set, templates that are created, archives, backup files Dada Mail automatically creates and finally, for any temporary files that are created by the program.

My .dada_files directory is usually placed in somewhere like this:

        /home/justin/.dada_files

My account is on a UNIX-like server, where absolute path to directories start with a slash '/' and continue down the directory tree. 'justin' is the name of my account, this is usually either my name or the name of my web site; it varies from server to server. I usually put '.dada_files' in my home account and never in the public html directory. I don't want this information available to someone with a web browser.

Inside .dada_files, I put the other directories we talked about above:

 /home/justin/.dada_files/.archives
 /home/justin/.dada_files/.backups
 /home/justin/.dada_files/.lists
 /home/justin/.dada_files/.logs
 /home/justin/.dada_files/.templates
 /home/justin/.dada_files/.tmp

If you need to, you may have the change the permissions of the directories so Dada Mail can create new files in these directories. Sometimes this means changing the permissions to '777'. I usually don't change the permissions on my directories, since my hosting provider has their server setup to use SuEXEC, which runs CGI scripts as the account user, instead of the web sever. I find that this is a Good Thing and when used correctly, can really help security. When picking hosts, you may want to ask the provider if they run their server under SuEXEC.

One other directory that we're going to make is one called .configs:

 /home/justin/.dada_files/.configs

where we're going to save our outside configuration file, which is what we're going to make next.

DO NOT change permissions of this directory. We do not want anything to be able to write or change the contents of this directory.


Making the Outside Configuration File

The outside configuration file is basically a text file that sets variables in the Config.pm file. When Dada Mail runs, it'll look for configurations in the outside config file. You can put almost any variable that's inside the Config.pm file in the .dada_config file. Open up a new window in your favorite text editor, and paste in the following:

 my $DIR = '/home/account/.dada_files';
 #---------------------------------------------------------------------#
 $PROGRAM_URL              = 'http://www.yoursite.com/cgi-bin/dada/mail.cgi';
 $PROGRAM_ROOT_PASSWORD    = 'root_password';
 $MAILPROG                 = "/usr/sbin/sendmail";
 #---------------------------------------------------------------------#
 $FILES                    = $DIR . '/.lists';
 $TEMPLATES                = $DIR . '/.templates';
 $TMP                      = $DIR . '/.tmp';
 $BACKUPS                  = $DIR . '/.backups';
 $ARCHIVES                 = $DIR . '/.archives';
 $LOGS                     = $DIR . '/.logs'; 
 #---------------------------------------------------------------------#
 $PROGRAM_USAGE_LOG        = $LOGS . '/dada.txt';
 #---------------------------------------------------------------------#

This will become the skeleton of .dada_config file. We'll still need to tweak it a bit

Save this file as .dada_config. You are done configuring your outside config file. Wasn't too hard now, was it?

Place the .dada_config file in the .configs directory you just set up.

One last thing.

Dada Mail needs to know about this outside config file, since it's really bad at guessing. We've stretched the powers of it's guessing with the home directory and path to sendmail tricks. We need to change one thing in the Config.pm file. Open the Config.pm file, which is located in the DADA directory that you initially downloaded up and find this line:

 $PROGRAM_CONFIG_FILE_DIR;

It should be after the first four variables.

Point it to the .configs directory:

 $PROGRAM_CONFIG_FILE_DIR = '/home/justin/.dada_files/.configs';

Save and upload the changes to the Config.pm file and visit the mail.cgi script in a web browser again:

Success!


Why Did We Just Go Through All That Trouble?

Troubleshooting

Onwards!

For the rest of this book, I'm going to suppose that your setup is like the one I just mentioned. Most of the custome tweaks we're going to make have to do with the .dada_config file. If you didn't set up the .dada_config file, you're going to have to make these changes in the Config.pm file itself. If you do this, just remember that you're going to be in tight corner if you ever decide to upgrade.

You'll also be presented with variables in:

 this typeface

If the variables are in ALL CAPS, They can be added to the .dada_config file. If you didn't set a .dada_config file and have just set the variables in the Config.pm file, you're going to have to hunt around and find the variables, and change them in place.

Have I mentioned the advantages of the outside .dada_config file enough? :)

 

Dada Mail Project

Download

Installation

Support