# Lost? Scroll down for the 4 variables that you need to change. For # instructions, go to: # # http://dadamail.org/installation/ =pod =head1 NAME Config.pm =head1 DESCRIPTION Hello! Welcome to the Dada Mail Config.pm File! Here, you'll be able to set up your entire mailing list system quickly and easily. Please look at the end of this file for copyright, license and general information. Donations are always welcome. Follow the instructions closely and this process should be pretty easy. A few things before we get started. This is a Perl program, so it follows certain programming conventions. You just can't put anything in this file and expect it to work. First off: The '#' (pound character) is used for commenting, any line starting with this character is used to write notes and comments. It won't be seen to Perl as code and it is safe to write whatever you want with, like this: # This is a comment. yeee ha. Also, this file has documentation embedded in itself; if you're looking at this sentence in anything other than the Congig.pm file itself, the documentation has been extracted and saved somewhere else. That's cool, just trust us. The documentation is called POD and looks like this: =pod I am pod and I am, OK =cut Exciting stuff, we know Lastly, words that start with a '$' (dollar sign) are variables, They're Perl code that stand for something else. You'll need to change some variables (only 4) in this file to make Dada Mail work correctly. This will be the only file you'll need to change out of the whole bunch. To set up Dada Mail,follow the instructions exactly. This file is HEAVILY commented to help you along your way, be sure to read all the notes! :) Scroll down about 5 lines until you see the next group of comments to start setting up Dada Mail. =cut # Almost there! Keep scrolling down... -V package DADA::Config; require Exporter; @ISA = qw(Exporter); @EXPORT = qw($VER $PROGRAM_ROOT_PASSWORD $MAILPROG $FILES $PROGRAM_URL $S_PROGRAM_URL $MAIL_SETTINGS $FIRST_SUB $SEC_SUB @C $SALT $FILE_CHMOD $DIR_CHMOD $MAKE_ALL_LIST_FILES $FOOTER $HTML_FOOTER $SUBSCRIBED_MESSAGE $UNSUBSCRIBED_MESSAGE $CONFIRMATION_MESSAGE $HTML_CONFIRMATION_MESSAGE $HTML_UNSUB_CONFIRMATION_MESSAGE $HTML_SUBSCRIBED_MESSAGE $HTML_UNSUBSCRIBED_MESSAGE $ARCHIVES $TEMPLATES $TMP $LOGS $BACKUPS %BACKUP_HISTORY $SUBSCRIPTION_SUCCESSFUL_COPY $MAILlING_LIST_MESSAGE $MAILlING_LIST_MESSAGE_HTML $ADMIN_MENU $NOT_ALLOWED_TO_POST_MESSAGE $PIN_WORD $PIN_NUM @DOMAINS %SERVICES $SHOW_DOMAIN_TABLE $SHOW_SERVICES_TABLE $SHOW_EMAIL_LIST $GOOD_JOB_MESSAGE $NO_ONE_SUBSCRIBED $ALLOW_ROOT_LOGIN $SMTP_ADDRESS $SMTP_ERROR_LOG $SMTP_CONVERSATION_LOG $SMTP_TRUSTING $UNSUB_CONFIRMATION_MESSAGE $DEFAULT_SUBMIT_STYLE %STYLE @CHARSETS @PRECEDENCES @CONTENT_TYPES %LIST_SETUP_DEFAULTS %LIST_SETUP_OVERRIDES @SERVICES %PRIORITIES $ATTACHMENT_TEMPFILE %MIME_TYPES $DEFAULT_MIME_TYPE $TEXT_INVITE_MESSAGE $HTML_INVITE_MESSAGE $MIME_PARANOID $MIME_HUSH $NPH $PROGRAM_USAGE_LOG $ROOT_PASS_IS_ENCRYPTED @ALLOWED_IP_ADDRESSES $SHOW_ADMIN_LINK %LOG $ADMIN_MENU $EMAIL_CASE @EMAIL_EXCEPTIONS $LIST_IN_ORDER $ADMIN_TEMPLATE $USER_TEMPLATE $DB_TYPE $ARCHIVE_DB_TYPE %SQL_PARAMS $PROGRAM_ERROR_LOG $SHOW_HELP_LINKS $PROGRAM_NAME $FORK_SMTP_BULK_MAILINGS @CONTENT_TRANSFER_ENCODINGS $PROGRAM_CONFIG_FILE_DIR $OS $DEFAULT_ADMIN_SCREEN $DEFAULT_SCREEN $HTML_CHARSET $HTML_SEND_ARCHIVED_MESSAGE $SEND_ARCHIVED_MESSAGE $REFERER_CHECK $LOGIN_COOKIE_NAME %COOKIE_PARAMS %HTMLFROMTEXT_OPTIONS $LOGIN_WIDGET $NULL_DEVICE $LIST_QUOTA %EMAIL_HEADERS @EMAIL_HEADERS_ORDER); use vars qw(@EXPORT $VER $PROGRAM_ROOT_PASSWORD $MAILPROG $FILES $PROGRAM_URL $S_PROGRAM_URL $MAIL_SETTINGS $FIRST_SUB $SEC_SUB @C $SALT $FILE_CHMOD $DIR_CHMOD $MAKE_ALL_LIST_FILES $FOOTER $HTML_FOOTER $SUBSCRIBED_MESSAGE $UNSUBSCRIBED_MESSAGE $CONFIRMATION_MESSAGE $HTML_CONFIRMATION_MESSAGE $HTML_UNSUB_CONFIRMATION_MESSAGE $HTML_SUBSCRIBED_MESSAGE $HTML_UNSUBSCRIBED_MESSAGE $ARCHIVES $TEMPLATES $TMP $LOGS $BACKUPS %BACKUP_HISTORY $SUBSCRIPTION_SUCCESSFUL_COPY $MAILlING_LIST_MESSAGE $MAILlING_LIST_MESSAGE_HTML $ADMIN_MENU $NOT_ALLOWED_TO_POST_MESSAGE $PIN_WORD $PIN_NUM @DOMAINS %SERVICES $SHOW_DOMAIN_TABLE $SHOW_SERVICES_TABLE $SHOW_EMAIL_LIST $GOOD_JOB_MESSAGE $NO_ONE_SUBSCRIBED $ALLOW_ROOT_LOGIN $SMTP_ADDRESS $SMTP_ERROR_LOG $SMTP_CONVERSATION_LOG $SMTP_TRUSTING $UNSUB_CONFIRMATION_MESSAGE $DEFAULT_SUBMIT_STYLE %STYLE @CHARSETS @PRECEDENCES @CONTENT_TYPES %LIST_SETUP_DEFAULTS %LIST_SETUP_OVERRIDES @SERVICES %PRIORITIES $ATTACHMENT_TEMPFILE %MIME_TYPES $DEFAULT_MIME_TYPE $TEXT_INVITE_MESSAGE $HTML_INVITE_MESSAGE $MIME_PARANOID $MIME_HUSH $NPH $PROGRAM_USAGE_LOG $ROOT_PASS_IS_ENCRYPTED @ALLOWED_IP_ADDRESSES $SHOW_ADMIN_LINK %LOG $ADMIN_MENU $EMAIL_CASE @EMAIL_EXCEPTIONS $LIST_IN_ORDER $ADMIN_TEMPLATE $USER_TEMPLATE $DB_TYPE $ARCHIVE_DB_TYPE %SQL_PARAMS $PROGRAM_ERROR_LOG $SHOW_HELP_LINKS $PROGRAM_NAME $FORK_SMTP_BULK_MAILINGS @CONTENT_TRANSFER_ENCODINGS $PROGRAM_CONFIG_FILE_DIR $OS $DEFAULT_ADMIN_SCREEN $DEFAULT_SCREEN $HTML_CHARSET $HTML_SEND_ARCHIVED_MESSAGE $SEND_ARCHIVED_MESSAGE $REFERER_CHECK $LOGIN_COOKIE_NAME %COOKIE_PARAMS %HTMLFROMTEXT_OPTIONS $LOGIN_WIDGET $NULL_DEVICE $LIST_QUOTA %EMAIL_HEADERS @EMAIL_HEADERS_ORDER); use strict; =pod =head1 Dada Mail Set Up Instructions 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. =head2 $PROGRAM_ROOT_PASSWORD (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" =cut $PROGRAM_ROOT_PASSWORD = 'KqPUxw0tYHx6c'; =pod 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 follow the instructions located near the $ROOT_PASS_IS_ENCRYPTED variable. =head2 $FILES (2. What is the Absolute Path the lists going to be stored in? Its a good idea to store this information somewhere OTHER than under your public_html directory, to gaurantee 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, if you can, always set this to the minimum permission needed! =cut $FILES = '/home/sbrank/public_html/mailing_list/dada_files'; =pod =head2 $MAILPROG (3. What is the Absolute Path of your mail program? (type in "which sendmail" in a telnet session if you don't have sendmail, this script will still work great, 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. =cut $MAILPROG = '/usr/sbin/sendmail'; =pod =head2 $PROGRAM_URL 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. =cut #$PROGRAM_URL ='http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi'; $PROGRAM_URL ='http://www.spam-blockers.com/mailing_list/mail.cgi'; =pod 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 (if any) problems 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. =over =item * If you are upgrading from Dada Mail 2.x, it's well advised that you first test this version in a different directory and see if its working. Lists made with previous versions of Dada Mail 2.x will work with this version and lists generated using this version will also be compatible with any previous 2.x versions. =item * Upload the mail.cgi script _and_ the DADA folder (both as text, NOT binary). If you are upgrading from a previous version of Dada Mail 2.x, you'll need to replace the entire DADA folder. Make sure you upload everything that's in DADA folder, even the Mail and MIME folders =item * chmod 755 the mail.cgi script. Nothing needs to be changed permissions-wise in the DADA folder. Make sure you save the Config.pm file (this file!) and make sure that you put it back in the DADA folder. =item * Run Dada Mail by going to the URL that you put in the '$PROGRAM_URL' variable. If you don't see anything, or get a 404, you're probably using the wrong address. Some hosting services put the cgi-bin in a weird spot and you'll need a special address. =item * If, when making a new list, everything seems to work but Dada Mail isn't saving any information, make sure that there exists a directory you've specified in the '$FILES' variable, and make sure you can write to that directory. You may need to chmod 777 that directory. Usually setting this variable to be somewhere in your cgi-bin is NOT A GOOD IDEA. Sometimes you cannot write files into your cgi-bin anyways. =item * If everything is working well except no mail is being sent, (not a good thing for a Mailing List Program!) you may have to fiddle with the $MAIL_SETTINGS variable, located farther down this file or make sure that you have the correct address in the $MAILPROG variable. =item * All other variables below don't need to be changed to have Dada Mail run incredibly. They're provided to allow you to tweak the program to your liking. We tried to make the program a breeze to set up and to also make it customizable. Not an easy task. =back Check out the support section on the Dada Mail website: http://dadamail.org/support If you have any more questions B 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. B This file is going to be your best friend. It's choke full of information, advice and ideas. Use it! =cut =pod =head1 Additional Settings It's well advised that you get familiar with this program and go through it ENTIRELY before you change any of the below settings, From this point, it helps if you have some kind of Unix/Perl background, Or you've used previous versions of the script. =cut $PROGRAM_CONFIG_FILE_DIR = undef; #------------------ #leave this alone | _config_import(); #------------------ =pod =head2 $S_PROGRAM_URL The "S" in $S_PROGRAM_URL stands for Becure, 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 protocal, you can use that different URL specifically for list control panel activity. Make sure $S_PROGRAM_URL contains a valid URL (http://...). =cut $S_PROGRAM_URL ||= $PROGRAM_URL; =cut =pod =head2 $DB_TYPE B<$DB_TYPE> specifies what 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. B and B 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 B perl modules installed. Set $DB_TYPE to B for Mysql, B for Postgres. If you do use a SQL database, you most likely have to tweak the B<%SQL_PARAMS> hash. =cut $DB_TYPE ||= 'PlainText'; =cut =pod =head2 $ARCHIVE_DB_TYPE Similar to $DB_TYPE, I<$ARCHIVE_DB_TYPE> refers to what database type you'd like to be using for Dada Mail's archives. The default is, B, which refers to the DB File format (ex: The Berkeley DB_File format) Available also are B and B. Set $ARCHIVE_DB_TYPE to B for Mysql, B for Postgres. If you do use a SQL database, you most likely have to tweak the B<%SQL_PARAMS> hash. =cut $ARCHIVE_DB_TYPE ||= 'Db'; =cut =pod =head2 %SQL_PARAMS B<%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: =over =item database The name of the database you are using =item dbserver The name of the database server itself. Example: I =item port The port that is used when connecting to the database server. You usually only needs this for Postgres. =item dbtype set dbtype to 'mysql' for MySQL usage, 'Pg' for Postgres. =item user The SQL username =item pass The SQL password =back 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 the following table: CREATE TABLE dada_archives ( list varchar(32), archive_id varchar(32), subject text, message text, format text ); (should work for both MySQL and Postgres) =cut %SQL_PARAMS = ( database => '', dbserver => '', port => '', dbtype => '', # 'mysql' for 'MySQL', 'Pg' for 'PostgreSQL' user => '', pass => '', subscriber_table => 'dada_subscribers', archives_table => 'dada_archives', ) unless keys %SQL_PARAMS; =pod =head1 Security 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. =head2 $SHOW_ADMIN_LINK 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. =cut $SHOW_ADMIN_LINK ||= 1; =pod =head2 $LOGIN_WIDGET By default, on the list login screen, Dada Mail presents it's 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 B<$LOGIN_WIDGET> to 'popup_menu'. If you want to only have a text box for someone to type in the listshortname in, set B<$LOGIN_WIDGET> to 'text_box' =cut $LOGIN_WIDGET ||= 'popup_menu'; =pod =head2 $ALLOW_ROOT_LOGIN B 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 off 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) =cut $ALLOW_ROOT_LOGIN ||= 1; =pod =head2 $ROOT_PASS_IS_ENCRYPTED You can store an encrypted version of the $PROGRAM_ROOT_PASSWORD, instead of the plain text version and here are the steps. This is B recomended for obvious reasons. =over =item 1 set up Dada Mail so it's working, usually this means setting up the first four variables. =item 2 point your browser to wherever you have the dada.cgi script at, and at the end of the url, append this: ?f=pass_gen so you'll have something that looks like this: http://yoursite.com/cgi-bin/dada/mail.cgi?f=pass_gen =item 3 You'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. =item 4 Copy that encrypted password and use it as the root password. =item 5 Set $ROOT_PASS_IS_ENCRYPTED (below) to '1'; =cut $ROOT_PASS_IS_ENCRYPTED ||= 1; =pod =item 6 eat a mango. they're REALLY good. =back =head2 @ALLOWED_IP_ADDRESSES 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); =cut @ALLOWED_IP_ADDRESSES = qw() unless scalar @ALLOWED_IP_ADDRESSES; =pod 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. =head2 $REFERER_CHECK 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 into your list control panel, then stop, check your email on Yahoo! and come back to the list control panel by typing in its URL. =cut $REFERER_CHECK ||= 0; =pod =head1 Cookies Dada Mail uses cookies only for its login mechanism. Subscribers are not given a cookie. =cut =pod =head2 $LOGIN_COOKIE_NAME B<$LOGIN_COOKIE_NAME> holds the name of the cookie passed to the person's browser that will be accessing the list control panel. =cut $LOGIN_COOKIE_NAME ||= 'dadalogin'; =pod =head2 Cookie Paramaters. 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 =cut %COOKIE_PARAMS = ( -path => '/', ) unless keys %COOKIE_PARAMS; =pod =head1 SMTP Settings You can send email using an SMTP server instead of the sendmail program. If you can, we suggest you do. Dada Mail uses the amazing Mail::Bulkmail module to do all SMTP sending. =head2 $SMTP_ADDRESS B B - to set a default SMTP address, set the B<%LIST_SETUP_DEFAULTS> B to a valid SMTP server. It's easy enough to set an SMTP address for a list via the list control panel, under B. =cut $SMTP_ADDRESS ||= undef; =pod =head2 $SMTP_ERROR_LOG SMTP can be a bit more tricky than regular mailings, you can specify an error log just for SMTP mailings. =cut $SMTP_ERROR_LOG ||= ''; =pod =head2 $SMTP_CONVERSATION_LOG To further aid debugging SMTP problems, you can set the $SMTP_CONVERSATION_LOG to an absolute path to a file you want the log written to. This log will hold almost the entire conversation Dada Mail will have with the SMTP server and B be used in a production environment. Among the things it logs will be passwords, if you are using SALS authentication. =cut $SMTP_CONVERSATION_LOG ||= ''; =cut =head2 $SMTP_TRUSTING (from Mail::Bulkmail) - By default, Mail::Bulkmail will only allow you to use valid e-mail, valid dates, valid timezones, and valid precedences. Turn it on by setting it (in this case $SMTP_TRUSTING) to some non-zero value. This will bypass all error checking. You should probabaly just leave it off so you can check for valid e-mails, dates, etc. Note: this only refers to SMTP sending, not the rest of Dada Mail. We just thought you'd like the option. =pod =cut $SMTP_TRUSTING ||= 1; =pod =head2 $FORK_SMTP_BULK_MAILINGS This is mostly for WinNT users, but you can send messages, without forking AS LONG AS you're using an SMTP server and YOU ARE NOT using batching. To do that, change this variable to '0'; You most likely will not want to set this variable to '0' unless there is just no other way. =cut $FORK_SMTP_BULK_MAILINGS ||= 1; =pod =head1 sendmail Settings =head2 $MAIL_SETTINGS B<|$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 man 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 immediently. 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 =cut $MAIL_SETTINGS ||= "|$MAILPROG -t"; =pod =head1 Windows Specific Settings =head2 $NPH 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. Set this varable to '1' if you're using a Windows server. =cut $NPH ||= 0; =pod It's also a good idea to rename dada nph-dada.cgi for windows servers that require scripts to use NPH. =pod =head1 Logging =head2 $PROGRAM_USAGE_LOG The dada log keeps track of mundane things, such as subscriptions, unsubscription, control panel logins... things like that. This can be pretty useful come debugging time, or 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 benificial if there is some sort of subscription dispute. =cut $PROGRAM_USAGE_LOG ||= ''; =pod =head2 %LOG 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 =cut # log subscriptions/unsubscriptions? $LOG{subscriptions} ||= 1; # log regular mailings? $LOG{mailings} ||= 0; # log mass mailings? $LOG{mass_mailings} ||= 1; # log control panel login/logouts? $LOG{logins} ||= 1; # log new lists created/old lists destroyed? $LOG{list_lives} ||= 1; =head2 $PROGRAM_ERROR_LOG Create your own error log file for fun and profit! Many people either don't know where their error log is, or aren't allowed to see it, which is pretty cruddy, but here's your chance to make your own error log, and get a better picture of what's going wrong. =cut BEGIN { # Type in the absolute path of the file you want to make as your # error log for Dada Mail. You'll probably have to create this file # by hand and chmod it to 777. $PROGRAM_ERROR_LOG = ''; # keep this as it is, it's just opening the error file for writing. if($PROGRAM_ERROR_LOG){open (STDERR, ">>$PROGRAM_ERROR_LOG") || warn "$PROGRAM_NAME Error: Cannot redirect STDERR, it's possible that Dada Mail does not have write permissions to this file ($PROGRAM_ERROR_LOG) or it doesn't exists! If Dada Mail cannot make this file for you, create it yourself and give it enough permissions so it may write to it: $!";} # chmod(0777, $PROGRAM_ERROR_LOG); } =pod =head1 Templates 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. =head2 $ADMIN_TEMPLATE Path to the admin template. An example of this is in the 'extras' directory. =cut $ADMIN_TEMPLATE ||= ''; =pod =head2 $USER_TEMPLATE Path to the default user template. An example of this is in the 'extras' directory. =cut $USER_TEMPLATE ||= ''; =pod =head1 List Files - Specific Places To Write Them. =head2 $TEMPLATES templates are by default, saved in the same directory as your lists. To make things cleaner and nice, you can move them into their own directory by setting the B<$TEMPLATES> variable to an absolute path to a directory. =cut $TEMPLATES ||= $FILES; =pod =head2 $TMP Sort of on the same line, but not really, you can specify a different directory that Dada Mail should use for writing temporary files. These files my contain sensitive data, like a copy of an outgoing message, so keep that in mind. =cut $TMP ||= $FILES; =pod =head2 $ARCHIVES Set B<$ARCHIVES> to the absolute path a directory that you want archives to be saved under. =cut $ARCHIVES ||= $FILES; =cut =pod =head2 $LOGS Again, set the $LOGS variable to an absolute path to a directory you want logs to be written to. This isn't much use unless you're setting this variable in an outside config file. =cut $LOGS ||= $FILES; =cut =pod =head2 $BACKUPS Set $BACKUPS to an absolute path to a directory to where you want list backups to be saved. =cut $BACKUPS ||= $FILES; =cut =pod =head2 %BACKUP_HISTORY %BACKUP_HISTORY sets how many different revisions of various list files are saved. =cut %BACKUP_HISTORY = ( settings => 3, archives => 3, ) unless keys %BACKUP_HISTORY; =pod =head1 Program Behavior =head2 $DEFAULT_SCREEN If no paramaters 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 =cut $DEFAULT_SCREEN ||= ''; =pod If you do override this screen, it is recommended that you provide someway to at least unsubscribe to every one of your lists. =cut =pod =head2 $DEFAULT_ADMIN_SCREEN 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. =cut $DEFAULT_ADMIN_SCREEN ||= $S_PROGRAM_URL.'?flavor=send_email'; my $PLUGIN_URL = $S_PROGRAM_URL; $PLUGIN_URL =~ s/mail\.cgi$//; $PLUGIN_URL .= 'plugins'; =pod =head2 $ADMIN_MENU This generates the Admin Menu and various links and features can 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. =cut $ADMIN_MENU ||= [ {-Title => 'Send A List Message', -Title_URL => "$S_PROGRAM_URL?flavor=send_email", -Activated => 1, -Submenu => [{-Title => 'Send a Web Page', -Title_URL => "$S_PROGRAM_URL?flavor=send_url_email", -Function => 'send_url_email', -Activated => 1}, {-Title => 'Send a List Invitation', -Title_URL => "$S_PROGRAM_URL?flavor=list_invite", -Function => 'list_invite', -Activated => 1}, ] }, {-Title => 'Manage List', -Activated => 1, -Submenu => [{-Title => 'Change List Information', -Title_URL => "$S_PROGRAM_URL?flavor=change_info", -Function => 'change_info', -Activated => 1}, {-Title => 'Change Your Password', -Title_URL => "$S_PROGRAM_URL?flavor=change_password", -Function => 'change_password', -Activated => 1}, {-Title => 'Mailing List Options', -Title_URL => "$S_PROGRAM_URL?flavor=list_options", -Function => 'list_options', -Activated => 1}, {-Title => 'Sending Options', -Title_URL => "$S_PROGRAM_URL?flavor=sending_options", -Function => 'sending_options', -Activated => 1}, # {-Title => 'List Security', # -Title_URL => "$S_PROGRAM_URL?flavor=list_security", # -Function => 'list_security', # -Activated => 1}, {-Title => 'Group Options', -Title_URL => "$S_PROGRAM_URL?flavor=dada_send_options", -Function => 'dada_send_options', -Activated => 1}, {-Title => 'Delete This List', -Title_URL => "$S_PROGRAM_URL?flavor=delete_list", -Function => 'delete_list', -Activated => 0,}, ] }, {-Title => 'Manage Subscribers', -Activated => 1, -Submenu => [{-Title => 'View', -Title_URL => "$S_PROGRAM_URL?flavor=view_list", -Function => 'view_list', -Activated => 1}, {-Title => 'Add', -Title_URL => "$S_PROGRAM_URL?flavor=add", -Function => 'add', -Activated => 1}, {-Title => 'Remove', -Title_URL => "$S_PROGRAM_URL?flavor=delete_email", -Function => 'delete_email', -Activated => 1}, #{-Title => 'Search', # -Title_URL => "$S_PROGRAM_URL?flavor=search_email", # -Function => 'search_email', # -Activated => 1}, {-Title => 'Statistics', -Title_URL => "$S_PROGRAM_URL?flavor=list_stats", -Function => 'list_stats', -Activated => 1}, {-Title => 'Black List Rules', -Title_URL => "$S_PROGRAM_URL?flavor=black_list", -Function => 'black_list', -Activated => 1 }, {-Title => 'Options', -Title_URL => "$S_PROGRAM_URL?flavor=subscription_options", -Function => 'subscription_options', -Activated => 0, }, ] }, {-Title => 'Manage List Archive', -Activated => 1, -Submenu => [{-Title => 'View Archive', -Title_URL => "$S_PROGRAM_URL?flavor=view_archive", -Function => 'view_archive', -Activated => 1}, {-Title => 'Archive Options', -Title_URL => "$S_PROGRAM_URL?flavor=archive_options", -Function => 'archive_options', -Activated => 1}, ] }, {-Title => 'Manage Copy', -Activated => 1, -Submenu => [ {-Title => 'E-mail Messages', -Title_URL => "$S_PROGRAM_URL?flavor=edit_type", -Function => 'edit_type', -Activated => 1}, {-Title => 'HTML Messages', -Title_URL => "$S_PROGRAM_URL?flavor=edit_html_type", -Function => 'edit_html_type', -Activated => 1}, {-Title => 'Create a Back Link', -Title_URL => "$S_PROGRAM_URL?flavor=back_link", -Function => 'back_link', -Activated => 1}, ] }, {-Title => 'Manage Appearance', -Activated => 1, -Submenu => [ {-Title => 'Edit Template', -Title_URL => "$S_PROGRAM_URL?flavor=edit_template", -Function => 'edit_template', -Activated => 1}, {-Title => 'Subscription Form HTML', -Title_URL => "$S_PROGRAM_URL?flavor=html_code", -Function => 'html_code', -Activated => 1}, ] }, {-Title => 'About Dada Mail', -Title_URL => "$S_PROGRAM_URL?flavor=manage_script", -Function => 'manage_script', -Activated => 1, }, {-Title => 'Logout', -Title_URL => "$S_PROGRAM_URL?flavor=logout", -Function => 'logout', -Activated => 1, }, {-Title => 'Sign Into Another List', -Title_URL => "$S_PROGRAM_URL?flavor=sign_in", -Function => 'sign_in', -Activated => 1, }, {-Title => 'Customize Feature Set', -Title_URL => "$S_PROGRAM_URL?flavor=feature_set", -Function => 'feature_set', -Activated => 0, }, {-Title => 'Plugins', -Activated => 1, -Submenu => [ # # These are plugins, make sure you install them # # if you want to use them! # {-Title => 'Boilder Plate Example', # -Title_URL => $PLUGIN_URL."/boilerplate_plugin.cgi", # -Function => 'boilderplate', # -Activated => 1, # }, # {-Title => 'Discussion lists', # -Title_URL => $PLUGIN_URL."/dada_bridge.pl", # -Function => 'dada_bridge', # -Activated => 1, # }, # {-Title => 'Clickthrough Tracking', # -Title_URL => $PLUGIN_URL."/clickthrough_tracking.cgi", # -Function => 'clickthrough_tracking', # -Activated => 1, # }, # { # -Title => 'Scheduled Mailings', # -Title_URL => $PLUGIN_URL."/scheduled_mailings.pl", # -Function => 'scheduled_mailings', # -Activated => 1, # }, # {-Title => 'mx lookup Verification', # -Title_URL => $PLUGIN_URL."/mx_lookup.cgi", # -Function => 'mx_lookup', # -Activated => 1, # }, # {-Title => 'View List Settings', # -Title_URL => $PLUGIN_URL."/view_list_settings.cgi", # -Function => 'view_list_settings', # -Activated => 1, # # }, # {-Title => 'View Logs', # -Title_URL => $PLUGIN_URL."/log_viewer.cgi", # -Function => 'log_viewer', # -Activated => 1, # }, # {-Title => 'Email All List Owners', # -Title_URL => $PLUGIN_URL."/email_list_owners.cgi", # -Function => 'email_list_owners', # -Activated => 1, # }, ], } ]; =pod =head2 $LIST_QUOTA $LIST_QUOTA, when set to anything other than B can be used to set the maximum number of lists a Dada Mail install can have at one time. =cut $LIST_QUOTA ||= undef; =pod =head2 $SHOW_EMAIL_LIST 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, 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' =cut $SHOW_EMAIL_LIST ||= 1; =pod To turn it on again, change this variable to 1 =head2 $EMAIL_CASE $EMAIL_CASE configures dada to either lowercase ONLY the 'domain' part of an email, or lowercase the entire email address. lower casing the domain is the correct way, since the 'name' part of an email should be case sensitive, but 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. =cut $EMAIL_CASE ||= 'lc_all'; =pod =head2 @EMAIL_EXCEPTIONS @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 =cut @EMAIL_EXCEPTIONS = qw() unless scalar @EMAIL_EXCEPTIONS; =pod =head2 $LIST_IN_ORDER $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, this will, especially when you're using a PlainText list, slow down things. If you have small lists, then this should be too too much of a problem. Set this variable to '1' to have your list sorted, 0, to keep your list unsorted. =cut $LIST_IN_ORDER ||= 0; =pod =head2 $SHOW_DOMAIN_TABLE This variable tells Dada Mail if you should show the "Top Level Domains" table. You might not be interested in this information, or 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 =cut $SHOW_DOMAIN_TABLE ||= 1; =pod =head2 @DOMAINS 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. =cut @DOMAINS = qw( biz com info net org edu gov mil nu us ) unless scalar @DOMAINS; =pod =head2 $SHOW_SERVICES_TABLE This variable tells Dada Mail if it should show the "Services" table. You might not be interested in this information, or your list is so large that your "View List" page is having trouble loading. =cut $SHOW_SERVICES_TABLE ||= 1; =head2 %SERVICES The services Panel can also be customized, You can put in, or take away any service that you want to track, add a record in between the parentheses, heres 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 on the right that corresponds to that service. The domain ending for American Online is "aol.com" Follow the pattern! =cut %SERVICES = ( '.Mac' => 'mac.com', 'AOL' => 'aol.com', 'Compuserve' => 'compuserve.com', 'Excite Mail' => 'excite.com', 'Hotmail' => 'hotmail.com', 'MSN' => 'msn.com', 'PO Box' => 'pobox.com', 'Prodigy' => 'prodigy.net', 'Yahoo!' => 'yahoo.com', ) unless keys %SERVICES; # keep a list as a shorthand. @SERVICES = values %SERVICES; =head2 Artsy Buttons these are buttons styles, if you find yourself well read in CSS, go ahead and fool around with em, =cut #default (brown) $STYLE{default_submit} ||= 'font-size: 11px; font-family:verdana,arial, sans-serif; background-color: #CC9966; color: #000000; font-weight:bold; border: 1px solid black'; $STYLE{green_submit} ||= 'font-size: 11px; font-family:verdana,arial, sans-serif; background-color: #99CC99; color: #000000; font-weight:bold; border: 1px solid black'; $STYLE{red_submit} ||= 'font-size: 11px; font-family:verdana,arial, sans-serif; background-color: #FF6666; color: #000000; font-weight:bold; border: 1px solid black'; $STYLE{yellow_submit} ||= 'font-size: 11px; font-family:verdana,arial, sans-serif; background-color: #FFFFCC; color: #000000; font-weight:bold; border: 1px solid black'; =pod =head2 $FILE_CHMOD $FILE_CHMOD is a variable that sets what permission Dada Mail sets files to when it initialy 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 - god awful paranoid about the whole thing - life in general, as secure as it gets =cut $FILE_CHMOD ||= 0666; =pod 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. =cut =pod =head2 $DIR_CHMOD Similar to $FILE_CHMOD, $DIR_CHMOD sets permissions to Directories created with Dada Mail. At the moment, this is limited to backup directories. =cut $DIR_CHMOD ||= 0777; # http://www.w3.org/International/O-charset.html # http://www.w3.org/International/O-HTTP-charset =pod =head2 $HTML_CHARSET =cut $HTML_CHARSET ||= 'iso-8859-1'; =pod =head2 List Control Panel =head2 $SHOW_HELP_LINKS 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' =cut $SHOW_HELP_LINKS ||= 1; =pod =head1 Email Messagess and Headers =head2 @CHARSETS Charsets that Dada Mail supports, they 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. =cut @CHARSETS = ( 'Afrikaans (af) iso-8859-1','Afrikaans (af) windows-1252','Albanian (sq) iso-8859-1', 'Albanian (sq) windows-1252','Arabic (ar) iso-8859-6','Basque (eu) iso-8859-1', 'Basque (eu) windows-1252','Bulgarian (bg) iso-8859-5','Byelorussian (be) iso-8859-5', 'Catalan (ca) iso-8859-1','Catalan (ca) windows-1252','Croatian (hr) iso-8859-2', 'Czech (cs) iso-8859-2','Danish (da) iso-8859-1','Danish (da) windows-1252', 'Dutch (nl) iso-8859-1','Dutch (nl) windows-1252','English (en) iso-8859-1', 'English (en) windows-1252','Esperanto (eo) iso-8859-3','Estonian (et) iso-8859-15', 'Faroese (fo) iso-8859-1','Faroese (fo) windows-1252','Finnish (fi) iso-8859-1', 'Finnish (fi) windows-1252','French (fr) iso-8859-1','French (fr) windows-1252', 'Galician (gl) iso-8859-1','Galician (gl) windows-1252','German (de) iso-8859-1', 'German (de) windows-1252','Greek (el) iso-8859-7','Hebrew (iw) iso-8859-8', 'Hungarian (hu) iso-8859-2','Icelandic (is) iso-8859-1','Icelandic (is) windows-1252', 'Inuit (Eskimo) iso-8859-10','Irish (ga) iso-8859-1','Irish (ga) windows-1252', 'Italian (it) iso-8859-1','Italian (it) windows-1252','Japanese (ja) shift_jis', 'Japanese (ja) iso-2022-jp','Japanese (ja) euc-jp','Lapp() iso-8859-10', 'Latvian (lv) iso-8859-13','Latvian (lv) windows-1257','Lithuanian (lt) iso-8859-13', 'Lithuanian (lt) windows-1257','Macedonian (mk) iso-8859-5','Maltese (mt) iso-8859-3', 'Norwegian (no) iso-8859-1','Norwegian (no) windows-1252','Polish (pl) iso-8859-2', 'Portuguese (pt) iso-8859-1','Portuguese (pt) windows-1252','Romanian (ro) iso-8859-2', 'Russian (ru) koi8-r','Russian (ru) iso-8859-5','Scottish (gd) iso-8859-1', 'Scottish (gd) windows-1252','Serbian (sr) iso-8859-5','Slovak (sk) iso-8859-2', 'Slovenian (sl) iso-8859-2','Spanish (es) iso-8859-1','Spanish (es) windows-1252', 'Swedish (sv) iso-8859-1','Swedish (sv) windows-1252', 'Thai (th) windows-874 ', 'Turkish (tr) iso-8859-9', 'Turkish (tr) windows-1254','Ukrainian (uk) iso-8859-5' ) unless scalar @CHARSETS; =pod =head2 @PRECEDENCES This is the default group of Precedences used when sending Bulk Messages, be warned the SMTP sending may not support any other prededence value except the ones listed here. =cut @PRECEDENCES = (undef, 'list','bulk','junk') unless scalar @PRECEDENCES; =pod =head2 @Content_type These are the default content-types, add your own, have fun =cut @CONTENT_TYPES = qw( text/plain text/html ) unless scalar @CONTENT_TYPES; =pod =head2 %PRIORITIES priorities of mailings. I find people that send me things with the highest priority telling me about credit cards really don't garder my attention. =cut %PRIORITIES = ( 5 => 'lowest', 4 => 'low', 3 => 'normal', 2 => 'high', 1 => 'highest', ) unless keys %PRIORITIES; =pod =head2 @CONTENT_TRANSFER_ENCODINGS =cut @CONTENT_TRANSFER_ENCODINGS = qw( 7bit 8bit quoted-printable base64 binary ) unless scalar @CONTENT_TRANSFER_ENCODINGS; =pod =head1 $PROGRAM_CONFIG_FILE_DIR 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. Everytime 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 B it lives in by changing the B<$PROGRAM_CONFIG_FILE_DIR> variable that lives inside the Config.pm module. Wherever the external config file lives, it B to be called I<.dada_config> If you don't change the B<$PROGRAM_CONFIG_FILE_DIR> variable in the Config.pm file, Dada Mail will try to look in your home directory for the I<.dada_config> file. It tries to find your home directory in different places, one is the Environment Variable I<$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 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, whoich leaves out $PROGRAM_ERROR_LOG and @AnyDBM_File::ISA treat .dada_config as a file that gets eval() right into Config.pm cause well, that's what happens. Because of this, great care should be made in where you put I<.dada_config> The B<$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, to setting this to , '2'. =head1 Formatting =head2 Plaintext To HTML Encoding 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 =cut %HTMLFROMTEXT_OPTIONS = ( urls => 1, email => 1, paras => 1, bold => 1, underline => 1, lines => 1 ) unless keys %HTMLFROMTEXT_OPTIONS; =pod =head1 List Setting Defaults =head2 %LIST_SETUP_DEFAULTS 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 black lists on, and mail being sent using SMTP. =cut %LIST_SETUP_DEFAULTS = ( use_subscription_quota => 0, subscription_quota => 0, #mailing list options mx_check => 0, closed_list => 0, show_hidden => 0, hide_list => 0, send_unsub_success_email => 1, send_sub_success_email => 1, use_alt_url_sub_confirm_success => 0, alt_url_sub_confirm_success => '', use_alt_url_sub_confirm_failed => 0, alt_url_sub_confirm_failed => '', use_alt_url_sub_success => 0, alt_url_sub_success => '', use_alt_url_sub_failed => 0, alt_url_sub_failed => '', use_alt_url_unsub_confirm_success => 0, alt_url_unsub_confirm_success => '', use_alt_url_unsub_confirm_failed => 0, alt_url_unsub_confirm_failed => '', use_alt_url_unsub_success => 0, alt_url_unsub_success => '', use_alt_url_unsub_failed => 0, alt_url_unsub_failed => '', # smtp prefs use_pop_before_smtp => 1, smtp_server => $SMTP_ADDRESS, smtp_port => 25, smtp_connect_tries => 5, # email headers precedence => undef, charset => 'English (en) iso-8859-1', content_type => 'text/plain', priority => 3, print_list_headers => 1, print_errors_to_header => 0, print_return_path_header => 0, set_smtp_sender => 0, use_sasl_smtp_auth => 0, sasl_smtp_username => undef, sasl_smtp_password => undef, # sending options enable_bulk_batching => 0, get_batch_notification => 1, get_finished_notification => 1, # adv sending options plaintext_encoding => '8bit', html_encoding => '8bit', use_habeas_headers => 0, strip_message_headers => 0, add_sendmail_f_flag => 0, # view list prefs view_list_subscriber_number => 100, # archive prefs archive_messages => 1, show_archives => 1, archive_subscribe_form => 1, archive_search_form => 1, archive_send_form => 0, archive_show_month => 1, archive_show_day => 1, archive_show_year => 1, archive_index_count => 10, sort_archives_in_reverse => 1, publish_archives_rss => 1, #blacklist black_list => 0, add_unsubs_to_black_list => 0, allow_blacklisted_to_subscribe => 0, allow_admin_to_subscribe_blacklisted => 0, # group prefs group_list => 0, allow_group_interpolation => 0, only_allow_group_plain_text => 0, add_reply_to => 1, mail_group_message_to_poster => 1, append_list_name_to_subject => 1, #template prefs get_template_data => 'from_template_file', url_template => '', #SQL stuff subscription_table => 'dada_subscribers', #mail merging stuff hard_remove => 1, merge_fields => '', #Clickthrough Tracking clickthrough_tracking => 0, ) unless keys %LIST_SETUP_DEFAULTS; =pod =head2 %LIST_SETUP_OVERRIDES B<%LIST_SETUP_OVERRIDES> will override any setting that's in the B<%LIST_SETUP_DEFAULTS> hash and whatever is set in the list preferences. =cut %LIST_SETUP_OVERRIDES = () unless keys %LIST_SETUP_OVERRIDES; =pod =head1 MIME Settings =head2 %MIME_TYPES 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 if it can't, it'll fall back to this. =cut %MIME_TYPES = ( '.gif' => 'images/gif', '.jpg' => 'image/jpg', '.png' => 'image/png', '.jpeg' => 'image/jpeg', '.pdf' => 'application/pdf', '.psd' => 'application/psd', '.html' => 'text/html', '.txt' => 'text/plain', '.doc' => 'application/msword', '.xls' => 'application/x-msexcel', '.ppt' => 'application/x-mspowerpoint', '.mp3' => 'application/octet-stream', '.mov' => 'video/quicktime', ) unless keys %MIME_TYPES; =pod =head2 $DEFAULT_MIME_TYPE 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. =cut $DEFAULT_MIME_TYPE ||= 'application/octet-stream'; =pod =head2 $MIME_PARANOID 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 :) =cut $MIME_PARANOID ||= 0; =pod =head2 $MIME_HUSH set mime_hush to 1 to "suppress/unsuppress all warnings coming from this module. =cut $MIME_HUSH ||= 0; =pod =head1 Default Email Messages =head2 $SUBSCRIBED_MESSAGE This is the default "subscription successful!" e-mail message. This message can be customized for each list in the list's Control Panel. =cut $SUBSCRIBED_MESSAGE ||= < If the above URL is inoperable, make sure that you have copied the entire address. Some mail readers will wrap a long URL and thus break this automatic unsubscribe mechanism. You may also change your subscription by visiting this list's main screen: <[program_url]?f=list&l=[list]> If you're still having trouble, please contact the list owner at: The following physical address is associated with this mailing list: [physical_address] - EOF ; =pod =head2 $UNSUBSCRIBED_MESSAGE This is the default "unsubscription successful!" e-mail message. This message can be customized for each list in the list's Control Panel. =cut $UNSUBSCRIBED_MESSAGE ||= < If the above URL is inoperable, make sure that you have copied the entire address. Some mail readers will wrap a long URL and thus break this automatic unsubscribe mechanism. You may also change your subscription by visiting this list's main screen: <[program_url]?f=list&l=[list]> If you're still having trouble, please contact the list owner at: The following physical address is associated with this mailing list: [physical_address] - EOF ; =pod =head2 $CONFIRMATION_MESSAGE This is the default "subscription confirmation" e-mail message. This message can be customized for each list in the list's Control Panel. =cut $CONFIRMATION_MESSAGE ||= < (Click the URL above or, copy and paste the URL into your browser) Doing so will subscribe you to this list. ----------------------------------------------------------------------- The following is the description given for this list: [list_info] ----------------------------------------------------------------------- This double opt-in confirmation email was sent to protect the privacy of the owner of this email address. Double opt-in confirmation guarantees that only the owner of an email address can subscribe themselves to this mailing list. Furthermore, the following privacy policy is associated with this list: [privacy_policy] Please read and understand this privacy policy. Other mechanisms may have been enacted to subscribe email addresses to this list, such as physical guestbook registrations, verbal agreements, etc. If you did not asked to be subscribed to this particular list, please do not visit the confirmation URL above. The confirmation for subscription will not go through and no other action on your part will be needed. To contact the owner of this email list, please use the below address: The following physical address is associated with this mailing list: [physical_address] - [list_owner_email] EOF ; =pod =head2 $UNSUB_CONFIRMATION_MESSAGE This is the default "subscription confirmation" e-mail message. This message can be customized for each list in the list's Control Panel. =cut $UNSUB_CONFIRMATION_MESSAGE ||= < (Click the URL above or, copy and paste the URL into your browser) Doing so will *remove* you to this list. ----------------------------------------------------------------------- The following is the description given for this list: [list_info] ----------------------------------------------------------------------- This double opt-out confirmation email was sent to protect the privacy of the owner of this email address. Furthermore, the following privacy policy is associated with this list: [privacy_policy] Please read and understand this privacy policy. If you did not asked to be removed from this particular list, please do not visit the confirmation URL above. The confirmation for removal will not go through and no other action on your part will be needed. To contact the owner of this email list, please use the below address: The following physical address is associated with this mailing list: [physical_address] - EOF ; =pod =head2 $MAILlING_LIST_MESSAGE This is the default "Mailing List!" e-mail message. This message can be customized for each list in the list's Control Panel. =cut $MAILlING_LIST_MESSAGE ||= < If the above URL is inoperable, make sure that you have copied the entire address. Some mail readers will wrap a long URL and thus break this automatic unsubscribe mechanism. You may also change your subscription by visiting this list's main screen: <[program_url]?f=list&l=[list]> If you're still having trouble, please contact the list owner at: The following physical address is associated with this mailing list: [physical_address] EOF ; =pod =head2 $MAILlING_LIST_MESSAGE_HTML Similar to $MAILlING_LIST_MESSAGE, but used specifically for HTML messages. =cut $MAILlING_LIST_MESSAGE_HTML ||= <(Mailing List Information, including unsubscription instructions, is located at the end of this message.)

[message_body] --

The following information is a reminder of your current mailing list subscription:

You are subscribed to the following list:

[list_name]

Using the following email:

[email]

You may automatically unsubscribe from this list at any time by visiting the following URL:

[plain_list_unsubscribe_link]

If the above URL is inoperable, make sure that you have copied the entire address. Some mail readers will wrap a long URL and thus break this automatic unsubscribe mechanism.

You may also change your subscription by visiting this list's main screen:

[program_url]?f=list&l=[list]

If you're still having trouble, please contact the list owner at:

[list_owner_email]

The following physical address is associated with this mailing list:

 [physical_address]
EOF ; =pod =head2 $NOT_ALLOWED_TO_POST_MESSAGE This message is sent to someone who is not allowed to post to your list using the dada_send.pl script. If you do not use the dada_send.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. =cut $NOT_ALLOWED_TO_POST_MESSAGE ||= <Please confirm your mailing list subscription

An email message has been sent to the following address:

[subscriber_email]

To confirm the subscription to the following list:

[list_name]

Upon receiving this message, you will need to follow a confirmation URL, located in the message itself.

This confirmation process, known as Double Opt-In confirmation has been put into place to protect the privacy of the owner of this email address.

If you do not receive a confirmation for subscription in the next twenty-four hours, or you have any other questions regarding this mailing list, please contact the list owner at:

[list_owner_email]

EOF ; =pod =head2 $HTML_UNSUB_CONFIRMATION_MESSAGE Shown when a request to unsubscribe is successful. =cut $HTML_UNSUB_CONFIRMATION_MESSAGE ||= <Please confirm your mailing list unsubscription

An email message has been sent to the following address:

[subscriber_email]

To confirm the removal from the following list:

[list_name]

Upon receiving this message, you will need to follow a confirmation URL, located in the message itself.

This confirmation process, known as Double Opt-Out confirmation has been put into place to protect the privacy of the owner of this email address.

If you do not receive a confirmation for removal in the next twenty-four hours, or you have any other questions regarding this mailing list, please contact the list owner at:

[list_owner_email]

EOF ; =pod =head2 $HTML_SUBSCRIBED_MESSAGE Shown when a subscription is successful. =cut $HTML_SUBSCRIBED_MESSAGE ||= <Subscription is successful!

You are now subscribed to the following mailing list:

[list_name]

Using the following email address:

[subscriber_email]

An email will be sent to your address giving you more details of this subscription, including how to unsubscribe in the future.

EOF ; =pod =head2 $HTML_UNSUBSCRIBED_MESSAGE Shown when an unsubscription is successful. =cut $HTML_UNSUBSCRIBED_MESSAGE ||= <You have been unsubscribed from the list: [list_name]

[subscriber_email] is no longer a part of [list_name]. Thanks for subscribing.

EOF ; =pod =head2 $TEXT_INVITE_MESSAGE The text version of the list invitation message. =cut $TEXT_INVITE_MESSAGE ||= <Hello!

I wanted to tell you about my email list, [list_name]:

[list_info]

I thought you might be interested in subscribing to it. If you want to, just click here

This is a one-time mailing, you won't hear from us again, unless you subscribe.

- [list_owner_email]

EOF ; =pod =head2 $SEND_ARCHIVED_MESSAGE The text version of the message sent when an archived message is sent to a friend. =cut $SEND_ARCHIVED_MESSAGE ||= <Hello!

[sender_email] wanted to send this archived message to you, they wrote:

[note]

The Message:


[archived_message]

You can subscribe to [list_name] by following this link:

[plain_list_subscribe_link] EOF ; # Good Job! $GOOD_JOB_MESSAGE ||= "

Your changes have been saved successfully!

\n"; # No ones subscribed? $NO_ONE_SUBSCRIBED ||= "

No one is subscribed to your list at the moment.

"; ###################################################################### =pod =head1 Additional Settings You'll probably not need to change. (advanced hacker stuff) =head2 Operating System Dada Mail tries to guess your Operating System using the $^O variable. If it's guessing wrong, you can set it yourself. =cut $OS ||= $^O; =pod =head2 $NULL_DEVICE $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. =cut $NULL_DEVICE ||= '/dev/null'; =pod =head2 Seed random number generator 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 =cut srand ( time() ^ ($$ + ($$ << 15)) ); =pod =head2 $FIRST_SUB, $SEC_SUB Where is the salt number located in the encrypted password? its usually at substr(0,2) but may be different on different systems, some sytems 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! =cut $FIRST_SUB ||= 0; $SEC_SUB ||= 2; =pod =head2 $SALT the salt number, change $SALT to $SALT = "mj"; if all else fails. =cut @C=('a'..'z', 'A'..'Z', '0'..'9','.','/'); $SALT=$C[rand(@C)].$C[rand(@C)]; =pod =head2 $PIN_WORD $PIN_NUM 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 e-mail, and a pin thats generated from the email and the variables below using a mathematical equation. Its much harder to guess a pin with these two variables changed: =cut # Pick a word. it really doesn't matter what the word is, a longer # word doesn't necessarily mean a better pin number if(!defined($PIN_WORD)){ $PIN_WORD = ($ROOT_PASS_IS_ENCRYPTED == 1) ? ($PROGRAM_ROOT_PASSWORD) : ('dada'); } # Pick a number. I would keep it between 1 and 9. $PIN_NUM ||= unpack("%32C*", $FILES); =pod =head2 $MAKE_ALL_LIST_FILES When making new lists, make each file Dada Mail needs Change this to "0" if, for some reason you don't want this done. =cut $MAKE_ALL_LIST_FILES ||= 1; =pod =head2 @AnyDBM_File 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 no 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 =cut BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File ODBM_File SDBM_File) } =pod check the AnyDBM_File for more info (yo) =head2 $ATTACHMENT_TEMPFILE 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's 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, 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 magicaly. I suggest 1, unless you want to play around with it. =cut $ATTACHMENT_TEMPFILE ||= 0; =pod =head1 Variables that don't need changin' =pod =head2 $VER This is the version of this Dada Mail Program. mostly its 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 =cut $VER ||= '2.8.15'; # If your having problems with Dada Mail PLEASE tell me what the version # of it is, Each new version of Dada Mail is SOOOO different from each # other, If I put two different releases together, I'd have Dada Mail 4.0 by # now. ###################################################################### =pod =head2 $PROGRAM_NAME This is the name of the program. I guess if this script has a mid-life crisis or something, it can change it's name, buy a really fast car start chasing guys half her age. =cut $PROGRAM_NAME ||= 'Dada Mail'; %EMAIL_HEADERS = ( From => undef, To => undef, Cc => undef, Bcc => undef, 'Return-Path' => undef, 'Reply-To' => undef, 'In-Reply-To' => undef, 'Errors-To' => undef, References => undef, 'X-Priority' => undef, 'Content-Base' => undef, List => undef, 'List-Archive' => undef, 'List-Digest' => undef, 'List-Help' => undef, 'List-ID' => undef, 'List-Owner' => undef, 'List-Post' => undef, 'List-Subscribe' => undef, 'List-Unsubscribe' => undef, 'List-URL' => undef, 'X-Habeas-SWE-1' => undef, 'X-Habeas-SWE-2' => undef, 'X-Habeas-SWE-3' => undef, 'X-Habeas-SWE-4' => undef, 'X-Habeas-SWE-5' => undef, 'X-Habeas-SWE-6' => undef, 'X-Habeas-SWE-7' => undef, 'X-Habeas-SWE-8' => undef, 'X-Habeas-SWE-9' => undef, 'Message-ID' => undef, Precedence => undef, 'X-Mailer' => "$PROGRAM_NAME $VER ", 'X-BounceHandler' => undef, Sender => undef, 'Content-type' => undef, 'Content-Transfer-Encoding' => undef, 'Content-Disposition' => undef, 'MIME-Version' => undef, Subject => '(no subject)', Body => 'blank', ) unless keys %EMAIL_HEADERS; @EMAIL_HEADERS_ORDER = qw( From To Cc Bcc Return-Path Reply-To In-Reply-To Errors-To References X-Priority List List-Archive List-Digest List-Help List-ID List-Owner List-Post List-Subscribe List-Unsubscribe List-URL X-Habeas-SWE-1 X-Habeas-SWE-2 X-Habeas-SWE-3 X-Habeas-SWE-4 X-Habeas-SWE-5 X-Habeas-SWE-6 X-Habeas-SWE-7 X-Habeas-SWE-8 X-Habeas-SWE-9 Message-ID Precedence X-Mailer X-BounceHandler Sender Content-type Content-Transfer-Encoding Content-Disposition Content-Base MIME-Version Subject ) unless scalar @EMAIL_HEADERS_ORDER; ###################################################################### #this footer gets appended to most e-mails sent using Dada Mail $FOOTER ||= "\n Powered by Dada Mail $VER \n $PROGRAM_URL?f=smtm\n"; #This footer gets appended to most HTML e-mails sent with Dada Mail # DO NOT REMOVE THIS LINK UNLESS YOU ARE WILLING TO PAY. $HTML_FOOTER ||= "\n\n

Powered by Dada Mail $VER
Copyright © 1999-2004, Simoni Creative.

\n"; sub _config_import { my $CONFIG_FILE_DIR; if(defined($OS) !~ m/^Win|^MSWin/i){ my $getpwuid_call; my $good_getpwuid; eval { $getpwuid_call = ( getpwuid $> )[7] }; $good_getpwuid = $getpwuid_call if !$@; $CONFIG_FILE_DIR = $PROGRAM_CONFIG_FILE_DIR || $ENV{'HOME'} || $good_getpwuid || ''; }else{ $CONFIG_FILE_DIR = $PROGRAM_CONFIG_FILE_DIR || $ENV{'HOME'} || ''; } my $CONFIG_FILE = $CONFIG_FILE_DIR.'/.dada_config'; # yes, shooting yourself in the foot, RTM $CONFIG_FILE =~ /(.*)/; $CONFIG_FILE = $1; if(-e $CONFIG_FILE && -f $CONFIG_FILE && -s $CONFIG_FILE){ open(CONFIG, "< $CONFIG_FILE"); my $conf; { local $/ = undef; $conf = ; } # shooting again, $conf =~ m/(.*)/ms; $conf = $1; eval $conf; die "$PROGRAM_NAME $VER ERROR - Outside config file '$CONFIG_FILE' contains errors:\n\n $@ \n\n" if ($@); } } # Don't remove the '1', it lives here at the bottom. it likes it there. 1; =pod =head1 SUPPORT If you need further support for this script, please do not email me directly, but use one of the following channels: =over =item * Dada Mail Support Site http://dadamail.org =item * The Dada Mailers Discussion List http://knowledgematters.net =item * Consultation for Dada Mail http://dadamail.org/support/customize.html =back =head1 CONTACT My name is Justin Simoni e. - me@justinsimoni ph. - 720.436.7701 w. - http://justinsimoni.com I am available for Installation, Customization and Consultation of the Dada Mail program. I am also available for contract work, web design, Fine and Commercial Art. Please, get in touch. =head1 COPYRIGHT Copyright (c) 1999 - 2004 Justin Simoni me@justinsimoni.com http://justinsimoni.com 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. =head1 Last Words For Penney, who is worth much more than her name may imply. =cut