MOJO::List::PlainText

- NAME List::PlainText
- DESCRIPTION
- SYNOPSIS

- to $lh->open_email_list(-Path => $path, -Type='list');
- open_list_handle(-List => $list)
- my $matches = search_email_list(-Method => $method, -Keyword=> $keyword);
- my $count = print_out_list(-List => $list);
- get_black_list_match(\@black_list, \@list);
- check_for_double_email(-Path => $path, -List => $list, -Email => $email);
- my $count = remove_from_list(-Email_List => \@array);
- my $listpath = create_bulk_sending_file(-List => $list, -ID => $message_id);
- my ($count, \%domains,\%SERVICES) = list_option_form
- my ($unique, $duplicate) = unique_and_duplicate(-New_List => \@new_list);

# NAME List::PlainText

# DESCRIPTION

This is the Plain Text version of Mojo Mail's subscriber database.

# SYNOPSIS

my $lh = List::Plaintext->new(-List => $list);

## to $lh->open_email_list(-Path => $path, -Type='list');

returns an array of all e-mail addresses for $list. It can also return only a reference you say -As_Ref => 1,

this is used mostly for the black list functions, as its painfully clear that loading up 100,000 email addreses into memory is a Bad Thing.

## open_list_handle(-List => $list)

This function will open the email list file with a handle of LIST, it also does a whole bunch of error checking, taint checking, etc, that I'm too lazy to do everytime I want a list open.

## my $matches = search_email_list(-Method => $method, -Keyword=> $keyword);

searching through emails happens here, we can search using three methods, 'domain', where we search for '.com', '.edu' etc, 'service' where we look for things like 'altavista', 'yahoo', 'hotmail' adn things like that. the results will be printed out from here, the function returns how many results have been found.

## my $count = print_out_list(-List => $list);

This function will print out a list. Thats it.

## get_black_list_match(\@black_list, \@list);

zooms through the black list and does regex matches on email addresses to see of they match.

## check_for_double_email(-Path => $path, -List => $list, -Email => $email);

checks to see if an e-mail is already in $list. returns 0 is it aint, 1 if it is.

## my $count = remove_from_list(-Email_List => \@array);

This is used to remove addesses from a list. It creates a temp file and writes only the addresses that AREN'T in the array reference. it then deletes list file and renames the temp file the list file's name. List files are named $list.list where list is the list's name, with underscores instead of spaces. The list is formatted simply as one email per line.

## my $listpath = create_bulk_sending_file(-List => $list, -ID => $message_id);

When sending list messages to the entire list, we make a temp file called $istname.list.$listid where $listname is the name of your list, and $list_id is an id number, usually made form the list, and created form the message ID if we have one. This also creates the pin number for each emal address and saves it into this file like so:

            email::pin

This can easilly be feed into either the Mail::Bulkmail module or our homebrew batch system. after the Lists are send MOJO::Mail.pm should remove this file.

This function can also pass a reference to an array of addresses that shouldn't get sent the lsit message, you could theoretically pass the black list, or for mojo_send.pl, the mail alias address you set up.

                                    -Ban => [$address_on, $address_two],

    =cut

## my ($count, \%domains,\%SERVICES) = list_option_form

this is brand new shiny backend for the 'View List' Control Panel. It does a whole bunch of things, first off, it prints each email address in an option tag, for a select box, like this:

     <option value=$email>$email</option>

It will also count how many email addresses match each 'top level domains' and 'services' these are specifies in the Config.pm file in the @DOMAINS array and the %SERVICES hash. You can also turn these off in the Config.pm by setting $SHOW_DOMAIN_TABLE, $SHOW_SERVICES_TABLE and $SHOW_EMAIL_LIST to 0, respectively.

## my ($unique, $duplicate) = unique_and_duplicate(-New_List => \@new_list);

This is used to mass add and remove email addresses from a list, it takes a array ref full of new email addresses, and see if they are already in the list.

my ($unique_ref, $duplicate_ref) = weed_out_subscribers(-List => $list,
| -Path => $FILES,
| -Type => 'list',
| -New_List => \@addresses,
| );