#!/usr/bin/perl use strict; # try this, if you can -> #!/usr/bin/perl -wT # WinNT users! You may want to change the first line of this script to: #!C:/perl/bin/perl.exe # Note: KEEP the '#' character as the first character of that line. # WinNT users! If you're getting warnings in your browser, uncomment # this line: #close STDERR; #!/usr/bin/perl # use CGI::Carp "fatalsToBrowser"; # The line above, when uncommented, gets any server errors created # by Mojo Mail and shows them to your web browser. This facilitates # debugging, but it can be annoying if you really don't want this happening. # You'll see something in your browser that says 'Software Error' in big # old letters and then what the error was. Having this on also makes the # # What is in this script that you may want to at least look over are things # that may have to be tweak to fit your server configuration. # 99% of you won't ever have to change this, but then again, you might be # that 1%, so I'll try to walk you through. # First off, if you simply cannot get this script to work, and none of your # error logs point to something that's easy to pick out, try to change the # first line to something else. Its set at: # # #!/usr/bin/perl -w # # as a default. This might not be correct. Other things you can try are: # # # #!/usr/local/bin/perl -w # #!/usr/bin/perl5 -w # #!/usr/local/bin/perl5 -w # # For WinNT folk, you may want to try: # #!C:/perl/bin/perl.exe # # # If you don't know, this is called the 'path to Perl' This script needs to know # where it is, and if you don't know it, it can't figure it out by itself. You may # also need to change this if you're attempting to run mojo on a Windows NT server, # ask whoever is in charge of your web hosting server. # Another tid bit that I'll share is the -w at the end of that little line. That's called # the 'warning' flag and, well warns you of stuff that might not be correct. Its nice # to have to figure out weird errors. It also produces a lot of # # Use of uninitialized value at .. blah blah blah blah # # Which you may find annoying and also filling up your error logs with gobble dee gook # take the -w flag of like this # #!/usr/bin/perl # # and most of those warnings will stop. use lib qw(./ ./MOJO ./MOJO/perllib); # in weird server setups, you may need to change this to the absolute path # to the mojo folder, something like: # # /usr/home/account/www/cgi-bin/mojo # # If you move the MOJO directory, you'll need to change the # # use lib './'; # # to where it is really located. again, if you're running this on a windows # server, you may have to change this to the full path anyways. $ENV{PATH} = "/bin:/usr/bin:/usr/local/bin"; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # If you'd like, you can set a $ENV{PATH} for this program. This is in the ongoing # effort to allow Mojo Mail to run in 'Taint' mode. If you don't know what that means, # don't worry. Mojo Mail doesn't in the least bit need to run in taint mode. use MOJO::Config; use MOJO::App::Guts; use MOJO::Template::HTML; use MOJO::MailingList::Subscribers; # The three lines above load in needed modules, other modules are loaded # dynamically, but these three are needed almost all of the time. ###################################################################### # After popular opinion (aka enough people decided I should do this) # I now allow you to set the size, shape and characteristics of the # "Send a List Message' Form. I don't feel like having these variables in the # Config.pm file, since they're just used for this script, but here goes: # width of the textarea my $cols = 70; # height of the textarea my $rows = 15; # wrap my $wrap = 'NONE'; # style my $text_area_style = 'font-size:11px'; # check out: # http://www.eskimo.com/%7Ebloo/indexdot/html/tagpages/t/textarea.htm # for the skinny on what these really do, if you don't know ###################################################################### ###################################################################### # ! The variables you need to change are located in the Config.pm # file that is itself located in the MOJO folder. ###################################################################### ###################################################################### # Mojo Mail. An Easy And Powerful List Management System # # By Justin Simoni <+> justin@skazat.com <+> http://skazat.com # copyright 1999 - 2003 # # This program is Open Source Software and is covered under the General # Public License. You should have gotten a copy of the license with this script. # if not, you can view a copy at: http://www.gnu.org/copyleft/gpl.html # # Mojo Mail is free(!) software. Free as in speech, not in as beer or price, # please make sure you understand this. # # I do ask that you also PLEASE keep the link back to the support site intact, # the link that says: # List Management by Mojo Mail 2 <+> http://mojo.skazat.com # throughout the script, and also keep this header intact as well # # This enables people to find the program and use it themselves. # If you want it removed, you can give a $50 donation, # and I will allow you to take off the link, you can send check or money to: # # Justin Simoni # PO Box 369 # Boulder, CO # 80306 # # All money will go to support the program, the Mojo Mail website # and keeping an exceptionally bright student in college and beyond. # # Changes, Enhancements, Modifications and Professional Installation # of this script can be made on a project by project basis, # please contact: Skazat Designs at design@skazat.com # (the developer of Mojo Mail) if you are interested. ##################################################################### # This is the rest of the program, feel free to tweak as needed, if you # find some great enhancement, share it with the community! ###################################################################### # Use the CGI.pm module, to facilitate web page generation and get cookie functions use CGI; CGI->nph(1) if $NPH == 1; # Use strict to make code cleaner, and more safely written use strict; # Unbuffer output for faster page displaying $|++; #Ok, here we go... :) ###################################################################### my $q = new CGI; $q->charset($HTML_CHARSET); my $flavor = $q->param('flavor'); $flavor = $q->param('f') unless($flavor); #$flavor = 'default' if(!$flavor); my $process = $q->param('process'); my $email = $q->param('email') || ""; $email = $q->param('e') || "" unless($email); my $list = $q->param('list'); $list = $q->param('l') unless($list); my $list_name = $q->param('list_name'); my $pin = $q->param('pin'); $pin = $q->param('p') unless($pin); my $admin_email = $q->param('admin_email'); my $mojo_email = $q->param('mojo_email'); my $info = $q->param('info'); my $private_policy = $q->param('private_policy'); my $privacy_policy = $q->param('privacy_policy'); my $password = $q->param('password'); my $retype_password = $q->param('retype_password'); my $keyword = $q->param('keyword'); my @address = $q->param('address'); my $done = $q->param('done'); my $id = $q->param('id'); my $quick = $q->param('quick') || 'no'; my $advanced = $q->param('advanced') || 'no'; my $help = $q->param('help'); $list = xss_filter($list); $flavor = xss_filter($flavor); $email = xss_filter($email); $pin = xss_filter($pin); $keyword = xss_filter($keyword); ############################################# #Retrieve the cookie. all the info is saved # #on a seperate cookie for each list. # #logging out erases the password # ############################################# my %logincookie = $q->cookie($LOGIN_COOKIE_NAME); my $admin_list = $logincookie{admin_list}; my $admin_password = $logincookie{admin_password}; #external (mostly..) functions called from the web browser) # a few things mojo can do.... :) my %Mode = ( 'default' => \&default, #user start page with all lists 'subscribe' => \&subscribe, #user sends conformation 'subscribe_flash_xml' => \&subscribe_flash_xml, 'new' => \&confirm, #user adds email 'unsubscribe' => \&unsubscribe, #user unsunbscribes 'admin' => \&admin, #admin login in to the admin area 'login' => \&login, #admin check the user/pass 'logout' => \&logout, #admin erase user/pass 'new_list' => \&new_list, #admin make a new list 'change_info' => \&change_info, #admin change the info in the .db file 'html_code' => \&html_code, #admin get cut + paste code 'admin_help' => \&admin_help, #admin help page 'delete_list' => \&delete_list, #admin delete the list 'list_stats' => \&list_stats, 'view_list' => \&view_list, 'view_list_options' => \&view_list_options, 'edit_subscriber' => \&edit_subscriber, 'add' => \&add, #admin add emails 'email_password' => \&email_password, #admin email the password to the admin 'add_email' => \&add_email, #admin admin add an email 'delete_email' => \&delete_email, #admin admin delete an email 'send_email' => \&send_email, #admin send the list email 'preview_form' => \&preview_form, #admin preview the form 'checker' => \&checker, #admin mass delte email 'edit_template' => \&edit_template, #admin edit the template 'view_archive' => \&view_archive, #admin 'edit_archive' => \&edit_archive, 'delete_archive' => \&delete_archive, 'archive' => \&archive, #user look at list the archive 'chocolate' => \&chocolate, #chocolate! 'all_list_code' => \&all_list_code, #user, shows signup code for all lists. 'manage_script' => \&manage_script, #admin get info on the script 'change_password' => \&change_password, #change your password 'text_list' => \&text_list, #admin shows email list in new window 'send_list_to_admin' => \&send_list_to_admin, #admin sends email list to adin 'search_email' => \&search_email, #admin search through emails 'archive_options' => \&archive_options, #admin archive options 'adv_archive_options' => \&adv_archive_options, #admin archive options 'back_link' => \&back_link, #create a back button 'edit_type' => \&edit_type, #customize type and stuff 'edit_html_type' => \&edit_html_type, #customize type and stuff 'list_options' => \&list_options, # customize list options 'sending_options' => \&sending_options, # customize sending options 'adv_sending_options' => \&adv_sending_options, # adv sending options 'sign_in' => \&sign_in, # sign into individual lists 'black_list' => \&black_list, #sign into black lists 'search_archive' => \&search_archive, # search through the archive (user) 'send_archive' => \&send_archive, # send a copy of an archive message 'mojo_send_options' => \&mojo_send_options, # options for mojo_send.pl 'list_invite' => \&list_invite, # invite a whole bunch of people to your list 'pass_gen' => \&pass_gen, # password generation 'send_url_email' => \&send_url_email, 'feature_set' => \&feature_set, 'smtp_options' => \&smtp_options, 'checkpop' => \&checkpop, 'author' => \&author, 'list' => \&list_page, 'setup_info' => \&setup_info, 'reset_cipher_keys' => \&reset_cipher_keys, 'r' => \&redirection, # these params are the same as above, but are smaller in actual size # this comes into play when you have to create a url usign these as parts of it. 's' => \&subscribe, # subscribe 'n' => \&confirm, # confirm the subscription 'u' => \&unsubscribe, # unsubscribes 'smtm' => \&smtm # SHOW ME THE MONEY! ); &_chk_env_sys_blk(); # the BIG switcheroo. Mark doesn't like this :) if(exists($Mode{$flavor})) { $Mode{$flavor}->(); #call the correct subroutine }else{ &default; } sub default { user_error(-Error => 'bad_setup') if(check_setup() == 0); if(($DEFAULT_SCREEN ne '') && ($flavor ne 'default')){ print $q->redirect(-uri => $DEFAULT_SCREEN); exit; } my @available_lists = available_lists(-In_Order => 1); my @available_archives = available_archives(); my %default_list; my $default_exists = check_if_list_exists(-List=>$DEFAULT_LIST,); if($DEFAULT_LIST ne "" && $default_exists >= 1){ %default_list = open_database(-List =>$DEFAULT_LIST); } print(the_html(-Part => "header", -Title => "Sign up for a list", -List => $DEFAULT_LIST)); if ($available_lists[0]) { print qq{
|
Choose a list: |
Enter your email address: |
| }; require MOJO::Template::Widgets; print MOJO::Template::Widgets::list_popup_menu(); print qq{ | |
|
Subscribe | Unsubscribe |
|
Available Lists:}; foreach my $everything(@available_lists){ my %all_list_info = open_database(-List => $everything); if($all_list_info{hide_list} ne "1"){ print"$all_list_info{list_name} /gio;
$all_list_info{info} =~ s/\n/ | |
Please agree to the terms of the GPL License and the No SPAM policy by checking the checkbox below:
} if $agree eq 'no'; my $gpl = MOJO::App::Licenses::gpl(); my $no_spam = MOJO::App::Licenses::no_spam(); print qq{You installed $PROGRAM_NAME correctly, the next thing to do is set up a list or two. Be sure you know your root password and enter it below to begin making a new list:
Please Read, Understand and Agree to the GNU Public License as well as agreeing not to use Mojo Mail for unsolicited (SPAM) email.
$no_agree
I agree to the GPL license and no-spam conditions
Root Password: /g;
$list_info{$_}=~ s/\n/ $bullet $archive_links[$ii]\n";
#}
#}
}
print ' Please be sure cookies are enabled in your browser. Select your list: Type in your List Password
EOF
;
if($list_exists < 1){
require MOJO::Template::Widgets;
print MOJO::Template::Widgets::list_popup_menu(-name => 'admin_list',
-show_hidden => 1);
}else{
print "";
print "
Warning! No SMTP Server has been set! $html_unsubscribe_link/g;
$html_message_body =~ s/\[list_subscribe_link\]/ $html_subscribe_link/g;
}elsif($email_format eq 'HTML_and_text'){
# make two versions of the message, the other one being converted html to text
$content_type = 'multipart/alternative';
$html_message_body = $html_message_body;
$html_message_body =~ s/\[list_unsubscribe_link\]/ $html_unsubscribe_link/g;
$html_message_body =~ s/\[list_subscribe_link\]/ $html_subscribe_link/g;
$text_message_body = convert_to_ascii($text_message_body);
$text_message_body =~ s/\[list_unsubscribe_link\]/$text_unsubscribe_link/g;
$text_message_body =~ s/\[list_subscribe_link\]/$text_subscribe_link/g;
}
}
if($html_message_body){
if($q->param('apply_template') == 1){
$html_archive_message_body = $html_message_body;
$html_message_body = (the_html(-Part => "header",
-Title => $message_subject,
-List => $list,
-Header => 0)) .
$html_message_body .
the_html(-Part => "footer",
-List => $list);
}
}
my $msg;
my $plain_msg;
my $fancy_msg;
if($text_message_body and $html_message_body){
# if we have text and html, we need to make a multipart/alternative message,
#$msg = MIME::Lite->new(Type => 'multipart/alternative');
$msg = MIME::Lite->new(Type => 'multipart/alternative');
$plain_msg = $msg->attach(Type => 'text/plain',
Data => $text_message_body,
Encoding => $PLAIN_TEXT_ENCODING);
if($q->param('html_with_images') == 1){
$fancy_msg = $msg->attach(Type => 'multipart/related');
$fancy_msg->attach(Type => 'text/html',
Data => $html_message_body);
}else{
$msg->attach(Type => 'text/html',
Data => $html_message_body);
}
}elsif($text_message_body){
if(!$q->param('attachment_1')){
# make only a text body
$msg = MIME::Lite->new(Type => 'TEXT',
Data => $text_message_body,
Encoding => $PLAIN_TEXT_ENCODING);
}else{
$msg = MIME::Lite->new(Type => 'TEXT',
Data => $text_message_body);
}
}elsif($html_message_body){
# make only a html body
if($q->param('html_with_images') == 1){
$msg = MIME::Lite->new(Type => 'multipart/alternative');
$plain_msg = $msg->attach(Type => 'text/plain',
Data => ' ');
$fancy_msg = $msg->attach(Type => 'multipart/related');
$fancy_msg->attach(Type => 'text/html',
Data => $html_message_body);
}else{
$msg = MIME::Lite->new(Type => 'text/html',
Data => $html_message_body);
}
}else{
# else, we probably have an email with only attachments.
$msg = MIME::Lite->new(Type =>'multipart/mixed');
}
my $attach_report;
#if we have attachments...
my @attachments;
if($attachment){
my $ii;
$attach_report = " Attachments: $errors field$ending on this form
$err_word filled out incorrectly and need to be fixed for all new information to be saved.
You did not fill in a list name You need to give a valid e-mail address for the list owner You need to give your list a description Hide Your List Close Your List Lookup Hostnames When Validating Email Addresses. Receive Subscription Notices Send Subscription Confirmation Emails Send Subscription Successful Emails Send Unsubscription Confirmation Emails Receive Unsubscription Notices Send Unsubscription Successful Emails \ Send E-mail Using SMTP send all e-mail from $PROGRAM_NAME using a straight SMTP connection ";
print " instead of through a mail program such as sendmail. Warning! No SMTP Server has been set! Warning! SMTP cannot be used. Your version of Perl (" . $] . ") is not up to date. Enable Batch Sending You must enable batch sending for batch sending to start working.";
print "Lists under 100 people may not need it at all. Receive Batch Confirmations Receive notices by e-mail every time";
print " a batch is complete. You'll be told what batch $PROGRAM_NAME is on and ";
print " how many people have received your message so far. Receive Finishing Message Receive notice by e-mail when $PROGRAM_NAME has sent all your list messages. \ [?] Send Mailing List Messages in Batches ";
print "\n";
print " ";
print "Send all e-mails with only the address in the 'To' and 'From' message headers ";
print "\n";
print " ";
print "Print list-specific headers in all list emails ";
print "\n";
print " ";
print qq{Add the
Sendmail '-f' flag when sending messages, using $MAILPROG
Warning! Your effective uid is not the same as your real uid;
using this option may break mail sending. ";
print "\n";
print " ";
print qq{Print the 'Errors-To' header in all list emails
";
print "\n";
print " ";
print qq{Print the 'Return-Path header in all list emails
Use POP-before-SMTP Authentication";
print " Set the Sender of SMTP mailings to the list administration email address";
print " The email address you typed is invalid. The email address you typed is already subscribed. \n";
my $email_count = $q -> param("email_count");
if(defined($email_count)){
my $add_message = "$email_count people have been added successfully";
print $q->p("$add_message");
}
my $delete_email_count = $q -> param("delete_email_count");
if(defined($delete_email_count)){
print " ",$delete_email_count;
print " emails have been deleted
/g;
}
print $q->h3('About ' . $list_info{list_name} . ':') . $q->p($list_info{info});
print $q->hr();
print $q->h3('Privacy Policy:') . $q->p($list_info{private_policy}) . $q->hr() if($list_info{private_policy});
if ($list_info{show_archives} ne "0"){
require MOJO::MailingList::Archives;
my $archive = MOJO::MailingList::Archives->new(-List => \%list_info);
my $entries = $archive->get_archive_entries();
print $q->h3("Archives:") if defined($entries->[0]);
my @archive_nums;
my @archive_links;
my $stopped_at;
my ($begin, $stop) = $archive->create_index(0);
my $i = 0;
my $num = 1;
for($i = $begin; $i <=$stop; $i++){
my $link;
if(defined($entries->[$i])){
my ($subject, $message, $format) = $archive->get_archive_info($entries->[$i]);
my $pretty_subject = pretty($subject);
$link.= " [$i]&list=$list\">$pretty_subject
";
my $date = date_this(-Packed_Date => $entries->[$i],
-Write_Month => $list_info{archive_show_month},
-Write_Day => $list_info{archive_show_day},
-Write_Year => $list_info{archive_show_year},
-Write_H_And_M => $list_info{archive_show_hour_and_minute},
-Write_Second => $list_info{archive_show_second});
$link .= "Sent $date \n";
$link .= "';
for($ii=0;$ii<=$#archive_links; $ii++){
my $bullet = $archive_nums[$ii];
#fix if we're doing reverse chronologic
$bullet = (($#{$entries}+1) - ($archive_nums[$ii]) +1) if($list_info{sort_archives_in_reverse} eq "1");
print "
';
print $archive->create_index_nav($list_info{list}, $stopped_at);
print $archive->make_search_form($list_info{list}) if($list_info{archive_search_form} eq "1");
print $q->hr() if defined($entries->[0]);
}
print "" if $SHOW_ADMIN_LINK ==1;
print(the_html(-Part => "footer", -List => $list));
}
sub admin {
my @available_lists = available_lists();
my %default_list;
my $default_exists = check_if_list_exists(-List=>$DEFAULT_LIST,);
if($DEFAULT_LIST ne "" && $default_exists >= 1){
%default_list = open_database(-List =>$DEFAULT_LIST);
}
#print header();
print(the_html(-Part => "header",
-Title => "Administration",
-List => $DEFAULT_LIST));
print $q->end_form();
require MOJO::Template::Widgets;
if($LOGIN_WIDGET eq 'popup_menu'){
print MOJO::Template::Widgets::list_popup_login_form();
} elsif($LOGIN_WIDGET eq 'text_box') {
print MOJO::Template::Widgets::text_box_login_form();
}else{
warn "'$LOGIN_WIDGET' misconfigured!"
}
print qq {
};
print(the_html(-Part => "footer",
-List => $DEFAULT_LIST,
-Site_Name => $default_list{website_name},
-Site_URL => $default_list{website_url}));
}
sub sign_in {
my $list_exists = check_if_list_exists(-List=>$list);
if($list_exists >= 1){
#print header();
my $pretty = pretty($list);
print(the_html(-Part => "header",
-Title => "Sign In To $pretty",
-List => $list));
}else{
#print header();
print(the_html(-Part => "header",
-Title => "Sign In",
-List => $DEFAULT_LIST));
}
my @available_lists = available_lists();
my %default_list;
my ($default_exists) = check_if_list_exists(-List=>$DEFAULT_LIST,);
if($DEFAULT_LIST ne "" && $default_exists >= 1){
%default_list = open_database(-List =>$DEFAULT_LIST);
}
print $q->end_form();
print $q->start_form(-action => $S_MOJO_URL, -method => 'Post');
require MOJO::Template::Widgets;
if($list_exists >= 1){
print MOJO::Template::Widgets::list_login_form(-list => $list);
}else{
if($LOGIN_WIDGET eq 'popup_menu'){
print MOJO::Template::Widgets::list_popup_login_form();
} elsif($LOGIN_WIDGET eq 'text_box') {
print MOJO::Template::Widgets::text_box_login_form();
}else{
warn "'$LOGIN_WIDGET' misconfigured!"
}
}
=cut
print <
EOF
;
=cut
if($list_exists >= 1){
print(the_html(-Part => "footer",
-List => $list));
}else{
print(the_html(-Part => "footer",
-List => $DEFAULT_LIST,
-Site_Name => $default_list{website_name},
-Site_URL => $default_list{website_url}));
}
}
sub send_email {
# Howdy! (that's Coloradoian talk for 'hello') saying that,
# i'm actually a transplant from Connecticut. But anyways this is
# the 'send a list message' function (applause) which is probably the
# most interesting function in this pile of code and one you might
# want to tweak or something, so here goes.
# we'll check a few things here, makes sure info saved in a cookie
# is all good and well,
my $root_login = check_list_security(-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'send_email');
# a bit of a trick, $admin_list is fetched from a cookie, so its not
# like you can pass the admin password here in a query string, kinda
# makes it impossible for you to spoof the security without a browser.
$list = $admin_list;
# fetch the list info hash. this has all our list information
# and related goodies.
my %list_info = open_database(-List => $list,-Format => "replaced");
#
#
#
my $text_message_body = "";
my $html_message_body = "";
my $message_subject = $list_info{list_name} . ' Message';
if($q->param('archive_id')){
require MOJO::MailingList::Archives;
my $la = MOJO::MailingList::Archives->new(-List => \%list_info);
if($la->check_if_entry_exists($q->param('archive_id')) > 0){
my ($asubject, $amessage, $aformat) = $la->get_archive_info($q->param('archive_id'));
$message_subject = $asubject;
if($aformat =~ m/HTML/i){
$html_message_body = $amessage;
}else{
$text_message_body = $amessage;
}
}
}
#
#
#
# 'attachment number' tells how many file upload widgets to show.
# pretty frickin exciting eh?
my $at_num = $q->param('at_num') || 1;
#unless we be doing some sending...
unless( (defined($process) ) && ($process ne "") ){
#print our header
print(admin_html_header(-Title => "Send A List Message",
-List => $list_info{list},
-Root_Login => $root_login));
# end the form that's in the template, we need a special form for
# file uploads.
print $q->end_form();
print $q->h3("Send a message to people subscribed to: $list_info{list_name}");
print "
EOF
;
print "
";
# this is all for the advanced form, we'll be switching from
# basic and advanced, so pay attention!
# print the From: field
# usually the list owner
print $q->Tr($q->td([
($q->p({-align=>'right'},($q->b('From:')))),
($q->p($q->textfield(-name =>'From',
-value =>'"'. escape_for_sending($list_info{list_name}) . '" <'.$list_info{mojo_email}.'>',
-size => 49)))
])),
# print the 'Reply-To:' field
# usually the same as the From: field
$q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Reply-To:')))),
($q->p($q->textfield(-name =>'Reply_To',
-value =>'"' . escape_for_sending($list_info{list_name}) . '" <'.$list_info{mojo_email}.'>',
-size => 49)))
])),
(($list_info{print_errors_to_header} == 1) ?
(
# print the 'Errors-To' field
# usually the List Admin
$q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Errors-To:')))),
($q->p($q->textfield(-name =>'Errors_To',
-value =>"<$list_info{admin_email}>",
-size => 49)))
])),
) : ()),
(($list_info{print_return_path_header} == 1) ?
(
# print the 'Return-Path' field
# usually the List Admin
$q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Return-Path:')))),
($q->p($q->textfield(-name =>'Return_Path',
-value =>"<$list_info{admin_email}>",
-size => 49)))
])),
) : ()),
# print the Precedence, usually list
$q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Precedence:')))),
($q->p($q->popup_menu(-name => 'Precedence',
-values => \@PRECEDENCES,
-default => $list_info{precedence})))
])),
#print the Priority, usually 3 or 'Normal'
$q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Priority:')))),
($q->p($q->popup_menu(-name =>'Priority',
-values =>[keys %PRIORITIES],
-labels => \%PRIORITIES,
-default => $list_info{priority},
)))
]))if($advanced eq 'yes');
# print the subject
print $q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Subject:')))),
($q->p($q->textfield(-name =>'message_subject',
-value =>"$message_subject",
-size => 49)))
]));
# this is where we print out the attachments if we be in 'advanced'
if($advanced eq 'yes'){
# tell us that we're using attachments
print $q->hidden('attachment', 'true');
# remember how many attachment files we have
print $q->hidden('at_num', $at_num);
# my $i
my $i;
# foreach of the $at_num's
for($i=1; $i<=$at_num; $i++){
# print a file upload form
print $q->Tr($q->td([
($q->p({-align=>'right'},$q->b("Attachment $i"))),
($q->p($q->filefield(-name=>"attachment_$i",-size => 36)))
]));
}
my $next_num = $at_num+1;
# and then print a link to make another one.
print $q->Tr($q->td([
$q->p(' '),
$q->p({-align=>'right'}, $q->i($q->a({-href=>"$S_MOJO_URL?flavor=$flavor&advanced=yes&at_num=$next_num"}, 'more attachment fields...'))),
]));
}
# give an option to *not* archive this message (adv)
print $q->Tr($q->td([
($q->p({-align=>'right'},($q->b('Options:')))),
($q->p(
$q->checkbox(-name => 'html_with_images',
-value => 1,
-label => 'HTML Version uses attached images',
)))
])),
$q->Tr($q->td([
($q->p(' ')),
($q->p($q->checkbox(-name =>'archive_message',
-value => 1,
-label => 'Archive This message',
(($list_info{archive_messages} ne "0") ?
(-checked => 'ON',) :
(-checked => '0',)),
)))
])),
$q->Tr($q->td([
($q->p(' ')),
($q->p($q->checkbox(-name => 'apply_template',
-value => 1,
-label => 'Apply the list template to the HTML message',
)))
])) if($advanced eq 'yes');
# print the 'Format' select box if we're in basic.
print $q->Tr($q->td([
($q->p({-align=>'right'},$q->b('Format:'))),
($q->p($format_options))
])) if($advanced ne 'yes');
print '
';
# print textfield('archive_message', $list_info{archive_messages}) if $advanced ne 'yes';
my $text_blurb = "";
my $html_blurb = "";
$text_blurb = "Text Version
" if($advanced eq 'yes');
$html_blurb = "HTML Version
" if($advanced eq 'yes');
# print one textarea...
print $q->p({-align=>'center'}, "$text_blurb",
$q->textarea(-name => 'text_message_body',
-cols => $cols,
-rows => $rows,
-wrap => $wrap,
-style => $text_area_style,
-value => $text_message_body));
# and another if we're in 'advanced'
print $q->p({-align=>'center'}, "$html_blurb",
$q->textarea(-name => 'html_message_body',
-cols => $cols,
-rows => $rows,
-wrap => $wrap,
-style => $text_area_style,
-value => $html_message_body)) if($advanced eq 'yes');
if(
($advanced eq 'yes') &&
($list_info{send_via_smtp} ne "1")
){
print $q->hr({-width=>'66%', -size=>1, -color=>'black'}),
$q->p({-align=>'center'}, $q->i('These two options are helpful if, for
some reason, your list mailing was
dropped mid sending - you\'ll be able
to pick up the mailing near where it
was left off')),
$q->p({-align=>'center'},'start this mailing at this address:', $q->br(),
$q->textfield(-name=>'Start-Email'), $q->br(),
$q->b('-or-'), $q->br(),
'start this mailing at email number:', $q->br(),
$q->textfield(-name=>'Start-Num', -size=>6), $q->br()),
$q->hr({-width=>'66%', -size=>1, -color=>'black'}),
}
print <
";
# for those attachments
for($ii = 1; $ii <= $at_num; $ii++){
my $a_type;
my $this_attachment = "attachment_$ii";
# get it by garment,
my $get_attachment = $q->param($this_attachment);
if($get_attachment){
my $attach_name = $get_attachment;
$attach_name =~ s!^.*(\\|\/)!!;
my $file_ending = $attach_name;
$file_ending =~ s/.*\.//;
# This should work, since I'm bloody shipping the program
# with em'
require MIME::Types;
require MIME::Type;
# Yeah, well, you never can be too sure :)
if(($MIME::Types::VERSION >= 1.005) && ($MIME::Type::VERSION >= 1.005)){
$file_ending =~ s/^\.//;
my $mimetypes = MIME::Types->new;
my MIME::Type $attachment_type = $mimetypes->mimeTypeOf($file_ending);
$a_type = $attachment_type;
}else{
# Alright, we're going to have to figure this one ourselves...
if(exists($MIME_TYPES{'.'.lc($file_ending)})) {
$a_type = $MIME_TYPES{'.'.lc($file_ending)};
}else{
# Drat! all hope is lost! Abandom ship!
$a_type = $DEFAULT_MIME_TYPE;
}
}
# This is called, "Last Ditch" right here.
# If we can't figure this out, just let MIME::List
# try to do what we just tried :)
if(!$a_type){
warn "attachment MIME Type never figured out, letting MIME::Lite handle this...";
$a_type = 'AUTO';
}
# two versions to upload files,
# one is upload -> save -> attach
if($ATTACHMENT_TEMPFILE == 1){
my $attachment_file = file_upload($this_attachment);
if($q->param('html_with_images') == 1){
$fancy_msg->attach(Type => $a_type,
Path => $attachment_file,
Id => '<'.$attach_name.'>',
'Content-Location' => $attach_name,
Filename => $attach_name,
);
}else{
$msg->attach(Type => $a_type,
Path => $attachment_file,
Filename => $attach_name,
Disposition => 'attachment',
);
}
}else{
#the other is 'magically' save.
if($q->param('html_with_images') == 1){
$fancy_msg->attach(
Type => $a_type,
FH => $get_attachment,
Id => '<'.$attach_name.'>',
'Content-Location' => $attach_name
);
}else{
$msg->attach(
Type => $a_type,
FH => $get_attachment,
Filename => $attach_name,
);
}
}
$attach_report .= "$attach_name
";
#save name fer later.
push(@attachments, $attach_name);
}
}
$attach_report .= "
';
print $q->p($q->i('This message has been', $q->a({-href=>"$S_MOJO_URL?flavor=view_archive&id=$message_id"}, 'archived')))
if(($archive_m != 0) && ($process !~ m/test/i));
print(admin_html_footer(-List => $list));
if($ATTACHMENT_TEMPFILE == 1){
foreach(@attachments){
# delete attachment files
unlink("$FILES/$_");
}
}
}
}
sub list_invite {
my $root_login = check_list_security(-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'list_invite');
$list = $admin_list;
my %list_info = open_database(-List => $list);
my $lh = MOJO::MailingList::Subscribers->new(-List => $list);
unless($process){
# unless we have something to do, give them the first screen:
print(admin_html_header(-Title => "Invitations",
-List => $list_info{list},
-Root_Login => $root_login));
print $q->p("Send an invitation email by pasting the addresses of people
you want to invite to your list, and then writing an invitation message.
Your invitation list will be cleaned of duplicate addresses,
people who are already subscribed to your list, invalid e-mail addresses
and any black listed addresses.");
print $q->p($q->b("Your Invitation List:"), $q->br(),
$q->textarea(-name => 'new_emails',
-cols => 50,
-rows => 5)),
$q->hidden('flavor', 'list_invite');
print '';
print '
';
print '';
print $q->p($q->b("To: $list_info{list_name}"), $q->br(),
$q->b("From: $list_info{mojo_email}"), $q->br(),
$q->b("Subject: $message_subject"));
if($text_message_body){
print '
';
my $screen_text_message = $text_message_body;
$screen_text_message = webify_plain_text($screen_text_message);
$screen_text_message =~ s/\[email\]/$list_info{mojo_email}/gi;
my $lm_pin = make_pin(-Email => $list_info{mojo_email});
$screen_text_message =~ s/\[pin\]/$lm_pin/gi;
print $q->p($q->b('Text Message:'), $q->br(),
$screen_text_message);
}
if($html_message_body){
print '
';
my $screen_html_message = $html_message_body;
$screen_html_message =~ s/\[email\]/$list_info{mojo_email}/gi;
my $html_lm_pin = make_pin(-Email => $list_info{mojo_email});
$screen_html_message =~ s/\[pin\]/$html_lm_pin/gi;
print $q->p($q->b('HTML Message:'), $q->br(), $screen_html_message);
}
print $attach_report if(defined($attach_report));
print '
';
print $q->p("You can send the invitation message in plain text, HTML, or both.
Type in your message in the appropriate text box, leaving either of them
blank if no mailing of that format is desired");
print $q->p($q->b("Subject:"), $q->br(),
$q->textfield(-name => 'message_subject',
-size => 50,
-value => $list_info{invite_message_subject}));
#Plain Text
print $q->p({-align=>'center'}, $q->b("Text Message"), $q->br(),
$q->textarea(-name => 'text_message_body',
-value => $list_info{invite_message_text},
-cols => $cols,
-rows => $rows,
-wrap => $wrap,
-style => $text_area_style));
# HTML
print $q->p({-align=>'center'}, $q->b("HTML Message"), $q->br(),
$q->textarea(-name => 'html_message_body',
-value => $list_info{invite_message_html},
-cols => $cols,
-rows => $rows,
-wrap => $wrap,
-style => $text_area_style));
print $q->p(
$q->checkbox(-name => 'save_invite_messages',
-value => 1,
-label => ''),
$q->b('Save these messages and the subject for future invitation messages'));
print <
EOF
;
print(admin_html_footer(-List => $list));
exit;
}else{
#######################################################################
#
#
# The code below is very similar to the 'add_email()' function, please note.
# Later on, I may take the below code and create a function from it.
#
#######################################################################
# q: what exactly are we doing here?
# a: we're filtering out the emails given to the script
# in various steps
my %seen;
# get the emails
my $new_emails = $q -> param("new_emails");
# split them into individual entities
my @new_addresses = split(/\s+|,|;|\n+/, $new_emails);
my @good_emails = ();
my @bad_emails = ();
my $invalid_email;
foreach my $check_this_address(@new_addresses) {
# see they're valid
my $pass_fail_address = check_for_valid_email($check_this_address);
if ($pass_fail_address >=1){
# save em if tey aint
push(@bad_emails, $check_this_address);
}else{
# save em if they are valid
$check_this_address = lc_email($check_this_address);
push(@good_emails, $check_this_address);
}
}
# this filters through the emails and takes out al duplicates
%seen = ();
my @unique_good_emails = grep { ! $seen{$_}++} @good_emails;
%seen = ();
my @unique_bad_emails = grep { ! $seen{$_}++} @bad_emails;
@unique_good_emails = sort(@unique_good_emails);
@unique_bad_emails =sort(@unique_bad_emails);
# this filters out emails addresses, taken them out of our list if they're already there
# figure out what unique emails we have from the new list when compared to the old list
my ($unique_ref, $not_unique_ref) = $lh->unique_and_duplicate(-New_List => \@unique_good_emails,
-List => $list);
#initialize
my @black_list;
my $found_black_list_ref;
my $clean_list_ref;
my $black_listed_ref;
my $black_list_ref;
if($list_info{black_list} eq "1"){
#open the black list
$black_list_ref = $lh->open_email_list(-List => $list, -Type => "black_list", -As_Ref=>1);
# now, from that new list of clean emails, see which ones are black listed
($found_black_list_ref) = $lh->get_black_list_match($black_list_ref, $unique_ref);
#now, tell me which ones still are ok.
($clean_list_ref, $black_listed_ref) = $lh->find_unique_elements($unique_ref, $found_black_list_ref);
}else{
$clean_list_ref = $unique_ref;
}
# add these to a special 'invitation' list. we'll clear this list later.
my $new_email_count=$lh->add_to_email_list(-Email_Ref => $clean_list_ref,
-List => $list_info{list},
-Type => 'invitelist',
-Mode => 'writeover');
#####################################################################
# SUBJECT #
###########
# get the message subject
my $message_subject = $q->param('message_subject');
#####################################################################
# TEXT #
########
# get the text message
my $text_message_body = $q -> param('text_message_body') || undef;
# if text version was passed,
if($text_message_body){
# get rid of weird line breaks caused by textareas
$text_message_body =~ s/\r\n/\n/g;
# interpolate [tags] to $tags
$text_message_body = interpolate_string(-String => $text_message_body, -List_Db_Ref => \%list_info);
}
#####################################################################
# HTML #
########
# get the HTML message (if any)
my $html_message_body = $q -> param('html_message_body') || undef;
if($html_message_body){
# get rid of weird line breaks
$html_message_body =~ s/\r\n/\n/g;
# interpolate [pusedo tags]
$html_message_body = interpolate_string(-String => $html_message_body,-List_Db_Ref => \%list_info);
}
my $s_link = subscribe_link(-list => $list,
-email => '[email]',
-pin => '[pin]');
my $us_link = unsubscribe_link(-list => $list,
-email => '[email]',
-pin => '[pin]');
# make unsub links
my $html_subscribe_link = "$s_link";
my $html_unsubscribe_link = "$us_link";
# make sub links
my $text_unsubscribe_link = $s_link;
my $text_subscribe_link = $us_link;
if(defined($text_message_body) ne ""){
# interpolate the sub and unsub links
$text_message_body =~ s/\[list_unsubscribe_link\]/$text_unsubscribe_link/g;
$text_message_body =~ s/\[list_subscribe_link\]/$text_subscribe_link/g;
}
if(defined($html_message_body) ne ""){
# interpolate the sub and unsub links
$html_message_body =~ s/\[list_unsubscribe_link\]/$html_unsubscribe_link/g;
$html_message_body =~ s/\[list_subscribe_link\]/$html_subscribe_link/g;
}
require MIME::Lite;
MIME::Lite->quiet(1) if $MIME_HUSH == 1; ### I know what I'm doing
$MIME::Lite::PARANOID = $MIME_PARANOID;
my $msg;
if($text_message_body and $html_message_body){
# if we have text and html, we need to make a multipart/alternative message,
$msg = MIME::Lite->new(Type => 'multipart/alternative');
$msg -> attach(Type => 'TEXT', Data => $text_message_body);
$msg -> attach(Type => 'text/html', Data => $html_message_body);
}elsif($html_message_body){
# make only a text body
$msg = MIME::Lite->new(Type => 'text/html', Data => $html_message_body);
}else{
$msg = MIME::Lite->new(Type => 'TEXT', Data => $text_message_body);
}
$msg->replace('X-Mailer' =>"");
# get the header,
my $header_glob = $msg->header_as_string();
# get the body
my $message_string = $msg->body_as_string();
require MOJO::Mail::Send;
my $mh = MOJO::Mail::Send->new(\%list_info);
# translate the glob into a hash
my %headers = $mh -> return_headers($header_glob);
# make a mailing
my %mailing = (
%headers,
To => '"'. escape_for_sending($list_info{list_name}) .'" <'. $list_info{mojo_email} .'>',
From => $list_info{mojo_email},
Subject => $message_subject,
Body => $message_string);
# just testing?
$mh->list_type('invitelist');
$mh->bulk_test(1) if($process =~ m/test/i);
$mh->bulk_send(%mailing);
print(admin_html_header(-Title => "Invitations Sent",
-List => $list_info{list},
-Root_Login => $root_login));
$new_email_count = int($new_email_count);
if($process =~ m/test/i){
print $q->p("Your", $q->b($q->i("test")), " invitation message is being sent to the list owner,
($list_info{mojo_email})");
}else{
print $q->p("$new_email_count invitation messages are now being sent. The list owner will also get a copy of this invitation message.");
}
print '
';
print(admin_html_footer(-List => $list));
if($q->param('save_invite_messages') == 1){
my $p_text_message_body = $q->param('text_message_body');
$p_text_message_body =~ s/\r\n/\n/g;
my $p_html_message_body = $q->param('html_message_body');
$p_html_message_body =~ s/\r\n/\n/g;
require MOJO::MailingList::Settings;
my $ls = MOJO::MailingList::Settings->new(-List => $list);
$ls->save({
invite_message_text => $p_text_message_body,
invite_message_html => $p_html_message_body,
invite_message_subject => $q->param('message_subject'),
});
}
}
}
sub send_url_email {
my $root_login = check_list_security(-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'send_url_email');
$list = $admin_list;
my %list_info = open_database(-List => $list);
if(!$process){
print(admin_html_header(
-Title => "Send A Webpage",
-List => $list_info{list},
-Root_Login => $root_login));
eval { require MIME::Lite::HTML};
if($@){
print $q->p($q->b($q->i("Sorry, this feature is not available on this server. Ask your server administrator to install the 'lwp Perl library")));
}else{
print $q->p('Send a web page to your subscribers. Enter the complete URL (including the http://)
of the webpage you want to send out. It\'s well advised that you send a test message before
committed on a real list sending.'),
$q->p($q->b('Message Subject:'), $q->br(),
$q->textfield(-name =>'message_subject',
-value =>"$list_info{list_name} message",
-size => 49)),
$q->p($q->b('Web Page Address (URL):'), $q->br(),
$q->textfield(-name=>'url', size=>'65', -value=>'http://')),
$q->table({-cellpadding => 5},
$q->Tr($q->td({-valign => 'top'}, [
($q->p($q->b('Images at this location should:'))),
($q->p(
$q->radio_group(
-name => 'url_options',
'-values' => ['extern'],
-labels => {extern => ''},
-default => 'extern',
),
'have their URLs changed to absolute', $q->br(),
$q->radio_group(
-name => 'url_options',
'-values' => ['location'],
-labels => {location => ''},
-default => '-',
),
'be embeded in the message itself, using the \'Content-Location\' header', $q->br(),
$q->radio_group(
-name => 'url_options',
'-values' => ['cid'],
-labels => {cid => ''},
-default => '-',
),
'be embeded in the message itself, using the \'Content-ID\' header',
)),
])
),
),
$q->table({-cellpadding => 5, -align => 'center', -style => 'border: 1px solid black'},
$q->Tr($q->td([($q->p($q->b('Restricted URL Information'))), ($q->p($q->i('(optional)'))) ])),
$q->Tr($q->td([
($q->p({align=> 'right'}, $q->b('username:')), ($q->p($q->textfield(-name => 'url_username')))),
])
),
$q->Tr($q->td([
($q->p({align=> 'right'}, $q->b('password:')), ($q->p($q->password_field(-name => 'url_password')))),
])
),
),
$q->p($q->b('Plain Text Version (optional)'), $q->br(),
$q->textarea(-name => 'text_message_body',
-cols => $cols,
-rows => $rows,
-wrap => $wrap,
-style => $text_area_style,
-value => ' ')
),
$q->hidden('flavor', 'send_url_email'),
$q->hr();
print <';
print '
';
print '';
print $q->p($q->b("To: Invite List"), $q->br(),
$q->b("From: $list_info{mojo_email}"), $q->br(),
$q->b("Subject: $message_subject"));
if($text_message_body){
print '
';
my $screen_text_message = $text_message_body;
$screen_text_message = webify_plain_text($screen_text_message);
$screen_text_message =~ s/\[email\]/$list_info{mojo_email}/gi;
my $lm_pin = make_pin(-Email => $list_info{mojo_email});
$screen_text_message =~ s/\[pin\]/$lm_pin/gi;
print $q->p($q->b('Text Message:'), $q->br(),$screen_text_message);
}
if($html_message_body){
print '
';
my $screen_html_message = $html_message_body;
$screen_html_message =~ s/\[email\]/$list_info{mojo_email}/gi;
my $html_lm_pin = make_pin(-Email => $list_info{mojo_email});
$screen_html_message =~ s/\[pin\]/$html_lm_pin/gi;
print $q->p($q->b('HTML Message:'), $q->br(),
$screen_html_message);
}
print '
EOF
;
print(admin_html_footer(-List => $list));
}
}else{
eval { require MIME::Lite::HTML };
if(!@$){
my $url_options = $q->param('url_options') || undef;
my $login_details;
if(defined($q->param('url_username')) && defined($q->param('url_password'))){
$login_details = $q->param('url_username') . ':' . $q->param('url_password')
}
my $mailHTML = new MIME::Lite::HTML('IncludeType' => $url_options,
#'Debug' => "1",
'TextCharset' => $list_info{charset_value},
'HTMLCharset' => $list_info{charset_value},
(($login_details) ? (LoginDetails => $login_details) : ()),
HTMLEncoding => 'quoted-printable',
TextEncoding => '7bit',
);
my $t = $q->param('text_message_body') || 'This email message requires that your mail reader support HTML';
my $MIMELiteObj = $mailHTML->parse($q->param('url'), $t);
my $content = $MIMELiteObj->body_as_string();
require MIME::Lite;
MIME::Lite->quiet(1) if $MIME_HUSH == 1; ### I know what I'm doing
$MIME::Lite::PARANOID = $MIME_PARANOID;
my $base_url = $q->param('url');
#if($q->param('add_base_tag') eq 'yes'){$content = "
\n";
print "
";
print $q->p($q->b('Subscriptions'));
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "Your list information won't be provided on the $PROGRAM_NAME main screen ";
print "or anywhere else to subscribe to.";
print " People will still be able to subscribe/unsubscribe with the proper information";
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "Do not allow people to subscribe to your list, e-mails can only be added to your list. ";
print "from the administration control panel.";
print "People can still unsubscribe at any time";
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "When an email address is submitted to be validated, the domain of the address will be checked for its existance.";
print "\n";
print "
';
print $q->p($q->b('Unsubscriptions'));
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "You can be notified every time someone subscribes to your list by e-mail";
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "Subscribers will have to reply to a confirmation e-mail sent to the address that's";
print " entered into the subscripton form. If you do not send confirmation e-mails, the subscriber";
print " will be added to your list right after the email is checked for validity and to make sure its";
print " not already on your list\n ";
print '";
print "\n";
print " ";
print "
";
print "After a person subscribes, an email will be sent to announce the subscription.\n";
print "
";
print $q->hr();
print "";
print "";
print submit_form(-Submit=>'Save List Options');
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "Unsubscribers will have to reply to an unsubscription confirmation e-mail if they try to unsubscribe from the list without their pin\n ";
print "";
print "\n";
print " ";
print "
";
print "You can be notified every time someone unsubscribes to your list by e-mail";
print "\n ";
print "";
print "\n";
print " ";
print "
";
print "After a person unsubscribes, an email will be sent to confirm the unsubscription.";
print "
";
print " ";
print "";
print "\n";
print " ";
print " ";
print "\n";
print " ";
print "
";
print "";
print $q->Tr($q->td([$q->p("Send"), $q->p($q->popup_menu(
-name => "bulk_send_amount",
-value => [@message_amount],
)), $q->p("Messages")]));
print $q->Tr($q->td([$q->p("Every"), $q->p($q->popup_menu(
-name => "bulk_send_seconds",
-value => [@message_wait],
)), $q->p($q->popup_menu(
-name => "bulk_send_seconds_label",
-value => [@message_label],
-labels => \%label_label,
))]));
print "
";
print "
";
print "";
print "
";
print "";
print "\n";
print " ";
print " ";
print "
";
print "\n";
print "";
print "";
print submit_form(-Submit=>'Save Sending Options');
print "";
print "\n";
print " ";
print " ";
print "
";
print $q->hidden('process', 'true');
print $q->hidden('list', $list);
print $q->hidden('flavor', 'adv_sending_options');
print submit_form();
print $q->p({-align=>'right'}, $q->b($q->a({-href=>"$S_MOJO_URL?flavor=sending_options"},'Basic...')));
print(admin_html_footer(-List => $list));
}else{
$list = $admin_list;
my %list_info = open_database(-List => $list,);
my %new_info = (
list => $list,
precedence => $precedence,
priority => $priority,
charset => $charset,
content_type => $content_type,
strip_message_headers => $strip_message_headers,
add_sendmail_f_flag => $add_sendmail_f_flag,
print_list_headers => $print_list_headers,
print_return_path_header => $print_return_path_header,
print_errors_to_header => $print_errors_to_header,
);
my $status = setup_list(\%new_info);
user_error(-List => $list, -Error => "no_permissions_to_write") if $status == 0;
print $q->redirect(-uri=>"$S_MOJO_URL?flavor=adv_sending_options&done=1");
}
}
sub smtp_options {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'smtp_options');
require MOJO::Security::Password;
$list = $admin_list;
my %list_info = open_database(-List => $list);
if(!$process){
print(admin_html_header(
-Title => "SMTP Sending Options",
-List => $list_info{list},
-Root_Login => $root_login));
print $GOOD_JOB_MESSAGE if(defined($done));
print ' ';
print "
";
print "Some SMTP servers get confused when 'To:' and 'From:' mail headers contain both the address and name
(example: "John Smith" <johm\@smith.com>)
";
print "All messages sent will only contain the actual address
(example: john\@smith.com) ';
print "
";
print "List-specific headers store information on how to subscribe and unsubscribe from a list, as well as other list specific information, in the header of the email.";
print " It is highly advised to take advantage of these headers. ';
print "
Sometimes the Return-Path header, useful when dealing with bounced emails,
will not get set correctly. To fix this, messages will be sent with the
'-f' flag and the admin email:
$MAIL_SETTINGS -f $list_info{admin_email}
';
print "
The 'Errors-To' header is used to tell mail servers where to direct a message when an error in delivery occurs.
This header has been deprecated
';
print "
The 'Return-Path' header works much like setting the '-f' flag. Alternatives to Sendmail (like Qmail)
allow you to use the Return-Path header.
';
print $q->Tr($q->td([($q->p($q->b('SMTP Server:'))), ($q->p($q->textfield(-name=>'smtp_server', -value=>$list_info{smtp_server}, -size=>30 )))]));
print $q->Tr($q->td([($q->p($q->b('Port:'))), ($q->p($q->textfield(-name=>'smtp_port', -value=>$list_info{smtp_port}, -size=>5 )))]));
print $q->Tr($q->td([($q->p($q->b('Connection Tries:'))), ($q->p($q->textfield(-name=>'smtp_connect_tries', -value=>$list_info{smtp_connect_tries}, -size=>2 )))]));
print '
';
print $q->hr();
print "";
print "
";
print $q->p("POP-before-SMTP Authentication will require your username and password for your POP3 Account:");
print $q->p($q->b('POP3 server:'),
$q->br(),
$q->textfield(-name=>'pop3_server', -value=>$list_info{pop3_server}, -size=>30));
print $q->p($q->b('POP3 username:'),
$q->br(),
$q->textfield(-name=>'pop3_username', -value=>$list_info{pop3_username}, -size=>30));
print $q->p($q->b('POP3 password:'),
$q->br(),
$q->password_field(-name=>'pop3_password', -value=>MOJO::Security::Password::cipher_decrypt($list_info{cipher_key}, $list_info{pop3_password}), -size=>30));
print $q->button(
-value => 'Test POP-before-SMTP settings',
-style => $STYLE{yellow_submit},
-onClick => 'javascript:testPOPBeforeSMTP();',
);
print '";
print "\n";
print " ";
print "
A connection to your Pop Server will be created before any mail will be sent.";
print "This can authenticate your outgoing mail requests, if your server uses POP-before-SMTP
';
print "";
print "
";
print $q->hidden('process', 'true');
print $q->hidden('list', $list);
print $q->hidden('flavor', 'smtp_options');
print $q->hr();
print submit_form();
print(admin_html_footer(-List => $list));
}else{
my $use_pop_before_smtp = $q->param('use_pop_before_smtp') || 0;
my $set_smtp_sender = $q->param('set_smtp_sender') || 0;
my $smtp_server = $q->param('smtp_server');
my $pop3_server = $q->param('pop3_server');
my $pop3_username = $q->param('pop3_username');
my $pop3_password = $q->param('pop3_password');
my %ni = (
list => $list_info{list},
use_pop_before_smtp => $use_pop_before_smtp,
smtp_server => $smtp_server,
pop3_server => $pop3_server,
pop3_username => $pop3_username,
set_smtp_sender => $set_smtp_sender,
pop3_password => MOJO::Security::Password::cipher_encrypt($list_info{cipher_key}, $pop3_password),
smtp_port => $q->param('smtp_port'),
smtp_connect_tries => $q->param('smtp_connect_tries'),
);
my $status = setup_list(\%ni);
user_error(-List => $list, -Error => "no_permissions_to_write") if $status == 0;
print $q->redirect(-uri=>"$S_MOJO_URL?flavor=smtp_options&done=1");
}
}
sub checkpop {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'mojo_send_options');
$list = $admin_list;
require MOJO::Security::Password;
my $user = $q->param('user');
my $pass = $q->param('pass');
my $server = $q->param('server');
my %list_info = open_database(-List => $list);
require MOJO::Mail::Send;
my $mh = MOJO::Mail::Send->new(\%list_info);
my $pop_status = $mh->_pop_before_smtp(-pop3_server => $server,
-pop3_username => $user,
-pop3_password => $pass);
print $q->header();
if(defined($pop_status)){
print $q->h2("Success!");
print $q->p($q->b("POP-before-SMTP authentication was successful"));
print $q->p($q->b("Make sure to 'Save Changes' to have your edits take affect."));
}else{
print $q->h2("Warning!");
print $q->p($q->b('POP-before-SMTP authentication was ',$q->i('unsuccessful'),));
}
}
sub mojo_send_options {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'mojo_send_options');
$list = $admin_list;
my %list_info = open_database(-List => $list);
#a few variables
my $group_list = $q->param('group_list') || 0;
my $allow_group_interpolation = $q->param('allow_group_interpolation') || 0;
my $only_allow_group_plain_text = $q->param('only_allow_group_plain_text') || 0;
my $append_list_name_to_subject = $q->param('append_list_name_to_subject') || 0;
my $mail_group_message_to_poster = $q->param('mail_group_message_to_poster') || 0;
my $add_reply_to = $q->param('add_reply_to') || 0;
unless(defined($process)){
print(admin_html_header(
-Title => "Group Options",
-List => $list_info{list},
-Root_Login => $root_login));
print $GOOD_JOB_MESSAGE if(defined($done));
print $q->p("You can use the mojo_send.pl to send e-mails using your mail reader,
such as Outlook or Eudora. mojo_send.pl can also be used to set up group lists,
where everyone on your list will be able to send to everyone else on your list,
using a special address"),
$q->p("Please be sure that mojo_send.pl is properly installed before you use it!"),
$q->table(
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'group_list',
-value => 1,
-label=>'',
(($list_info{group_list} eq "1") ?
(-checked=>'ON') :
(-checked=> 0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(0)', -class=>'black'}, 'Make Your List a Group List')), $q->br(),
'Everyone subscribed to your list can send to e-mails to everyone else on your list.'))
])
),
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'allow_group_interpolation',
-value => 1,
-label=>'',
(($list_info{allow_group_interpolation} eq "1") ?
(-checked=>'ON') :
(-checked=>0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(1)', -class=>'black'}, 'Allow Variable Interpolation In Group Mailings')), $q->br(),
"Variable Interpolation means that pseudo tags like this: [mojo_url] will be changed to what they really are ($MOJO_URL) "))
])
),
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'only_allow_group_plain_text',
-value => 1,
-label=>'',
(($list_info{only_allow_group_plain_text} eq "1") ?
(-checked=>'ON') :
(-checked=>0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(2)', -class=>'black'}, 'Only Allow Plain Text Messages To Be Sent From Group Members')), $q->br(),
'Only e-mails seen as being plain text (no HTML) will be allowed to post to the group'))
])
),
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'append_list_name_to_subject',
-value => 1,
-label=>'',
(($list_info{append_list_name_to_subject} ne "0") ?
(-checked=>'ON') :
(-checked=>0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(3)', -class=>'black'}, 'Add the list name to the subject of group mailings')), $q->br(),
'List messages will be sent out with the list name at the beginning of the message, surrounded by brackets. This
helps subscribers with identifying an e-mail message that originates from your list.'))
])
),
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'add_reply_to',
-value => 1,
-label=>'',
(($list_info{add_reply_to} ne "0") ?
(-checked=>'ON') :
(-checked=>0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(4)', -class=>'black'}, 'Automatically have replies to messages directed to the group')), $q->br(),
'A \'Reply-To\' header will be added to group list mailings that will direct replys to list messages back to the list.'))
])
),
$q->Tr(
$q->td({-valign=>'top'},[
($q->checkbox(-name => 'mail_group_message_to_poster',
-value => 1,
-label=>'',
(($list_info{mail_group_message_to_poster} ne "0") ?
(-checked=>'ON') :
(-checked=>0)),
)),
($q->p($q->b($q->a({-href=>'javascript:checklink(5)', -class=>'black'}, 'Send Posters Their Own Message')), $q->br(),
'People who post messages to the list will receive their own email messages.'))
])
),
);
print $q->hidden('flavor','mojo_send_options'),
$q->hidden('process','true');
print submit_form();
print(admin_html_footer(-List => $list));
}else{
$list = $admin_list;
my %list_info = open_database(-List => $list,);
my %new_info = (
list => $list,
group_list => $group_list,
allow_group_interpolation => $allow_group_interpolation,
only_allow_group_plain_text => $only_allow_group_plain_text,
append_list_name_to_subject => $append_list_name_to_subject,
mail_group_message_to_poster => $mail_group_message_to_poster,
add_reply_to => $add_reply_to,
);
my $status = setup_list(\%new_info);
user_error(-List => $list, -Error => "no_permissions_to_write") if $status == 0;
print $q -> redirect(-uri=>"$S_MOJO_URL?flavor=mojo_send_options&done=1");
}
}
sub view_list {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'view_list',
);
$list = $admin_list;
my %list_info = open_database(-List => $list);
my $lh = MOJO::MailingList::Subscribers->new(-List => $list);
my $start = $q->param('start') || 0;
my $length = $list_info{view_list_subscriber_number}; #$q->param('length') || 100;
print(admin_html_header(
-Title => "Your Subscribers",
-List => $list_info{list},
-Root_Login => $root_login));
print $q->end_form();
my $num_subscribers = $lh->num_subscribers;
my $screen_finish = $length+$start;
$screen_finish = $num_subscribers if $num_subscribers < $length+$start;
my $screen_start = $start;
$screen_start = 1 if (($start == 0) && ($num_subscribers != 0));
print '";
print "\n";
print " ";
print "
This will ultimately set the 'Return-Path' email header to the list administration email address
($list_info{admin_email}), and bounced messages will return to that address. Otherwise,
they will go to the list owner.";
print "
';
print '';
print $q->p('Subscribers ', $q->b($screen_start), ' to ' . $q->b(($screen_finish)));
print ' ';
print $q->p({-align => 'right'}, 'Total number of subscribers: ', $q->b($num_subscribers), $q->a({-href => $S_MOJO_URL . '?f=add'}, 'add...'));
print '
';
print '';
print ' ' if($start-$length) >= 0 ;
print ' ' if($num_subscribers > ($start + $length));
print ' ';
print $q->Tr(
$q->td([
($q->p(' ')),
($q->p($q->b('Email'))),
]),
);
#{-style=> 'border:1px solid black'},
my $subscribers = $lh->subscription_list(-start => $start, '-length' => $length);
foreach(@$subscribers){
print $q->Tr(
$q->td([
(delete_checkbox($_->{email})),
($q->p(edit_subscriber_link($_->{email}))),
]),
);
}
print '
';
print '
';
print "";
print "";
print "";
print qq{};
print '';
print qq{
';
print ' ' if($start-$length) >= 0 ;
print ' ' if($num_subscribers > ($start + $length));
print '
};
print qq{
};
print $q->p({-align => 'right'}, $q->b($q->a({-href => $S_MOJO_URL . '?f=view_list_options'}, 'View Options...')));
print(admin_html_footer(-List => $list));
}
sub view_list_options {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'view_list_options',
);
my @list_amount = (10,25,50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000);
$list = $admin_list;
require MOJO::MailingList::Settings;
my $ls = MOJO::MailingList::Settings->new(-List => $list);
my $list_info = $ls->get;
if($process == 1){
$ls->save({view_list_subscriber_number => $q->param('view_list_subscriber_number')});
print $q->redirect(-uri => $S_MOJO_URL . '?f=view_list_options&done=1');
}
print(admin_html_header(
-Title => "View List Options",
-List => $list_info->{list},
-Root_Login => $root_login));
print $GOOD_JOB_MESSAGE if $q->param('done') == 1;
print $q->p('Show', $q->popup_menu(-name => 'view_list_subscriber_number',
-values => [ @list_amount],
-default => $list_info->{view_list_subscriber_number}), 'subscribers at one time'),
$q->hidden('f', 'view_list_options'),
$q->hidden('process', 1);
print submit_form();
print $q->p($q->a({-href => $S_MOJO_URL . '?f=view_list'}, '<- View Subscription List'));
print(admin_html_footer(-List => $list));
}
sub edit_subscriber {
print $q->redirect(-uri => $S_MOJO_URL . '?f=view_list') if ! $email;
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'edit_subscriber',
);
$list = $admin_list;
my %list_info = open_database(-List => $list);
my $lh = MOJO::MailingList::Subscribers->new(-List => $list);
print $q->redirect(-uri => $S_MOJO_URL . '?f=view_list&error=no_such_address')
if($lh->check_for_double_email(-Email => $email) == 0);
if($process eq 'edit'){
my $edit_email = $q->param('edit_email');
my ($status, $errors) = $lh->subscription_check(-Email => $edit_email);
if($errors->{invalid_email} == 1){
print $q->redirect(-uri => $S_MOJO_URL . '?f=edit_subscriber&email='.$email.'&error=invalid_email')
}elsif(($errors->{subscribed} == 1) && ($email ne $edit_email)){
print $q->redirect(-uri => $S_MOJO_URL . '?f=edit_subscriber&email='.$email.'&error=email_subscribed')
}else{
$lh->remove_from_list(-Email_List => [$email]);
$lh->add_to_email_list(-Email_Ref => [$edit_email]);
print $q->redirect(-uri => $S_MOJO_URL . '?f=edit_subscriber&email='.$edit_email.'&success=1');
}
}else{
print(admin_html_header(
-Title => "Edit Subscriber",
-List => $list_info{list},
-Root_Login => $root_login));
print $GOOD_JOB_MESSAGE if $q->param('success') == 1;
print '
};
print(admin_html_footer(-List => $list));
}
}
sub edit_subscriber_link {
my $email = shift;
return '' . $email . '';
}
sub delete_checkbox {
my $email = shift;
return $q->checkbox(-name => 'address', -value => $email, -label => '');
}
sub list_stats {
my $root_login = check_list_security(
-Admin_List => $admin_list,
-Admin_Password => $admin_password,
-IP_Address => $ENV{REMOTE_ADDR},
-Function => 'list_stats',
);
# view whos on the list, add delete addresses
$list = $admin_list;
my %list_info = open_database(-List => $list);
my $lh = MOJO::MailingList::Subscribers->new(-List => $list);
print(admin_html_header(
-Title => "Subscriber Statistics",
-List => $list_info{list},
-Root_Login => $root_login));
print "
"; print "\n" if($SHOW_EMAIL_LIST ==1); print " | \n";
print <
There are a total of $everyone email addresses on $list_info{list_name}
EOF ; } if($SHOW_SERVICES_TABLE==1){ my $skey; my $svalue; my $using; my @skeys = sort(values %SERVICES); print $q->p("E-mail address sorted by popular E-mail or ISP Services, click on a service to see the list of e-mails from that particular service"); print <
\n"; } print < ")if(defined(@$black_listed_ref[0])); foreach(@$black_listed_ref){ print " ", $_, " \n"; } } print $q->p("These addresses are already subscribed to $list_info{list_name}, so they won't be added again:
To delete an e-mail, enter it into Your Delete List'; print 'You can also pick the e-mail from Your Subscription List (if available). Scroll through the e-mail addresses, select it and press Copy to Delete List>> .' if($SHOW_EMAIL_LIST ==1); print ' After you are finished, press Submit E-mail List '; print <
Alternatively, use a file containing the email addresses you would like to be removed to the list. EOF ; print $q->p($q->filefield(-name => 'delete_email_file')); print submit_form(-Reset=>'Re-Enter E-mail List',-Submit=>'Submit E-mail List'); print ' '; print < |
",$_,"
")if(defined($unique_bad_emails[0]));
foreach(@unique_bad_emails){
print "",$_,"
\n";
}
print "
You can also use the black list to match a part of an e-mail address, adding '.com' to the black list will disallow anyone that has '.com' in their e-mail address.
EOF ; print ""; print ""; print" "; if($list_info{black_list} eq "1"){ print " Black List Rules are active | ";
print "";
print " "; }else{ print " Black List Rules are inactive | ";
print "";
print " "; } print " |
"; print "\n"; print " | "; print "Move e-mail addresses that have just been unsubscribed to the black list"; print " |
"; print "\n"; print " | "; print "Allow past subscribers to subscribe again, even though they are black listed"; print " |
"; print "\n"; print " | "; print "Allow administration to subscribe black listed e-mail addresses"; print " |
Here is the list of the archived messages for $list_info{list_name}. To delete an entry, check it and press \"Delete Checked\"
"; print "$pretty_subject
";
my $date = date_this(
-Packed_Date => $entry,
-Write_Month => $list_info{archive_show_month},
-Write_Day => $list_info{archive_show_day},
-Write_Year => $list_info{archive_show_year},
-Write_H_And_M => $list_info{archive_show_hour_and_minute},
-Write_Second => $list_info{archive_show_second},
);
print "Sent $date \n";
print "
$message
"; my $cal_date = date_this(-Packed_Date => $id, -All => 1); print <Sent $cal_date
"; print "\n"; print " | ";
print " Show archive messages until the message signature |
"; print " "; print " | ";
print " Sort Your Archives In: |
"; print " "; print " | ";
print " Show Archive Dates With The: |
| '; print $q->table({-align=>'center',cellpadding=>1}, $q->Tr($q->td([$q->p('Show the archived message index ')])), $q->Tr($q->td([$q->p('with',$q->popup_menu(-name=>'archive_index_count', -value=>[@index_this], -style =>'font-family:arial;font-size:11px;'), 'links at a time') ]))); print " |
|
Form Field Size |
|
|||||||
|
Form Field Label |
||||||||
Put Subscription Unsubscription Radio Buttons? |
|
|||||||
|
Button Label |
Give $PROGRAM_NAME Credit? |
|
EOF
;
}else{
print '';
}
print <
" if $SHOW_HELP_LINKS == 1; print qq{
|
This is a preview (read: not saved!!!!) of your template.
to save, or edit, close this window and hit the Change Template button
"; $test_footer =~ s/\[message\]/preview of template/g; $test_footer =~ s/\[version\]/$VER/g; print $test_footer; }else{ $list = $admin_list; my $template_info = $q->param("template_info"); my $get_template_data = $q->param("get_template_data") || ''; my $url_template = $q->param('url_template') || ''; setup_list({list => $list, get_template_data => $get_template_data, url_template => $url_template}); make_template(-List => $list, -Template => $template_info); print $q->redirect(-uri=>"$S_MOJO_URL?flavor=edit_template&done=1"); } } } sub back_link { my $root_login = check_list_security(-Admin_List => $admin_list, -Admin_Password => $admin_password, -IP_Address => $ENV{REMOTE_ADDR}, -Function => 'back_link'); # a few variables... my $website_name = $q -> param("website_name"); my $website_url = $q -> param("website_url"); unless(defined($process)){ $list = $admin_list; my %list_info = open_database(-List => $list); print(admin_html_header(-Title => "Create a Back Link", -List => $list_info{list}, -Root_Login => $root_login)); #good job! print $GOOD_JOB_MESSAGE if(defined($done)); print <
Site Name:
";
print "
Site Address: (http://)
";
print "
This is $PROGRAM_NAME
|
Version: | $VER |
Visit the support site
An entire support site has been set up just for Mojo Mail. There, you'll be able to browse through faqs, instructions, tips and tricks and whatever else we can muster:
Join the Skazat Design mailing list
This mailing list provides information about Skazat Designs and Mojo Mail. It's used to announce new features to Mojo Mail, as well as other projects from Skazat Designs. the list is low traffic and usually e-mails are not sent out more than once a month
Give Back to Mojo Mail
Mojo Mail is free, open source software, you are in absolutely no obligation to pay for Mojo Mail by downloading or using it. If you find Mojo Mail incredibly useful, you may want to give to the Mojo Mail project, money goes towards the cost of web server hosting for the support site, software used to make this product and to basically keep the lights on. Any leftover money goes toward my college education.
Purchase The Mojo Mail Magic Book
The Mojo Mail Magic Book has been written to give advanced users of Mojo Mail even more insight on the program so they may be able to use Mojo Mail to the limit of its abilities.
Customizations to the Mojo Mail Program
Mojo Mail is developing rapidly, with many great new features added all the time. If you need a feature that is not included in Mojo Mail, you can always have this feature added by the developer of Mojo Mail. Consultation, Installation and Customization services are available. Please visit: http://mojo.skazat.com/support/customize.html for more information.
License Agreement
Mojo Mail is Open Source Software and is released under the GNU Public License
Mojo Mail and SPAM
Do not use Mojo Mail for SPAM. Don't even eat SPAM. Really, it's disgusting. We're ramen-eatin folks. Seriously though, please read our stance on SPAM:
http://mojo.skazat.com/about/spam.html
EOF ; print(admin_html_footer(-List => $list)); } sub feature_set { my $root_login = check_list_security(-Admin_List => $admin_list, -Admin_Password => $admin_password, -IP_Address => $ENV{REMOTE_ADDR}, -Function => 'feature_set'); $list = $admin_list; my %list_info = open_database(-List => $list); require MOJO::Template::Widgets::Admin_Menu; if(!$process){ print(admin_html_header(-Title => "Customize Feature Set", -List => $list_info{list}, -Root_Login => $root_login)); print $GOOD_JOB_MESSAGE if(defined($done)); print MOJO::Template::Widgets::Admin_Menu::make_feature_menu(\%list_info); print $q->hidden('process', 'true'); print $q->hidden('flavor', 'feature_set'); print $q->p(submit_form()); print(admin_html_footer(-List => $list)); }else{ my @params = $q->param; my %param_hash; foreach(@params){$param_hash{$_} = $q->param($_);} my $save_set = MOJO::Template::Widgets::Admin_Menu::create_save_set(\%param_hash); my %new_info = (list => $list, admin_menu => $save_set); setup_list(\%new_info); print $q->redirect(-uri=>"$S_MOJO_URL?flavor=feature_set&done=1"); } } sub subscribe { # this has been totally redone (11/16/00) # it was getting a bit messy # if it we aint got nothing, just give them the signup form, # well, how bout just give them the main page? unless($list){&default;exit;} # ok, that was easy, now, let say they have the email address, # but no list, lets give them the main page, with their email address # already filled in! Gosh we're resourceful, and smart #(and bad spelers) # ok, if we /have/ a list, lets make a signup form for *just* that list. # we be cool like dat. my $list_exists = 0; if($list){ #lets make sure it exists, then we'll do something about it. $list_exists = check_if_list_exists(-List=>$list,); } # ok, now /if/ it exists, we'll give it its own signup form, # else? you got it, back to the default page, mu hah hah! if($list_exists == 0){ # nope, we don't have the list. &default; exit; }elsif (($list_exists >=1) && ($email eq "")){ # hey, ok, if we don't have the email, give em the form to # fill it in, if have, both the list, well, send the stupid confirmation # email #database is opened for that list my %list_info = open_database(-List => $list, -Format => "replaced"); # abit of a hack, if the information is blank, we probably still don't have a list; #user_error(-Error => 'no_list') unless($list_info{list}); my $lh = MOJO::MailingList::Subscribers->new(-List => $list); # else show the signup form. Gosh this is alot better, than the spaghetti I had! #print header(); print(the_html(-Part => "header", -Title => "subscribe to a list", -List => $list)); print $q->p("Subscribe to $list_info{list_name}, enter your email address below:\n"); print <|
Choose a list: |
Enter your e-mail address: |
| }; require MOJO::Template::Widgets; print MOJO::Template::Widgets::list_popup_menu(); print qq{ |
|
A total of ",$found," e-mail addresses were found when searching for \"",$keyword,"\"";
print "when using ",$method," search";
}
print < Search Again:
|
$code |