The Config.pm file holds all the variables needed to make global changes in Dada Mail.
You'll need to change 4 variables to get Dada Mail up and running. We've numbered them and provided help on the way, so let's start! People who are upgrading from previous versions will be able to use most of the same variable values as they've done before.
(1) Make a Dada Mail Root Password. This is used to Create New Lists. Tip -> make this somewhat obscure, and do not use ``dada'' or ``root_password'' or ``god'' or ``money'' or ``mail''.
Tip -> Comment the above line like this:
#$PROGRAM_ROOT_PASSWORD = 'root_password';
to totally disable new list creations. If you're not going to create new lists for a while, we suggest you comment that line for security reasons.
We also beg, plead and warn you that you really really should encrypt this password, by following the instructions located near the $ROOT_PASS_IS_ENCRYPTED variable.
(2) What is the Absolute Path the lists are going to be stored in? It's a good idea to store this information somewhere OTHER than under your public_html directory, to guarantee that no list information can be seen via a Web browser. You may have to chmod 777 this directory, or your cgi script won't be able to write new files to it. 777 is very open to outside eyes, so if you can, always set this to the minimum permission needed!
(3) What is the Absolute Path of your mail program? To find out, type in ``which sendmail'' in a telnet session. If you don't have sendmail, this script will still work great, but you may have to fiddle around with the ``$MAIL_SETTINGS'' variable under the ``additional settings'' after the first four variables. Dada Mail uses a Mail Program like Sendmail or qmail to send its messages and it needs to know where the Mail Program is to be able to use it.
(4) What is the URL of the mail.cgi script? This is the address of the mail.cgi script (not this file!), so when you're all done setting up the script, you'll have to go here to make your first list.
That's it, you're done! It's recommended that you set up at least one list to see if everything is working correctly and then fix problems (if any) that you find. All other variables either don't need to be changed or are advanced settings. Your error log is a great place to start figuring out what went wrong. If you don't have access to an error log, scroll through this file to see how to create an error log just for Dada Mail.
Here's a check-off list to make sure you've installed everything correctly. This list is somewhat long and exhaustive, as it covers most frequently asked questions that can be fixed in this file.
Check out the support section on the Dada Mail website:
http://mojo.skazat.com/support
if you have any more questions.
One last note:
Always Always Always set up a test list. Mailing List Managers are almost always in a critical state, since who knows how many thousands of people are interacting with your lists? Will this sending option work well? at all? Test. Test. Test. Test. You may want to read this entire file to get familiar with what Dada Mail does. Actually no: I really want you to read this entire file to get familiar with Dada Mail. It may take you a minute, but it will save you time in the future.
Another last note:
This file is going to be your best friend. It's chock full of information, advice, and ideas. Use it!
It's well advised that you get familiar with this program and go through it ENTIRELY before you change any of the settings below. From this point, it helps if you have some kind of Unix/Perl background, Or you've used previous versions of the script.
The ``S'' in $S_PROGRAM_URL stands for Secure, and allows you to have all screens that have anything to do with the list control panel to use a separate URL where you can install a completely different version of Dada Mail, or, if you can access your website via the https protocol, you can use that different URL specifically for list control panel activity.
Make sure $S_PROGRAM_URL contains a valid URL (http://...).
$SUBSCRIBER_DB_TYPE specifies the database you'd like to be using. The plain-as-grain one to use is 'PlainText', although others may be available and you may be so inclined to make your own. MySQL and PostgreSQL should be included in the standard distribution. To be able to use any SQL backend requires that you have access to an SQL database and that you have the DBI perl modules installed.
Set $SUBSCRIBER_DB_TYPE to MySQL for MySQL, PostgreSQL for Postgres.
If you do use a SQL database, you most likely have to tweak the %SQL_PARAMS hash.
Similar to $SUBSCRIBER_DB_TYPE, $ARCHIVE_DB_TYPE refers to what database type you'd like to be using for Dada Mail's archives. The default is Db, which refers to the DB File format (The Berkeley DB_File format).
Available also are MySQL and PostgreSQL.
Set $ARCHIVE_DB_TYPE to MySQL for Mysql, PostgreSQL for Postgres.
If you do use a SQL database, you most likely have to tweak the %SQL_PARAMS hash.
Similar to $SUBSCRIBER_DB_TYPE, $SETTINGS_DB_TYPE refers to what database type you'd like to be using for Dada Mail's archives. The default is Db, which refers to the DB File format (The Berkeley DB_File format).
Available also are MySQL and PostgreSQL.
Set $SETTINGS_DB_TYPE to MySQL for Mysql, PostgreSQL for Postgres.
If you do use a SQL database, you most likely have to tweak the %SQL_PARAMS hash.
Similar to $SUBSCRIBER_DB_TYPE, etc, $SESSION_DB_TYPE refers to what database type you'd like to be using for Dada Mail's admin control panel session. These sessions keep track of who's logged into what, and their credentials.
The default is PlainText.
Available also are MySQL, PostgreSQL, Db (For the Berkeley DB) and also, Classic, which isn't really a backend at all, but is actually the Old Way of doing things.
The Old Way of doing things is to keep the list you're using and the password (encrypted, of course), in the login session cookie itself. The other ways only save a session id - which is then used to fetch the list and password (again encrypted) from the server itself. The Classic way of doing things has the problem that the password, even encrypted, leaves the server environment, and leaves within your cookie. Not the best idea, so only use the Classic way, if there is simply no other way to make this work and understand the limitations of using the Old, Class Way.
If you do use a SQL database, you most likely have to tweak the %SQL_PARAMS hash.
%SQL_PARAMS are parameters passed to the SQL server. You need to fill these out if you're using either MySQL or PostgreSQL. (You also need to make a table for Dada Mail to work with, explained later.) They are as follows:
Before trying to install Dada Mail with an SQL backend, make sure you create the appropriate table. For MySQL users, make the table using this:
CREATE TABLE dada_subscribers ( email_id int4 not null primary key auto_increment, email text, list text, list_type text, list_status char(1) );
For Postgres, use this:
CREATE TABLE dada_subscribers ( email_id serial, email text, list text, list_type text, list_status char(1) );
If you are setting $ARCHIVE_DB_TYPE to an SQL, also issue one of the following tables -
For MySQL users, use this table:
CREATE TABLE dada_archives ( list varchar(32), archive_id varchar(32), subject text, message mediumtext, format text, raw_msg mediumtext );
For Postgres, use this:
CREATE TABLE dada_archives ( list varchar(32), archive_id varchar(32), subject text, message text, format text, raw_msg text );
Note! that the table schema for Archives has changed for version 2.9 or later - if you're upgrading, make sure your table now matches the new schema.
If you are setting $SETTINGS_FB_TYPE to an SQL, also issue this table (will work for both MySQL and Postgres)
CREATE TABLE dada_settings ( list text, setting text, value text );
Finally, if you are setting, $SESSION_DB_TYPE to an SQL, issue one of these tables:
For MySQL users, use this table:
CREATE TABLE dada_sessions ( id CHAR(32) NOT NULL PRIMARY KEY, a_session TEXT NOT NULL );
For Postgres, use this:
CREATE TABLE dada_sessions ( id CHAR(32) NOT NULL PRIMARY KEY, a_session BYTEA NOT NULL );
This section deals with Dada Mail and security - both to tighten it up and lax it down, depending on what you want to allow and what you can do.
Set $SHOW_ADMIN_LINK to '0' to take off the 'Administration' link that you see on the Dada Mail default page. You can always get to the administration page by pointing your browser to an address like this:
http://mysite.com/cgi-bin/dada/mail.cgi?f=admin
This is a small security measure but may just stop people from snooping further.
Complementary to the $SHOW_ADMIN_LINK variable, $ADMIN_FLAVOR_NAME allows you to set the URL needed to access the screen that has the form to log into all the lists administrated by Dada Mail and to the form to create a new list.
By default, this variable is set to, admin, which means to access this screen, you'd go to a URL that looks like this:
http://example.com/cgi-bin/dada/mail.cgi?flavor=admin
or:
http://example.com/cgi-bin/dada/mail.cgi?f=admin
or:
http://example.com/cgi-bin/dada/mail.cgi/admin
If you set $ADMIN_FLAVOR_NAME to something like, kookoo:
$ADMIN_FLAVOR_NAME ||= 'kookoo';
You'd then access this screen via the following URLS;
http://example.com/cgi-bin/dada/mail.cgi?flavor=kookoo
or:
http://example.com/cgi-bin/dada/mail.cgi?f=kookoo
or:
http://example.com/cgi-bin/dada/mail.cgi/kookoo
A small security measure for sure, but could help keep curious eyes at bay.
Works best if you have, $SHOW_ADMIN_LINK set to, 1.
A small note on how to set this variable correctly:
Invalid values:
etc. A good way to make sure would be to append, ``admin'' to your value, like this:
No checks will be made to make sure you don't have this value set to something already present, so do be careful setting this variable.
Similar to $ADMIN_FLAVOR_NAME, $SIGN_IN_FLAVOR_NAME holds the URL that allows you to log into a particular list (usually), although it is sometimes used to re-login into any of your lists - very similar to the administration screen, but does not give you the form to create a new list.
The same naming rules apply for this variable as they do for $ADMIN_FLAVOR_NAME. It's also suggested that you append, ``sign_in'' to the value you set this, like so:
etc.
If set to, 1, The only forms that will allow you to log into a Dada Mail list will be by a form supplied by Dada Mail itself. This means, you can't create a different form, outside the program to provide a way to login.
More so than any other option, this variable attempts to stop attempts of logging into a list by automated means.
By default on the list login screen, Dada Mail presents its user with a popup menu with the names of all the lists, hidden or not, that you can select to login to.
This is done by setting $LOGIN_WIDGET to 'popup_menu'.
If you want to only have a text box for someone to type in the list Short Name in, set $LOGIN_WIDGET to 'text_box'.
Allow the Root Password to Log In to All Lists
Set the '$ALLOW_ROOT_LOGIN' variable to '1' to allow the Dada Root Administrator to use the dada root password to log into any list. This is handy when you have many, many lists and need to tweak them but don't want to keep track of all the list passwords. Setting this variable to '1' does make your lists less secure, as every list can be accessed with the same password and that password is written plainly in this file, unless! you encrypt it (see below).
You can store an encrypted version of the $PROGRAM_ROOT_PASSWORD instead of the plain text version. Here are the steps. This is extremely recommended for obvious reasons.
http://yoursite.com/cgi-bin/dada/mail.cgi?f=pass_genYou'll see a page in your browser that asks for a password to encrypt. Type in the password you want to use, and press 'encrypt'. An encrypted password will be outputted. Copy that encrypted password and use it as the root password (that is, by changing the $PROGRAM_ROOT_PASSWORD variable above to the encrypted password). Set $ROOT_PASS_IS_ENCRYPTED below to '1'. Eat a mango. They're REALLY good.
You can block anyone from using any list control panel by specifying exactly what IP addresses are allowed. Leave the @ALLOWED_IP_ADDRESSES blank:
@ALLOWED_IP_ADDRESSES = qw();
to disable this security measure.
To add an address, just list it, like this:
@ALLOWED_IP_ADDRESSES = qw(123.456.67.678 215.234.56.9 783.456.9.2);
Please note that crafty people can spoof what IP address they're coming from, and dial-up accounts and connections using DHCP may not have the same IP address per session.
Setting $REFERER_CHECK to '1' will only allow you to access admin screens if the referer in your web browser is whatever is set in $PROGRAM_URL or $S_PROGRAM_URL. In other words, you won't be able to sign in to your list control panel, then stop, check your email on Yahoo! and come back to the list control panel by typing in its URL.
See:
http://search.cpan.org/~burak/GD-SecurityImage/lib/GD/SecurityImage.pm
For information,
Each key in this hashref corresponds to the different methods of this module ie:
Dada Mail uses cookies only for its login mechanism. Subscribers are not given a cookie.
$LOGIN_COOKIE_NAME holds the name of the cookie passed to the person's browser that will be accessing the list control panel.
Some browsers/servers funkify Dada Mail's cookies. I don't know why. You can set additional attributes that are written for Dada Mail cookies by tweaking the %COOKIE_PARAMS hash, as outlined:
http://search.cpan.org/author/JHI/perl-5.8.0/lib/CGI.pm#HTTP_COOKIES
|$MAILPROG -t -odq is great to use for very large lists as it queues up all messages, but may not be available in all situations.
Since Dada Mail 2.4, most optional flags aren't needed, as Dada Mail now handles the mailing of large lists well with its Batch Sending feature and sending mail through SMTP. These settings are still useful if you are using something other than Sendmail or qmail.
See the main page for Sendmail or whatever mail system your server uses for more info. Some flags for sendmail you can use are:
-io -> Not exit a line with only a dot is read.
-t -> Read the headers of the message to decide whom to send it to. (this is really good to have for qmail)
-odq -> Insert the message into a queue.
-oem -> On error, mail back the message attempting to deliver it immediately.
An example of using all those flags in the variable looks like this:
$MAIL_SETTINGS = "|$MAILPROG -oi -t -odq -oem";
Tip: change this to ``>>filename.txt''; to make Dada send email to a file instead of an email, for debugging. Here's something to look at: http://www.courier-mta.org/sendmail.html if you want more info.
NPH stands for No Parse Headers. I don't know what that means either, but Microsoft servers like it, and I've found that cookies don't get set correctly and you're left with a funky screen saying you did wrong without it. Set this variable to '1' if you're using a Windows server.
It's also a good idea to rename dada nph-dada.cgi for Windows servers that require scripts to use NPH.
$LOGS sort of holds the default location of where all the logs should be placed; you can then set the other logs using this as a starting point. For example:
$LOGS = '/home/account/dada_files/logs'; $PROGRAM_USAGE_LOG = $LOGS . '/usage.txt';
Sneaky. This makes a bit more sense if you're using an outside configuration file.
The dada log keeps track of mundane things, such as subscriptions, unsubscriptions, control panel logins, ...things like that. This can be pretty useful come debugging time, or if something went south during a very important mailing - best to turn this on /before/ that big mailing.
Turn logging on by specifying a absolute path to a file you want to use for the log. I personally always have this on, since it helps in finding a general trend and health of my list and can be beneficial if there is some sort of subscription dispute.
What should be logged?
Change each value to '1' in the %LOG hash if you want these things logged, change the variable to a '0' if you don't.
Not currently implemented, but $DEBUG_TRACE will allow you to set various error log tracing options.
If you want to set a specific location for all errors from Dada Mail to be logged, $PROGRAM_ERROR_LOG is what you want to look at.
Set this variable to, An absolute path, to a location of a file you want the error log to be. Sounds like a mouthful - let's break it down:
So, if you've set the $FILES variable correctly, you already know what absolute paths are. You see? You're smarter than you thought.
So, if I set $FILES to:
$FILES = '/home/myaccount/dada_files';
set, $PROGRAM_ERROR_LOG to:
$PROGRAM_ERROR_LOG = 'home/myaccount/dada_files/errors.txt';
and you're done.
Note! This WILL NOT work:
$PROGRAM_ERROR_LOG = $FILE . '/errors.txt';
So, don't do that.
Also, you cannot set this variable in an outside configuration file (.dada_config), it has to be set in the Config.pm file.
Finally, just to clarify, the program can't automatically set a error log, since there may be problems with the program, before it's able to be fully interpreted, so we have to hard code it, that's why there's this variable.
Control what outside CPAN modules give back debugging information. Set the value to, ``1'' to enabled debugging information from the CPAN module.
Example:
NET_SMTP => 1,
Read the inline comments - there may be instances where you can set these values to something other than, ``1'' if the CPAN module itself supports levels of debugging information (for example:DBI)
You can change the look and feel of Dada Mail globally by specifying a different template file to use. Examples of what these templates look like are located in the 'extras' directory.
Path to the admin template. The default admin template is located at:
dada/DADA/Template/templates/default_admin_template.tmpl
Path to the default user template, also know as the list template. We'll attempt to stick to one name from now on. The default user/list template is located at:
dada/DADA/Template/templates/default_list_template.tmpl
Templates, by default, are saved in the same directory as your lists. To make things cleaner and nicer, you can move them into their own directory by setting the $TEMPLATES variable to an absolute path to a directory.
Hopefully, this variable will not need to be used - it's a little confusing on what it does....
Dada Mail, internally, uses a separate templating language from what is exposed to list owners and such, called HTML::Template. More information:
http://search.cpan.org/~samtregar/HTML-Template-2.7/Template.pm
Dada Mail needs to know the absolute path to these templates, which (as of 2.9) is at:
/path/to/your/cgi-bin/dada/DADA/Template/templates
Sometimes, the automated thingy that figures this absolute path hangs for unknown reasons.
To thwart that, you can manually put the absolute path you need in $ALTERNATIVE_HTML_TEMPLATE_PATH like so:
$ALTERNATIVE_HTML_TEMPLATE_PATH = '/home/justin/cgi-bin/dada/DADA/Template/templates';
How do you know if you need to set this variable? Most likely, you'll get an error that contains something along the lines of:
HTML::Template::Expr->new() : Error creating HTML::Template object : HTML::Template->new() : Cannot open included file congrats_screen.tmpl : file not found. at
or something dealing with the ``File::Spec'' module.
Somewhat lame, I know.
Specifies the different directory that Dada Mail should use for writing temporary files. These files may contain sensitive data, like a copy of an outgoing message, so keep that in mind.
Set $ARCHIVES to the absolute path a directory that you want archives to be saved under.
Set $BACKUPS to an absolute path to a directory to where you want list backups to be saved.
%BACKUP_HISTORY sets how many different revisions of various list files are saved.
Currently, Dada Mail can use an inline HTML WYSIWYG Editor called FCKEditor for authoring of the HTML version of the mailing list message. To do this, you need to install FCKEditor.
How to install FCKeditor:
Download FCKeditor at:
http://www.fckeditor.net/download/default.html
Uncompress the distribution you receive. It should make a directory called, ``FCKeditor''
You'll want to put this entire directory into your public html directory of your hosting accout. Take note of the URL you'll need to access this directory.
Set the $FCKEDITOR_URL Config.pm variable to this URL.
Done!
To tweak the configuration of how FCKeditor works within Dada Mail (advanced stuff), see the:
/dada/DADA/Template/templates/FCKeditor_default_js_options.tmpl
file.
Setting SCREEN_CACHE to, 1 will save rendered HTML screens for future use, instead of having the program recreate them each and every time a certain screen is needed.
If you have dynamic information in list templates, you may not want to use this option.
More information:
A global black list means that all lists being run under Dada Mail use the same black list. Change the value to, ``1'' to enable.
This feature is only available using the SQL Subscriber backend.
Global Unsubscribe means that when a person unsubscribes from one list, they're unsusbcribed from every list under Dada Mail. Change the value to, ``1'' to enable.
This feature is only available using the SQL Subscriber backend.
It's advised that you take advantage of this feature if you also use the Global List Sending feature.
When enabled, Global List Sending will allow you to send one copy of your message to more than one list. If a subscriber is present on more than one list, they will only receive one copy of the message. Change the value to, ``1'' to enable.
This feature is only available using the SQL Subscriber backend.
It's advised that you use this feature with the Global Unsubscribe feature, since although messages will be sent to all subscribers, the list that they will be sent from will be somewhat random.
@PING_URLS holds the URLS that should be sent an XML-RPC message when you add a new message to your archive.
Here's more information:
http://www.xmlrpc.com/weblogsCom
You'll need the XMLRPC::Lite Perl module installed:
http://search.cpan.org/~rjray/RPC-XML-0.57/
If no parameters are passed to the mail.cgi script, you will see the default or main Dada Mail page. You can override that by setting any URL you want into $DEFAULT_SCREEN.
If you do override this screen, it is recommended that you provide some way to at least unsubscribe to every one of your lists.
By default, when you log into the administration area you are shown the ``Send a List Message'' screen. You can specify a different URL to go to by changing the $DEFAULT_ADMIN_SCREEN variable.
When a user clicks the, ``Logout'' link on left hand menu of the control panel, they'll be redirected to the URL located in the, $DEFAULT_LOGOUT_SCREEN variable. By default, this is set to the, $PROGRAM_URL variable.
This generates the admin menu's various links and features, which can then be turned on and off via the control panel. You shouldn't fool around with $ADMIN_MENU itself unless you want to add a feature, like a plugin.
$LIST_QUOTA, when set to anything other than undef, can be used to set the maximum number of lists a Dada Mail install can have at one time.
Customize the ``View List'' Screen in the Administration Area: You can turn off and on many of the features in the ``View List'' administration area. If lists get really large, it may take some time for this page to load...and some people have reported that the screen won't load at all. The main reason for this is the scroll box that holds a list of all the subscribed people. Not only does it take time to sort through the list in alphabetical order and then print all the addresses out, it's also a huge burden for the browser to render a select box that large. It's not much help anyways to have a select box holding 10,000 email addresses. You can stop this select box from being shown by editing the below variable to '0'.
To turn it on again, change this variable to '1'.
$EMAIL_CASE configures dada to either lowercase ONLY the 'domain' part of an email, or lowercase the entire email address. Lowercasing the domain is the correct way, since the 'name' part of an email should be case sensitive, but it is almost never handled that way. Set this to 'lc_domain' to lowercase JUST the domain, or set this to 'lc_all' to lowercase the entire email address.
@EMAIL_EXCEPTIONS allows you to enter email addresses that wouldn't normally pass the email address validator. Good for testing offline when all you have is, say, root@localhost working.
$LIST_IN_ORDER controls whether your email list is handled in alphabetical order. Having a list in alphabetical order makes a list easier to work with but BE WARNED that this will, especially when you're using a plain text list, slow things down. If you have small lists then this shouldn't be too much of a problem. Set this variable to '1' to have your list sorted, '0', to keep your list unsorted.
This variable tells Dada Mail if you should show the ``Top-Level Domains'' table. You might not be interested in this information, or maybe your list is so large that your ``View List'' page is having trouble loading. Change this to '0' to stop the table from being shown.
The Domain Table can also be customized. You can put in or take away any top-level domain ending (like com or edu) by changing this list. Just add to the list, or delete something out of it - follow the pattern. Lots of top-level domain listings won't necessarily slow down the ``View List'' page.
This variable tells Dada Mail if it should show the ``Services'' table. Change it to '0' if you're not interested in this information, or if your list is so large that your ``View List'' page is having trouble loading.
The services Panel can also be customized. You can put in or take away any service that you want to track by adding a record in between the parentheses. Here's an example of what a new service would look like:
'Altavista' => 'altavista.net',
Put the NAME of the service on the left, and the domain ending that corresponds to that service on the right. The domain ending for America Online is ``aol.com'' - follow the pattern!
$FILE_CHMOD is a variable that sets what permission Dada Mail sets files to when it initially writes them. You can set it to a few things:
0660 - probably all you need 0666 - allows anyone to read and write files in the $FILES directory 0755 - probably insecure 0777 - shooting yourself in the foot insecure 0600 - godawful paranoid about the whole thing - life in general, as secure as it gets
It's a good idea to figure out what works and leave this variable alone after your lists are set up, as you may not be able to access a list under a different $FILE_CHMOD.
We've changed what the $FILE_CHMOD Dada Mail is shipped (02/13/01) with from 0660 to 0666. Note that this may be less secure than 0660, but may solve some problems people are having. Change this back to 0660 if everything seems to have been running just fine.
Similar to $FILE_CHMOD, $DIR_CHMOD sets permissions to Directories created with Dada Mail. At the moment, this is limited to backup directories.
There are links on the bottom of some of the List Control Panel screens that go to helpful tutorials on the Dada Mail support site. If you'd like these messages taken off, set this variable to '0'.
Provides an easy way to change the base URL of the Help Links. Not very useful, unless you want to have your own version of the Help Links.
Charsets that Dada Mail supports. These are the most used; to add your own would look like this:
'Description charset',
There's a TAB between the Description and the actual charset: THIS IS REALLY IMPORTANT.
This is the default group of Precedences used when sending Bulk Messages. Be warned that the SMTP sending may not support any other precedence value except the ones listed here. The Default is ``undef'', which will stop the Precedence header from being written out.
These are the default content-types. Add your own, have fun.
Priorities of mailings. I find people sending me things with the highest priority to tell me about credit cards really don't garner my attention.
This is how you can set all the variables located in the Config.pm module outside of the module itself. Why would you want to do that? It makes Dada Mail more upgradable: every time you upgrade Dada Mail you don't have to tweak this file (or tweak it only slightly); you just throw up the new distro and away you go! Now, Dada Mail finds this external config file in a bunch of ways.
You can implicitly set the directory it lives in by changing the $PROGRAM_CONFIG_FILE_DIR variable that lives inside the Config.pm module. Wherever the external config file lives, it needs to be called .dada_config
If you don't change the $PROGRAM_CONFIG_FILE_DIR variable in the
Config.pm file, Dada Mail will try to look in your home directory for
the .dada_config file. It tries to find your home directory in
different places, one is the Environment Variable $ENV{'HOME'} and
by called the getpwuid()
function as so:
getpwuid $> )[7]
The rub with these is that you usually can't get anything from the
getpwuid()
function unless you run the script as the same user that
created it, ie via suEXEC or by setting the setuid bit.
So, knowing this, the easiest, most suprise-unfriendly way to set the .dada_config file directory location is to *sigh* set it in this here Config.pm module. I'll leave setting the setuid bit for scripts that use the Config.pm file decision up to you.
If you don't set any of the above, Config.pm will use the same directory that it's in as the directory to find the .dada_config file, which I guess ain't the worst way to go about things.
Anyways, an example of a .dada_config file would look like this:
$PROGRAM_ROOT_PASSWORD = 'root_password'; $FILES = '/home/home_dir/dada_lists_dir'; $MAILPROG = '/usr/lib/sendmail'; $PROGRAM_URL = 'http://yoursite.com/cgi-bin/dada/mail.cgi';
Pretty much any variable, array or hash can be saved in the
.dada_config file, as long as it's not set inside a BEGIN{} block,
which leaves out $PROGRAM_ERROR_LOG and @AnyDBM_File::ISA
Treat .dada_config as a file that gets eval()
right into Config.pm
because, well, that's what happens. Because of this, great care should
be made in where you put .dada_config
The $PROGRAM_CONFIG_FILE_DIR is located at the top of the Config.pm file, right after the first 4 variables for easy getting-at and fumbling.
If you need to set a variable in the outside config file to '0', it may not work. Instead, try setting it to '2'.
Dada Mail uses the HTML::FromText CPAN module to convert plain text to HTML when showing plain text in archives and things like that. You can change the behavior of this formatting by changing what arguments get passed to the Text2HTML module, as described here:
http://search.cpan.org/author/GDR/HTML-FromText-1.005/FromText.pm#SUMMARY_OF_OPTIONS
These are the MIME types Dada Mail understands. The file ending is on the left, what MIME type it maps to is on the right. Feel free to add your own. Dada Mail should be able to figure out the MIME type of a file, but when it can't, it'll fall back on this.
In case nothing up there matches what someone is trying to upload, there's a default MIME type for a last ditch guess. Some mail readers are sophisticated enough to figure out what an attachment is without its MIME type, but don't count on it.
This is set for the $MIME::Lite::PARANOID variable. Set it to '1' if you don't know if you have the MIME::Base64 or MIME::QuotedPrint or you don't know what those are. :)
Set mime_hush to '1' to suppress/unsuppress all warnings coming from this module.
Set to: 'faster', 'less memory', or 'no tmp files'. This controls how the MIME::Parser works. For more information:
http://search.cpan.org/~dskoll/MIME-tools-5.417/lib/MIME/Parser.pm#OPTIMIZING_YOUR_PARSER
This is the default ``subscription successful!'' email message. This message can be customized for each list in the list's Control Panel.
This is the default ``unsubscription successful!'' email message. This message can be customized for each list in the list's Control Panel.
This is the default ``subscription confirmation'' email message. This message can be customized for each list in the list's Control Panel.
This is the default ``subscription confirmation'' email message. This message can be customized for each list in the list's Control Panel.
This is the default ``Mailing List!'' email message. This message can be customized for each list in the list's Control Panel.
Similar to $MAILlING_LIST_MESSAGE, but used specifically for HTML messages.
This message is sent to someone who is not allowed to post to your list using the dada_bridge.pl script. If you do not use the dada_bridge.pl script, this won't be of any use to you! This message can be customized for each list in the list's Control Panel.
Shown when a request to subscribe is successful.
Shown when a request to unsubscribe is successful.
Shown when a subscription is successful.
Shown when an unsubscription is successful.
The text version of the list invitation message.
The HTML version of the list invitation message.
The text version of the message sent when an archived message is sent to a friend.
The HTML version of the message sent when an archived message is sent to a friend.
These defaults will be used when CREATING a new list. These defaults will also be used for existing lists if there isn't a variable already set. These values correspond to the values created in the list databases. An example would be:
%LIST_SETUP_DEFAULTS = ( black_list => 1, send_via_smtp => 1, );
This would setup all lists created now with blacklists on, and mail being sent using SMTP.
Note! You *can* enter the passwords for both POP3 (for POP-before-SMTP stuff) and the SMTP SASL password here, but they will be in plain text. When these passwords are saved in the list settings, they are encrypted.
Similar to, %LIST_SETUP_DEFAULTS, %LIST_SETUP_INCLUDE holds defaults values for lists.
The difference is that any value NOT set here, will be set, in accordance to what %LIST_SETUP_DEFAULTS already has. Because of this, it's much more convenient to use this variable in the outside config file.
For example, if you set up the bounce handler with the bounce email of, ``bounce@example.com'', you could set %LIST_SETUP_INCLUDE to have these values:
%LIST_SETUP_INCLUDE = ( set_smtp_sender => 1, # For SMTP add_sendmail_f_flag => 1, # For Sendmail Command admin_email => 'bounce@example.com', );
And all new lists would automatically be hooked up to the bounce handler.
%LIST_SETUP_OVERRIDES will override any setting that's in the %LIST_SETUP_DEFAULTS hash and whatever is set in the list preferences.
(advanced hacker stuff)
Dada Mail tries to guess your Operating System using the $^O variable. If it's guessing wrong, you can set it yourself.
$NULL_DEVICE refers to where the /dev/null device or file or whatever you more smert people call that thing... is located. On most *nix's, it's at /dev/null. You may have to change it. For example, if you're a Windows folk.
if this is taken off, the seed random number will be made from the time, or from something pretty random, depending on your version of Perl.
Where is the salt number located in the encrypted password? It's
usually at substr(0,2)
but may be different on different systems,
some systems are set to substring(3,2).
Actually, I've only had this problem on one system - mine :) -
which was a FreeBsd 4.0 distro. Under most cases, this is NOT going
to be your problem!
The salt number. Change $SALT to
$SALT = "mj";
if all else fails.
A pin number is made when someone wants to subscribe to your list. They will get a confirmation email with a special link that includes their email, and a pin that's generated from the email and the variables below using a mathematical equation. It's much harder to guess a pin with these two variables changed:
Change what DB Dada Mail will use. Dada Mail can use various db packages to save each list's information. It looks for the best one and uses the next package in the list if it can't find it. If you get a software error (an error 500, not having any information changed when creating a new list) you may have to change this to:
BEGIN { @AnyDBM_File::ISA = qw(SDBM_File) }
SDBM is the worst package to use, but it is always available with perl. See the man page for the AnyDBM_File for more information.
Check the AnyDBM_File for more info.
To add an attachment to a list message in Dada Mail from the control panel, we have to upload it via the web browser. There are two ways we can do this. One is to save the information in the $FILES directory and then open it up, attach it, and then delete it; and the other involves some magical qualities of CGI.pm and MIME::Lite, probably coupled with your server's /tmp file, if you can use it. Setting $ATTACHMENT_TEMPFILE to '1' uploads, saves, attaches and then deletes the file. Setting it to '0' does it magically. I suggest '1', unless you want to play around with it.
See: http://search.cpan.org/~gyepi/Mail-Verp-0.05/Verp.pm
This is the version of this Dada Mail Program. Mostly it's used to see if there's a new version out there to use and to say that you've got the freshest tools on the Web.
This is the name of the program. I guess if this script has a mid-life crisis or something, it can change its name, buy a really fast car and start chasing guys half her age.
If you need further support for this script, please do not email me directly, but use one of the following channels:
My name is Justin Simoni
Copyright (c) 1999 - 2006 Justin Simoni All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
To riding bicycles.