MTVWebdesign Arch - mailing list manager v2.0
For the latest version of the script, click here.
Thank you for your interest in the MTVWebdesign mailing list manager. Please notice the copyright notice in the arch.cgi file.
You should be very careful handling CGI files. If you type something wrong, it might be that the script will fail. We take good care of our scripts and all the script we place on the internet are tested. They work for us. If they don't work for you you'll see an error in the browser, sometimes with a detailed message. Read more about such problems by clicking here.
If you are not an experienced perl programmer, we advice you not to edit the code. (Except the things you need to change as described in "Getting the script to work". If you want to become a perl programmer, we advice you to look over as much scripts as you possibly can. This script included! Make sure you keep a copy of the script before you start changing things. Get to know certain routines etc., and visit sites like the MTVWebdesign Perl section, CGI-Resources.com (A lot of scripts and tutorials), Scriptsearch.com and Developer Daily. Also, we advice you too read messages in cgi-newsgroups.
Good luck!
I will try to give as much information as possible about the use of this script. Hope you understand it all. If not, you can always email me at cgi@mtvwebdesign.hypermart.net.
Features
What's new?
Downloading the script
Requirements
Getting the script to work
Demo of the script
Known problems
FAQ
About MTVWebdesign open source
Disclaimer
Features
- Easy to setup.
- You can host this script for other people, or use this script for yourself
- Either the webmaster is the only one who can create new mailing lists, or other people may create mailing lists (hosting) too.
- Unlimited mailing lists (The only limit is your HardDisk)
- Password recovery (secured to stop abusion of this feature)
- Security: When email address is changed, the password is changed too and emailed to the new email address. This way you can always track spammers.
- No sensetive information is stored in cookies.
- You can set a tokenfile.
- Admin script (delete lists, view info)
- Owners can set a footer for every email.
- Detailed information page.
- Script automatically generates the HTML code for you which you can use at your homepage for adding people to your list, or removing people.
You'll find more information about some of the features in the rest of this page.
Back to top
What's new?
Version 2.0:
- Changed databases to work with dbUnder.
Version 1.1:
- Some HTML changes
- Better statistics of lists
Version 1.0
Downloading the script
Note: All scripts come in .ZIP format.
Go to http://mtvwebdesign.hypermart.net/scripts/ for the latest version
Back to top
Requirements
You need a server which allows you to execute Perl scripts. (CGI access).
You need a server which allows you to create directories. (Shouldn't be a problem).
Your server needs to have the CGI::Carp module installed. See FAQ's below on how to stop using the CGI::Carp module when you encounter problems.
You need a Cookie capable browser.
The script is tested with success on the following system(s):
Pentium 133Mhz (32 Mb RAM), Apache 1.3.4 and Sambar Perl 5 (ActiveState) build 509 (January 4th 1999), Microsoft Internet Explorer 5.0.
Back to top
Getting the script to work.
Changes in the CGI files
- Please check the first line of all the .CGI files. (#!/usr/local/bin/perl). This should be the place where Perl is located on your server. Ask your webmaster for more information.
- In all the .CGI files, you can find the following lines (They might look different in the script):
use CGI::Carp qw(fatalsToBrowser); # Provides you with fatal error message if they occur.
require '/home/username/arch/arch.conf';
require $mtvwebdesignlib;
require $dbunderpath;
$dbdir = &dbdir_;
require $dbunder;
These lines are probably the most important. Please make sure that you change them in all the .CGI files!
Now, what you need to do is this: The require '/home/username/arch/arch.conf';
line should point to your config file. Please make sure you use an absolute path (as shown). Ask you webmaster for more information.
Changes in the dbUnderPath.lib file
When you open the dbUnderPath.lib file, you see the following line:
sub dbdir_ { return "c:/sambar/databases/"; }
You need to change this line to match your directory where you want to store the Arch database. Please note that if you already have a dbUnderPath.lib file on your system, you don't need a second lib. Just make sure that the scripts point to the lib you have on your system.
Changes in the arch.conf file
- $script_location
This should point to the location (URL) of the main script Arch.cgi. Example: http://www.yourdomain.com/cgi-bin/arch.cgi
- $add_script
This should point to the location (URL) of the "Add subscriber" script add.cgi. Example: http://www.yourdomain.com/cgi-bin/add.cgi
- $remove_script
This should point to the location (URL) of the "Remove subscriber" script remove.cgi. Example: http://www.yourdomain.com/cgi-bin/remove.cgi
- $mtvwebdesignlib
This is the location of the MTVWEBDESIGN.LIB file on your server. It should be the ABSOLUTE PATH to the file. Example: "/home/username/lib/mtvwebdesign.lib";
- $dbunderpath
This is the location of the DBUNDERPATH.LIB file on your server. It should be the ABSOLUTE PATH tot the file. Example: "/home/username/lib/dbUnderPath.lib"; Please note that if you already have a dbUnder system on your server, you don't need a second one. Just locate the dbUnderPath.lib file on your server, and point to that file.
- $dbunder
This is the location of the DBUNDER.LIB file on your server. It should be the ABSOLUTE PATH tot the file. Example: "/home/username/lib/dbUnder.lib"; Again, if you already have a dbUnder.lib file on your server, just point to that file.
TIP: Store your library files in a different directory, so you can use them with other scripts too!
- $setup_file
This should point to the location of the config file on your server. You should provide the path to your file, e.g.: "/usr/home/username/cgi-bin/arch.conf"; If you have this file in the same directory as your script, you can leave the line as it is.
- $servicename
This is the name of your service. By default this is set to Arch, which is the name we gave to the script while testing. You can change this to the name of your bussiness for example.
- $servicelocation
This is the main page of the service, for example the main page of your site. This should be an URL, for example: http://www.yourdomain.com/service
- $loginlocation
This is the location where people can login for the use of your service. If you created your own page for logging in, provide the location here. You can also set the location to the main page of your site, or to the $script_location, since the script will print a HTML page when you run it. Example: http://www.yourdomain.com/cgi-bin/arch.cgi
- $webmasteremail
This is your email address. Please note that you HAVE TO place a "\" in front of the "@". Example: webmaster\@mtvwebdesign.hypermart.net
- $webmastername
This is your name
- $use_flock
Flock is a feature in perl and Unix systems. It allows you to lock a file (or database) so your files won't get corrupt. If your server runs on a UNIX like system, you'll probable want to set this feature to "1", which enables flock. If you are on a WinNT system, you can also use flock, so please set it to "1". If you are on a win95/98 system you cannot use flock, so set it to "0". If you don't know on what system your script will run, just set it to "1".
- $usetoken
If you want to use a tokenfile, set this option to "1". Else, set it to "0".
- $tokenfile
If you decide to use a tokenfile, please set the filename here. If the file is in the same directory as your script, you can just enter the filename. Else you need to provide the compete path, for example: /path/to/your/dir/tokenfile.html
- $token
This is the line you place in the tokenfile where you want the script to place the output. By default this is set to <!-- TOKEN -->. We advice you to keep this line. Have a look at the tokenfile.html file which comes with the package.
- $db_dir
This is the path to the directory where you want to store your databases. Please not that the directory should END with a "/". CHMOD the dir to 777. Example: /path/to/your/dir/databases/
- $listsdb
This is the name of the main database. We advice you to just keep the filename we gave you. No need to place the path in front of the filename, just he filename is enough, since we automatically place $db_dir in front.
- $mailprog
The location of the Mail program. Ask your webmaster. Normally the program is called something like SENDMAIL. Example: $mailprog = "|/usr/bin/sendmail -t";
- $webmaster
This option can either be set to "0" or "1". "0" means that everybody may create mailing-lists (hosting), "1" meanse that only the webmaster can create new lists.
- $webmasterpass
This is your webmasterpassword which you will need for creating new lists (if $webmaster is set to "1") and loggin in to the admin.cgi script. As you can see, this is very insecure! We advice you to do the following: before you really start using the service, please start the admin.cgi script by just going to the location of the script. Login with the webmasterpass and select the option: Change and secure webmasterpass. This will change the password in the arch.conf file and will encrypt it!
- $enc_web_pass
You won't see this variable in the first place. This variable will be added to the setup file when you changed the webmaster password and selected the option to encrypt it.
- $elapsed_seconds_newlist
This is the time people have to activate their list. They active the list by loggin in.
- $newlist_time
Don't change this line.
- $elapsed_seconds_warning
We do not want mailing lists that aren't used. So we automatically delete them, but first wel sent out a warning email. People need to login to re-active the list. By default this is set to 5 months.
- $warning_time
Don't change this line.
- $elapsed_seconds_oldlist
If the person owning the list still hasn't logged in after he had received the warning message, we assume he doesn't need the list anymore, so we delete it. This is the time lists are kept.
- $oldlist_time
Don't change this.
- @referers
This line makes sure that only people from your site can use the script. If you want to host the script, don't enter anything here. If you don't want to host the script, you might want to set this option. Example:
@referers = ("mtvwebdesign.hypermart.net","241.161.30.5");
- 1;
Do not delete this line. This tells the script that the setup file has successfully been read.
Uploading the files
First: Be sure to have the directory read where you want to place your CGI script. Make sure this directory is CHMOD 777. Than create a second directory where you want the databases to be placed. (Specified in the config file under $db_dir.). Make sure this directory is also CHMOD 777. See the FAQ for more information about CHMOD
UPLOAD IN ASCII FORMAT!
- arch.cgi
Upload this file to the place specified in $script_location. CHMOD the file 755.
- add.cgi
Upload this file to the place specified in $add_script. CHMOD the file 755.
- remove.cgi
Upload this file to the place specified in $remove_script. CHMOD the file 755.
- admin.cgi
Upload this file to the same directory as arch.cgi. CHMOD the file 755.
- arch.conf
Upload this file to the place specified in each .cgi file under "require". CHMOD 777.
- mtvwebdesign.lib
Upload this file to the place specified in $mtvwebdesignlib. CHMOD the file 777.
- dbUnderPath.lib
Upload this file to the place specified in $dbunderpath. CHMOD the file 777.
- dbUnder.lib
Upload this file to the place specified in $dbunder. CHMOD the file 777.
TIP: Store your library files in a different directory, so you can use them with other scripts too!
- tokenfile.html
Upload this file to the place specified in $tokefile. CHMOD 644. (Just upload.)
How to use the webmaster function
This is really easy. Just type the URL to the admin script in your Location bar of the browser, and you'll get the login page for the admin script. Enter your password specified under $webmasterpass. Press the submit button. You'll get to the webmaster page.
Because it's not very safe to set a password as plain text in a text file, we created an option on the webmaster main page to change that. You'll see it when you get there. USE IT!
Back to top
Demo of the script
I'm sorry, but there is no working demo of this script right now.
Back to top
Known problems
No problems on my computer and server.
Back to top
FAQ
What is CHMOD?
CHMOD is changing the attributes of a file. (UNIX systems only.). You should do that when you have uploaded the file, or create a new directory. Most FTP clients (like WS_FTP and BulletProofFTP) have the feature, only they call it CHANGE ATTRIBUTES and won't really show number but instead they show READABLE, WRITEBLE and EXECUTABLE. You can find out what you need to do by using this:
BinaryDecimal
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
r = readable
w = writeble
x = executable
So to set the permission above, "rw-r--r-x", on the file "test.txt," you would figure out the decimal first:
rw- r-- r-x =
110 100 101 =
6 4 5
I get a 501 Internal server error. What should I do?
Well, you have a problem there....
What you should do first is checking if you uploaded the CGI file in ASCII format and not in BINARY format.
If that doesn't work, check if all the permissions (CHMOD) are set right.
If that doesn't work, check the server error log. Ask your webmaster for more information
I cannot use CGI::Carp, how do I disable CGI::Carp?
The CGI::Carp modules may come in very handy when you are a beginner with Perl, since it outputs error messages to the browser instead of to the server error log. Anyway, to stop using the CGI::Carp module, open all the .cgi files, and find this line:
use CGI::Carp qw(fatalsToBrowser);
You need to comment this line, by placing a "#" in front of the line, so it'll look like this:
#use CGI::Carp qw(fatalsToBrowser);
or you can delete the line. The script won't use the module now.
What does "premature end of script headers mean"?
You probably uploaded the file in BINARY format. This should be ASCII format.
If that doesn't work, you should check the things you have changed in the script:
Is there a ";" at the end of lines? Are there any missing quotes (")? Etceteras.
How do I use a tokenfile?
First, take a look in the source of tokenfile.html. This is a page which has a tag in the source, which you cannot see when you view it in the browser. The tag is <!-- TOKEN --> (specified in setup.txt at $token). When you select that you want to use a template, Chat with me! will look for the $tokenfile (tokenfile.html) and that it 'll
search for the $token. If it finds the token (WHICH NEEDS TO BE PLACE ON A SEPARATE LINE IN THE SOURCE OF THE HTML DOCUMENT!), it'll print it's output at that spot in the html document. This way you get your own nice layout for the Chat with me! service!
TIP: Try to use STYLE tags in the $tokenfile!
Back to top
About MTVWebdesign open source.
MTVWebdesign open source means that if you make a change to the script which you think makes the script run even better, we would like you to sent the change to us. This way, we can keep providing better and better scripts. Your help is very important.
We particularly point out our use of the English language. Since English is not our first language, we cannot make sure that there a no misspellings in the code.
If your made a change which you think makes the script run better, please email the change (script) to opensource@mtvwebdesign.hypermart.net
Back to top
Disclaimer
By using this code you agree to indemnify Maarten Veerman and MTVWebdesign from any liability that might arise from its use.
MTVWebdesign is not responsible for improper use of this script.
Copyright © MTVWebdesign 2000. Selling the code is prohibited.
Back to top
Copyright © MTVWebdesign scripts 2000.