Hello! Welcome to the Mojo 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 Mojo Mail work correctly. This will be the only file you'll need to change out of the whole bunch. To set up Mojo 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 Mojo Mail.
You'll need to change 4 variables to get Mojo 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 Mojo Mail Root Password. This is used to Create New Lists Tip -> make this somewhat obscure, and do not use ``mojo'' or ``root_password'' or ``god'' or ``money'' or ``mail''
Tip -> comment the above line like this:
#$MOJO_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.
(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!
(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. Mojo 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 mojo.cgi script? This is the address of the mojo.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 (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 Mojo 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 Mojo 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 Mojo Mail does. Actually no. I really want you to read this entire file to get familiar with MOJO 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 choke 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 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.
Set a Default List
You can make Mojo Mail look like one of your lists if you change that list's Template. This will transform Mojo Mail from its default look to practically anything you want! Keep this variable blank if you don't want this to happen. At this point, only the actual look is used for a default.
$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. MySQL and PostgreSQL should be included in the standard installation.
%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 Mojo Mail to work with, explained later). They are as follows:
Before trying to install Mojo Mail with an SQL backend, make sure you create the appropriate table. For MySQL users, make the table using this:
CREATE TABLE mojo_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 mojo_subscribers ( email_id serial, email text, list text, list_type text, list_status char(1) );
This section deals with Mojo Mail and security - both to tighten it up, and lax it down. Depending on what you want to allow and what you can do.
http://mysite.com/cgi-bin/mojo/mojo.cgi?f=admin
This is a small security measure but may just stop people from snooping further.
Set the '$ALLOW_ROOT_LOGIN' variable to '1' to allow the Mojo Root Administrator to use the mojo 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)
http://yoursite.com/cgi-bin/mojo/mojo.cgi?f=pass_gen
eat a mango. they're REALLY good.
@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.
You can send email using an SMTP server instead of the sendmail program. If you can, we suggest you do. Mojo Mail uses the amazing Mail::Bulkmail module to do all SMTP sending.
You MUST give a valid smtp address, and then select ``send through smtp in the ''Sending Options`` of each list's control panel. We STRONGLY encourage you to use a SMTP server for big heafty lists. The best setting for big lists is using an smtp server and *NOT* (I said not) using batches. batches are used so you don't destroy sendmail with 1,000,000 emails at once, but Mojo used the Mail::Bulkmail, which is lightning fast.
(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 Mojo Mail. We just thought you'd like the option.
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 mojo 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
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.
It's also a good idea to rename mojo nph-mojo.cgi for windows servers
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
You can change the look and feel of Mojo globally by specifying a # different template file to use, examples of what these templates look like are located in the 'extras' directory.
To turn it on again, change this variable to 1
'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!
$FILE_CHMOD is a variable that sets what permission Mojo 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
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 alist under a different $FILE_CHMOD.
We've changed what the $FILE_CHMOD Mojo 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.
'Description charset',
There's a TAB between the Description and the actual charset, THIS IS REALLY IMPORTANT.
7bit, 8bit, quoted-printable, base64
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 Mojo more upgradable. Everytime you upgrade Mojo 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, Mojo finds this external config file in a bunch of ways.
You can implicitly set the directory it lives in by changing the $MOJO_CONFIG_FILE_DIR variable that lives inside the Config.pm module. Wherever the external config file lives, it needs to be called .mojo_config
If you don't change the $MOJO_CONFIG_FILE_DIR variable in the Config.pm file,
Mojo will try to look in your home directory for the .mojo_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 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 .mojo_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 .mojo_config file, which I guess ain't the worst way to go about things.
Anyways, an example of a .mojo_config file would look like this:
$MOJO_ROOT_PASSWORD = 'root_password'; $FILES = '/home/home_dir/mojo_lists_dir'; $MAILPROG = '/usr/lib/sendmail'; $MOJO_URL = 'http://yoursite.com/cgi-bin/mojo/mojo.cgi';
Pretty much any variable, array or hash can be saved in the .mojo_config file,
as long as it's not set inside a BEGIN{} block, whoich leaves out $MOJO_ERROR_LOG
and @AnyDBM_File::ISA treat .mojo_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 .mojo_config
The $MOJO_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.
(advanced hacker stuff)
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!
$SALT = "mj";
if all else fails.
%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.
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 (yo)
You can subscribe to [list_name] by following this link:
[list_subscribe_link]
EOF ;
$HTML_SEND_ARCHIVED_MESSAGE ||= <<EOF
<p><b>Hello!</b></p> <p>[sender_email] wanted to send this archived message to you, they wrote: </p>
<blockquote>[note]</blockquote>
<p>The Message:</p> <hr /> [archived_message] <hr />
<p>You can subscribe to [list_name] by following this link:</p>
<a href=``[plain_list_subscribe_link]''>[plain_list_subscribe_link]</a>
EOF ;
# Good Job! $GOOD_JOB_MESSAGE ||= ``<p class=smallred><i>Your changes have been saved successfully</i></p>\n'';
# No ones subscribed? $NO_ONE_SUBSCRIBED ||= ``<p>No one is subscribed to your list at the moment</P>'';
###################################################################### $ARCHIVES ||= $FILES;
######################################################################
###################################################################### # Ah, Here is where I pass tip jar around. I've sung song, played # my instrument and I ask if you enjoy the performance, that you put a few # in the bowl. Giving $50 to the Mojo Mail Project would be simply # wonderful. In fact, If you do, It would be pleasure to allow you to # make these two variables (below) blank. You can use the program indefinetly # without sending any donations, I only ask that if you found this program # AMAZING (and I believe you will) that you help out with the expenses # of the web site, the online documentation, the free support and # whatever else we provide. Like I said, I'm asking, not telling, you can # either keep these variables like this, or remove them and donate some # money, either way, you'll be supporting the program. # # # Donations, etc can be sent to: # # Justin Simoni # PO BOX 369 # Boulder, COLORADO # 80306 # # # Tell me if you like the program! I'll post testimonials on the Mojo # Mail Website. What I /really/ hope you get through this program is # an amazing tool to allow you to communicate- your ideas, dreams, # hard work and struggle. *That* is why I made this program. # # -Justin Simoni # me@justinsimoni.com # justinsimoni.com
#this footer gets appended to most e-mails sent using Mojo Mail $FOOTER ||= "\n\nList management using Mojo Mail $VER\n";
#This footer gets appended to most HTML e-mails sent with Mojo Mail
# DO NOT REMOVE THIS LINK UNLESS YOU ARE WILLING TO PAY. $HTML_FOOTER ||= ``\n\n<p style='font-size:10px;font-family:verdana,arial'>Powered by <a href= http://mojo.skazat.com target=out style='font-size:10px;font-family:verdana,arial'>Mojo Mail $VER</a><br />Copyright © 1999-2003, <a href=\''http://justinsimoni.com\`` target=\''_blank\`` style='font-size:10px;font-family:verdana,arial'>Justin Simoni</a>.</p>\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 = $MOJO_CONFIG_FILE_DIR || $ENV{'HOME'} || $good_getpwuid || ''; }else{ $CONFIG_FILE_DIR = $MOJO_CONFIG_FILE_DIR || $ENV{'HOME'} || ''; } my $CONFIG_FILE = $CONFIG_FILE_DIR.'/.mojo_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 = <CONFIG>; } # shooting again, $conf =~ m/(.*)/ms; $conf = $1; eval $conf; } }
# Don't remove the '1', it lives here at the bottom. it likes it there. 1;
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
e. - me@justinsimoni ph. - 720.436.7701 w. - http://justinsimoni.com
I am available for Installation, Customization and Consultation of the Mojo Mail program. I am also available for contract work, web design, Fine and Commercial Art.
Please, get in touch.
Copyright (c) 1999 - 2003 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.
``The sitting posture of Michelangelo's ''Moses`` is said to have been necessitated by the compact form of the block of marble he had to work with. Divine is always being presented with odd-shaped marbles that make her achieve masterpieces.''
-Genet, ``Our Lady of the Flowers''