MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/bosweb/b1536/bcihosting.ipage.com/mail/dada/DADA/
File Upload :
Current < : /hermes/bosweb/b1536/bcihosting.ipage.com/mail/dada/DADA/Config.pm

package DADA::Config;

#----------------------------------------------------------------------------#
# This file holds default values for the global configuration variables 
# in Dada Mail. See:
#
#          http://dadamailproject.com/d/global_variables.pod.html
# 
# for more information. 
#
#----------------------------------------------------------------------------#

require Exporter;
our @ISA = qw(Exporter);
use vars     qw($PROGRAM_ROOT_PASSWORD $MAILPROG $DIR $FILES $PROGRAM_URL $S_PROGRAM_URL $PLUGIN_CONFIGS $MAIL_SETTINGS $MASS_MAIL_SETTINGS $AMAZON_SES_OPTIONS $FIRST_SUB $SEC_SUB @C $SALT $FILE_CHMOD $DIR_CHMOD $GIVE_PROPS_IN_EMAIL $GIVE_PROPS_IN_HTML $GIVE_PROPS_IN_ADMIN $GIVE_PROPS_IN_SUBSCRIBE_FORM $SUBSCRIBED_MESSAGE     $ARCHIVES $TEMPLATES $ALTERNATIVE_HTML_TEMPLATE_PATH $TMP $LOGS $BACKUPS %BACKUP_HISTORY $MONITOR_MAILOUTS_AFTER_EVERY_EXECUTION $ENFORCE_CLOSED_LOOP_OPT_IN $SUPPORT_FILES $WYSIWYG_EDITOR_OPTIONS $FILE_BROWSER_OPTIONS $SCREEN_CACHE $DATA_CACHE $GLOBAL_BLACK_LIST $GLOBAL_UNSUBSCRIBE $MULTIPLE_LIST_SENDING $MULTIPLE_LIST_SENDING_TYPE $HIDDEN_SUBSCRIBER_FIELDS_PREFIX @PING_URLS $CONFIRMATION_TOKEN_OPTIONS $SUBSCRIPTION_SUCCESSFUL_COPY $PIN_WORD $PIN_NUM $TEXT_CSV_PARAMS $ALLOW_ROOT_LOGIN  @CHARSETS @CONTENT_TYPES %LIST_SETUP_DEFAULTS %LIST_SETUP_INCLUDE %LIST_SETUP_OVERRIDES @LIST_SETUP_DONT_CLONE %PRIORITIES $ATTACHMENT_TEMPFILE $MAIL_VERP_SEPARATOR %MIME_TYPES $DEFAULT_MIME_TYPE $MIME_PARANOID $MIME_HUSH $MIME_OPTIMIZE $NPH $PROGRAM_USAGE_LOG $ROOT_PASS_IS_ENCRYPTED @ALLOWED_IP_ADDRESSES $SHOW_ADMIN_LINK $ADMIN_FLAVOR_NAME $SIGN_IN_FLAVOR_NAME $DISABLE_OUTSIDE_LOGINS %LOG $DEBUG_TRACE %CPAN_DEBUG_SETTINGS $ADMIN_MENU $EMAIL_CASE @EMAIL_EXCEPTIONS $LIST_IN_ORDER $ADMIN_TEMPLATE $USER_TEMPLATE $BACKEND_DB_TYPE $SUBSCRIBER_DB_TYPE $ARCHIVE_DB_TYPE $SETTINGS_DB_TYPE $SESSION_DB_TYPE $BOUNCE_SCORECARD_DB_TYPE $CLICKTHROUGH_DB_TYPE %SQL_PARAMS $DBI_PARAMS $PROFILE_OPTIONS $PROGRAM_ERROR_LOG $SHOW_HELP_LINKS $HELP_LINKS_URL $VER $VERSION  $PROGRAM_NAME @CONTENT_TRANSFER_ENCODINGS $CONFIG_FILE $PROGRAM_CONFIG_FILE_DIR $OS $DEFAULT_ADMIN_SCREEN $DEFAULT_LOGOUT_SCREEN $DEFAULT_SCREEN $HTML_CHARSET $SEND_ARCHIVED_MESSAGE $REFERER_CHECK $CAPTCHA_TYPE $RECAPTCHA_PARAMS $RECAPTHCA_MAILHIDE_PARAMS $GD_SECURITYIMAGE_PARAMS $LOGIN_COOKIE_NAME %COOKIE_PARAMS $HTML_TEXTTOHTML_OPTIONS $HTML_SCRUBBER_OPTIONS $TEMPLATE_SETTINGS $LOGIN_WIDGET $NULL_DEVICE $LIST_QUOTA $SUBSCRIPTION_QUOTA $MAILOUT_AT_ONCE_LIMIT $MAILOUT_STALE_AFTER %EMAIL_HEADERS @EMAIL_HEADERS_ORDER);
@EXPORT_OK = qw($PROGRAM_ROOT_PASSWORD $MAILPROG $DIR $FILES $PROGRAM_URL $S_PROGRAM_URL $PLUGIN_CONFIGS $MAIL_SETTINGS $MASS_MAIL_SETTINGS $AMAZON_SES_OPTIONS $FIRST_SUB $SEC_SUB @C $SALT $FILE_CHMOD $DIR_CHMOD $GIVE_PROPS_IN_EMAIL $GIVE_PROPS_IN_HTML $GIVE_PROPS_IN_ADMIN $GIVE_PROPS_IN_SUBSCRIBE_FORM $SUBSCRIBED_MESSAGE     $ARCHIVES $TEMPLATES $ALTERNATIVE_HTML_TEMPLATE_PATH $TMP $LOGS $BACKUPS %BACKUP_HISTORY $MONITOR_MAILOUTS_AFTER_EVERY_EXECUTION $ENFORCE_CLOSED_LOOP_OPT_IN $SUPPORT_FILES $WYSIWYG_EDITOR_OPTIONS $FILE_BROWSER_OPTIONS $SCREEN_CACHE $DATA_CACHE $GLOBAL_BLACK_LIST $GLOBAL_UNSUBSCRIBE $MULTIPLE_LIST_SENDING $MULTIPLE_LIST_SENDING_TYPE $HIDDEN_SUBSCRIBER_FIELDS_PREFIX @PING_URLS $CONFIRMATION_TOKEN_OPTIONS $SUBSCRIPTION_SUCCESSFUL_COPY $PIN_WORD $PIN_NUM $TEXT_CSV_PARAMS $ALLOW_ROOT_LOGIN  @CHARSETS @CONTENT_TYPES %LIST_SETUP_DEFAULTS %LIST_SETUP_INCLUDE %LIST_SETUP_OVERRIDES @LIST_SETUP_DONT_CLONE %PRIORITIES $ATTACHMENT_TEMPFILE $MAIL_VERP_SEPARATOR %MIME_TYPES $DEFAULT_MIME_TYPE $MIME_PARANOID $MIME_HUSH $MIME_OPTIMIZE $NPH $PROGRAM_USAGE_LOG $ROOT_PASS_IS_ENCRYPTED @ALLOWED_IP_ADDRESSES $SHOW_ADMIN_LINK $ADMIN_FLAVOR_NAME $SIGN_IN_FLAVOR_NAME $DISABLE_OUTSIDE_LOGINS %LOG $DEBUG_TRACE %CPAN_DEBUG_SETTINGS $ADMIN_MENU $EMAIL_CASE @EMAIL_EXCEPTIONS $LIST_IN_ORDER $ADMIN_TEMPLATE $USER_TEMPLATE $BACKEND_DB_TYPE $SUBSCRIBER_DB_TYPE $ARCHIVE_DB_TYPE $SETTINGS_DB_TYPE $SESSION_DB_TYPE $BOUNCE_SCORECARD_DB_TYPE $CLICKTHROUGH_DB_TYPE %SQL_PARAMS $DBI_PARAMS $PROFILE_OPTIONS $PROGRAM_ERROR_LOG $SHOW_HELP_LINKS $HELP_LINKS_URL $VER $VERSION  $PROGRAM_NAME @CONTENT_TRANSFER_ENCODINGS $CONFIG_FILE $PROGRAM_CONFIG_FILE_DIR $OS $DEFAULT_ADMIN_SCREEN $DEFAULT_LOGOUT_SCREEN $DEFAULT_SCREEN $HTML_CHARSET $SEND_ARCHIVED_MESSAGE $REFERER_CHECK $CAPTCHA_TYPE $RECAPTCHA_PARAMS $RECAPTHCA_MAILHIDE_PARAMS $GD_SECURITYIMAGE_PARAMS $LOGIN_COOKIE_NAME %COOKIE_PARAMS $HTML_TEXTTOHTML_OPTIONS $HTML_SCRUBBER_OPTIONS $TEMPLATE_SETTINGS $LOGIN_WIDGET $NULL_DEVICE $LIST_QUOTA $SUBSCRIPTION_QUOTA $MAILOUT_AT_ONCE_LIMIT $MAILOUT_STALE_AFTER %EMAIL_HEADERS @EMAIL_HEADERS_ORDER);

#
#
#
#

$PROGRAM_CONFIG_FILE_DIR = '/hermes/bosnaweb03b/b2159/ipg.bcihosting/mail/.dada_files/.configs';

#
#
#
#
#

#--------------------------------#
# Leave the below line, alone!
_config_import(); #  Leave alone!
# Leave the above line, alone!
#--------------------------------#

BEGIN {




#
#
#
#
#

$PROGRAM_ERROR_LOG = '/hermes/bosnaweb03b/b2159/ipg.bcihosting/mail/.dada_files/.logs/errors.txt';

#
#
#
#
#

    # Keep this next bit as-is; it's just opening the error file for writing.
    if ($PROGRAM_ERROR_LOG) {
        open( STDERR, ">>$PROGRAM_ERROR_LOG" )
          || warn
"$PROGRAM_NAME Error: Cannot redirect STDERR, it's possible that Dada Mail does not have write permissions to this file ($PROGRAM_ERROR_LOG) or it doesn't exist! If Dada Mail cannot make this file for you, create it yourself and give it enough permissions so it may write to it: $!";
    }

    # chmod(0777, $PROGRAM_ERROR_LOG);
}




$PROGRAM_ROOT_PASSWORD  ||= 'root_password';
$ROOT_PASS_IS_ENCRYPTED ||= 0;




($DIR) ||= $PROGRAM_CONFIG_FILE_DIR =~ m/^(.*?)\/\.configs$/;
$ARCHIVES          ||= $DIR . '/.archives';
$BACKUPS           ||= $DIR . '/.backups';
$FILES             ||= $DIR . '/.lists';
$LOGS              ||= $DIR . '/.logs';
$PROGRAM_USAGE_LOG ||= $LOGS . '/dada.txt';
$TEMPLATES         ||= $DIR . '/.templates';
$TMP               ||= $DIR . '/.tmp';




$PROGRAM_URL   ||= 'http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi';
$S_PROGRAM_URL ||= $PROGRAM_URL;




$SUPPORT_FILES ||= {
    dir => '',
    url => '',
};

$WYSIWYG_EDITOR_OPTIONS ||= {
    ckeditor => {
        enabled => 0,
        url     => '',
    },
    tiny_mce => {
        enabled => 0,
        url     => '',
    },
};

$FILE_BROWSER_OPTIONS ||= {
    kcfinder => {
        enabled      => 0,
        url          => '',
        upload_dir   => '',
        upload_url   => '',
        session_name => 'PHPSESSID',
        session_dir  => '/tmp',
    },
	core5_filemanager  => { 
		enabled      => 0, 
		url          => '', 
		upload_dir   => '', 
		upload_url   => '',
		connector    => '', 
	},
};





# Here are the four variables that are talked about, above:
$BACKEND_DB_TYPE ||= 'Default';

if ( $BACKEND_DB_TYPE eq 'Default' ) {
    $SUBSCRIBER_DB_TYPE       ||= 'PlainText';
    $ARCHIVE_DB_TYPE          ||= 'Db';
    $SETTINGS_DB_TYPE         ||= 'Db';
    $SESSION_DB_TYPE          ||= 'Db';
    $BOUNCE_SCORECARD_DB_TYPE ||= 'Db';
    $CLICKTHROUGH_DB_TYPE     ||= 'Db';
}
elsif ( $BACKEND_DB_TYPE eq 'SQL' ) {
    $SUBSCRIBER_DB_TYPE       ||= 'SQL';
    $ARCHIVE_DB_TYPE          ||= 'SQL';
    $SETTINGS_DB_TYPE         ||= 'SQL';
    $SESSION_DB_TYPE          ||= 'SQL';
    $BOUNCE_SCORECARD_DB_TYPE ||= 'SQL';
    $CLICKTHROUGH_DB_TYPE     ||= 'SQL';
}




%SQL_PARAMS = (

    # May just be, "localhost"
    dbserver => 'localhost',

    database => '',

    # MySQL:      3306
    # PostgreSQL: 5432
    port => '3306',

    # MySQL:      mysql
    # PostgreSQL: Pg
    # SQLite:     SQLite
    dbtype => 'mysql',

    user => '',
    pass => '',

) unless keys %SQL_PARAMS;




$DBI_PARAMS ||= {

    InactiveDestroy      => 0,
    pg_server_prepare    => 0,
    mysql_auto_reconnect => 1,

# this only works if you have autocommit => 1 ? (or is it, AutoCommit)
# This would probably be fine, since we don't commit, anyways, but
# will be problematic, if we ever put in transaction support. Hmm...
# But wait, there's more :
#TRANSACTION SUPPORT ^
#
#Beginning with DBD::mysql 2.0416, transactions are supported. The transaction support works as follows:
#
#   * By default AutoCommit mode is on, following the DBI specifications.

    dada_connection_method => 'connect_cached',

    # UTF-8

    # MySQL specific attribute:
    #
    mysql_enable_utf8 => 1,

    #
    # You will also need to ensure that your database / table / column is
    # configured to use UTF8. See Chapter 10 of the mysql manual for details.

    # DBD::Pg specific attribute. If true, then the utf8 flag will be turned on
    # for returned character data (if the data is valid UTF-8). For details
    # about the utf8 flag, see the Encode module. This attribute is only
    # relevant under perl 5.8 and later.
    #
    pg_enable_utf8 => 1,

    # SQLite
    # If set to a true value, DBD::SQLite will turn the UTF-8 flag on for all
    # text strings coming out of the database (this feature is currently
    # disabled for perl < 5.8.5). For more details on the UTF-8 flag see
    # perlunicode. The default is for the UTF-8 flag to be turned off.
    #
    sqlite_unicode => 1,

};




$PROFILE_OPTIONS ||= {

    enabled                         => 1,
    profile_email                   => '',
    enable_captcha                  => 1,
    enable_magic_subscription_forms => 1,

    update_email_options => {
        send_notification_to_profile_email => 0,
        subscription_check_skip            => 'auto',
    },

    gravatar_options => {
        enable_gravators     => 1,
        default_gravatar_url => undef,
    },

    features => {
        login                      => 1,
        register                   => 1,
        password_reset             => 1,
        profile_fields             => 1,
        mailing_list_subscriptions => 1,
        protected_directories      => 1,
        update_email_address       => 1,
        change_password            => 1,
        delete_profile             => 0,
    },
    cookie_params => {
        -name    => 'dada_profile',
        -path    => '/',
        -expires => '+1y',
    },

};




$PLUGIN_CONFIGS ||= { 

	Bounce_Handler => {
		Server                      => undef,
		Username                    => undef,
		Password                    => undef,
		Port                        => undef,
		USESSL                      => undef,
		AUTH_MODE                   => undef,
		Plugin_Name                 => undef,
		Plugin_URL                  => undef,
		Allow_Manual_Run            => undef,
		Manual_Run_Passcode         => undef,
		Enable_POP3_File_Locking    => undef, 
		Log                         => undef,
		MessagesAtOnce              => undef,
		Max_Size_Of_Any_Message     => undef,
		Rules                       => undef,

	},

	Beatitude => {

		Plugin_Name                 => undef,
		Plugin_URL                  => undef,
		Allow_Manual_Run            => undef,
		Manual_Run_Passcode         => undef,
		Log                         => undef,

	},
	
	Bridge => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,
		Allow_Manual_Run                    => undef,
		Manual_Run_Passcode                 => undef,
		MessagesAtOnce                      => undef,
		Soft_Max_Size_Of_Any_Message        => undef,
		Max_Size_Of_Any_Message             => undef,
		Allow_Open_Discussion_List          => undef,
		Room_For_One_More_Check             => undef,
		Enable_POP3_File_Locking            => undef,
		Check_List_Owner_Return_Path_Header => undef,
		Check_Multiple_Return_Path_Headers  => undef,

    },

	Tracker => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,
		Geo_IP_Db                           => undef,
		
	},

	Mailing_Monitor => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,
		Allow_Manual_Run                    => undef,
		Manual_Run_Passcode                 => undef,

	},

    log_viewer => {	

		Plugin_URL                          => undef,
		tail_command                        => undef,

	},

	default_mass_mailing_messages => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,

	},

	password_protect_directories => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,
		Allow_Manual_Run                    => undef,
		Manual_Run_Passcode                 => undef,
		Base_Absolute_Path                  => undef, 
		Base_URL                            => undef, 

	},

    blog_index => {

		Default_List                        => undef,
		Entries                             => undef,
		Style                               => undef,
		Allow_QS_Overrides                  => undef,

	}, 

	multiple_subscribe => {

		Plugin_Name                         => undef,
		Plugin_URL                          => undef,

	},

	Global_Config => {

		Plugin_Name                         => undef,

	},

};



$MAILPROG           ||= '/usr/sbin/sendmail';
$MAIL_SETTINGS      ||= "|$MAILPROG -t";
$MASS_MAIL_SETTINGS ||= "|$MAILPROG -t";


$AMAZON_SES_OPTIONS ||= { 
    AWS_endpoint                     => undef,
	AWSAccessKeyId                   => undef,
	AWSSecretKey                     => undef,
	Allowed_Sending_Quota_Percentage => 90,
};
$MANDRILL_OPTIONS ||= { 
    api_url => 'https://mandrillapp.com/api/1.0/users/info.json', 
    api_key => undef, 
    Allowed_Sending_Quota_Percentage => 90,
};

$SHOW_ADMIN_LINK        ||= 1;
$ADMIN_FLAVOR_NAME      ||= 'admin';
$SIGN_IN_FLAVOR_NAME    ||= 'sign_in';
$DEFAULT_SCREEN         ||= '';
$DEFAULT_ADMIN_SCREEN   ||= $S_PROGRAM_URL . '?f=send_email';
$DEFAULT_LOGOUT_SCREEN  ||= $S_PROGRAM_URL . '?f=' . $ADMIN_FLAVOR_NAME;
$DISABLE_OUTSIDE_LOGINS ||= 0;
$LOGIN_WIDGET           ||= 'popup_menu';
$ALLOW_ROOT_LOGIN       ||= 1;
$REFERER_CHECK          ||= 0;
@ALLOWED_IP_ADDRESSES = qw()
  unless scalar @ALLOWED_IP_ADDRESSES;



# Set to Either, "Default" or, "reCAPTCHA";
$CAPTCHA_TYPE ||= 'Default';
$GD_SECURITYIMAGE_PARAMS ||= {
    'rand_string_from' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZaeiouy',
    'rand_string_size' => 6,
    'new' => {
        width  => 250,
        height => 125,
        lines  => 10,
        #gd_font    => 'Giant',
        send_ctobg => 1,
        # There's some magic here,
        # If the font is located in the,
        # dada/templates directory,
        # You don't have to put the absolute path,
        # just the filename.
        font    => 'StayPuft.ttf',
        bgcolor => "#CCFFCC",
        angle   => 13,
        ptsize  => 30,
    },
    create => {
        ttf => 'circle',
        # normal => 'circle',
    },
    particle => [ 500, undef ],
};
$RECAPTCHA_PARAMS ||= {
    remote_address => $ENV{'REMOTE_ADDR'},
    public_key     => undef,
    private_key    => undef,
};
$RECAPTHCA_MAILHIDE_PARAMS ||= {
    public_key  => '',
    private_key => '',
};



$SHOW_HELP_LINKS ||= 1;
$HELP_LINKS_URL  ||= 'http://dadamailproject.com/pro_dada/7.4.0';


$LOGIN_COOKIE_NAME ||= 'dadalogin';

%COOKIE_PARAMS = (
    -path    => '/',
    -expires => '+7d',
) unless keys %COOKIE_PARAMS;


$NPH ||= 0;





%LOG = (
    subscriptions        => 1,
    mailings             => 0,
    mass_mailings        => 1,
    mass_mailing_batches => 1,
    logins               => 1,
    list_lives           => 1,

) unless keys %LOG;




$DEBUG_TRACE ||= {

    DADA_App_BounceHandler             => 0,
    DADA_App_DBIHandle                 => 0,
    DADA_App_Digests                   => 0, 
    DADA_App_FormatMessages            => 0,
    DADA_App_Subscriptions             => 0,
    DADA_Logging_Clickthrough          => 0,
    DADA_Mail_MailOut                  => 0,
    DADA_Mail_Send                     => 0,
    DADA_MailingList                   => 0,
	DADA_MailingList_MessageDrafts     => 0, 
    DADA_Profile                       => 0,
    DADA_Profile_Fields                => 0,
    DADA_Profile_Session               => 0,

};

%CPAN_DEBUG_SETTINGS = (

    # DBI, handles all SQL database calls.
    # More Information:
    # http://search.cpan.org/~timb/DBI/DBI.pm#TRACING
    # As noted in these docs, you can set the trace level as far 15

    DBI => 0,

    # HTML::Template, used for generating HTML screens
    # More information:
    # http://search.cpan.org/~samtregar/HTML-Template/Template.pm

    HTML_TEMPLATE => 0,

    # MIME::Lite::HTML, used for the, "Send a Webpage" screen
    # More information:
    # http://search.cpan.org/~alian/MIME-Lite-HTML/HTML.pm

    MIME_LITE_HTML => 0,

    #  Net::POP3, used for checking awaiting messages on a POP3 Server
    #  More Information:
    #  http://search.cpan.org/~gbarr/libnet/Net/POP3.pm
    #  NET_POP3 => 0,

    # http://search.cpan.org/~sdowd/Mail-POP3Client/POP3Client.pm
    MAIL_POP3CLIENT => 0,

    # Net::SMTP, used for sending messages via SMTP:
    # more information:
    # http://search.cpan.org/~gbarr/libnet/Net/SMTP.pm

    NET_SMTP => 0,

) unless keys %CPAN_DEBUG_SETTINGS;

$ADMIN_TEMPLATE                 ||= '';
$USER_TEMPLATE                  ||= '';
$ALTERNATIVE_HTML_TEMPLATE_PATH ||= undef;
$TEMPLATE_SETTINGS              ||= {
    engine                           => 'Best',
};



%BACKUP_HISTORY = (
    settings  => 3,
    archives  => 3,
    schedules => 3,
) unless keys %BACKUP_HISTORY;


$MONITOR_MAILOUTS_AFTER_EVERY_EXECUTION ||= 0;
$ENFORCE_CLOSED_LOOP_OPT_IN             ||= 0;
$MULTIPLE_LIST_SENDING                  ||= 0;
$MULTIPLE_LIST_SENDING_TYPE             ||= 'merged';    # individual
$GLOBAL_BLACK_LIST                      ||= 0;
$GLOBAL_UNSUBSCRIBE                     ||= 0;
$HIDDEN_SUBSCRIBER_FIELDS_PREFIX        ||= '_';

$SCREEN_CACHE                           ||= 1;
$DATA_CACHE                             ||= 1;

@PING_URLS = qw(
  http://rpc.pingomatic.com/
  http://rpc.weblogs.com/RPC2
  http://ping.blo.gs/
  ) unless scalar @PING_URLS;


$CONFIRMATION_TOKEN_OPTIONS ||= { 
	expires => 60,
};


# If you do put the $ADMIN_MENU variable in the outside config file,
# make sure to also! put the below line (uncommented):
#
#  $S_PROGRAM_URL = $PROGRAM_URL
#
# Before the $ADMIN_URL variable, as well as the below 5 lines of code:

$S_PROGRAM_URL = $PROGRAM_URL;
my $PLUGIN_URL = $S_PROGRAM_URL;
   $PLUGIN_URL =~ s/\/(\w+)\.(cgi|pl)$/\//;
   $PLUGIN_URL .= 'plugins';
my $EXT_URL     = $PLUGIN_URL;
   $EXT_URL     =~ s/plugins/extensions/;

$ADMIN_MENU ||= [

    {
        -Title     => 'Mass Mailing',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'Send a Message',
                -Title_URL => "$S_PROGRAM_URL?f=send_email",
                -Function  => 'send_email',
                -Activated => 1,
            },

            {
                -Title     => 'Send a Webpage',
                -Title_URL => "$S_PROGRAM_URL?f=send_url_email",
                -Function  => 'send_url_email',
                -Activated => 1,
            },

            {
                -Title     => 'Drafts/Stationary/Schedules',
                -Title_URL => "$S_PROGRAM_URL?f=drafts",
                -Function  => 'drafts',
                -Activated => 1,
            },

            {
                -Title => 'Monitor Your Mailings',
                -Title_URL => "$S_PROGRAM_URL?f=sending_monitor",
                -Function  => 'sending_monitor',
                -Activated => 1,
            },

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=mass_mailing_options",
                -Function  => 'mass_mailing_options',
                -Activated => 1,
            },

        ]
    },

    {
        -Title     => 'Membership',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'View',
                -Title_URL => "$S_PROGRAM_URL?f=view_list",
                -Function  => 'view_list',
                -Activated => 1,
            },

            {
                -Title     => 'Recent Activity',
                -Title_URL => "$S_PROGRAM_URL?f=list_activity",
                -Function  => 'list_activity',
                -Activated => 1,
            },

            {
                -Title => 'Invite<!-- tmpl_if expr="((list_settings.enable_mass_subscribe == 1) && ((root_login == 1) || (list_settings.enable_mass_subscribe_only_w_root_login != 1)))" --> /Subscribe<!-- /tmpl_if -->/Add',
                -Title_URL => "$S_PROGRAM_URL?f=add",
                -Function  => 'add',
                -Activated => 1,
            },

            {
                -Title     => 'Remove',
                -Title_URL => "$S_PROGRAM_URL?f=delete_email",
                -Function  => 'delete_email',
                -Activated => 1,
            },

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=subscription_options",
                -Function  => 'subscription_options',
                -Activated => 0,
            },
        ]
    },

    {
        -Title     => 'Your Mailing List',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'List Information',
                -Title_URL => "$S_PROGRAM_URL?f=change_info",
                -Function  => 'change_info',
                -Activated => 1,
            },

            {
                -Title     => 'List Password',
                -Title_URL => "$S_PROGRAM_URL?f=change_password",
                -Function  => 'change_password',
                -Activated => 1,
            },

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=list_options",
                -Function  => 'list_options',
                -Activated => 0,
            },

            {
                -Title     => 'Web Services API',
                -Title_URL => "$S_PROGRAM_URL?f=web_services",
                -Function  => 'web_services',
                -Activated => 1,
            },


            {
                -Title     => 'Delete This Mailing List',
                -Title_URL => "$S_PROGRAM_URL?f=delete_list",
                -Function  => 'delete_list',
                -Activated => 0,
            },
        ]
    },

    {
        -Title     => 'Mail Sending',
        -Activated => 1,
        -Submenu   => [

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=sending_preferences",
                -Function  => 'sending_preferences',
                -Activated => 1,
            },

            {
                -Title     => 'Advanced Options',
                -Title_URL => "$S_PROGRAM_URL?f=adv_sending_preferences",
                -Function  => 'adv_sending_preferences',
                -Activated => 1,
            },
            {
                -Title     => 'Mass Mailing Options',
                -Title_URL => "$S_PROGRAM_URL?f=mass_mailing_preferences",
                -Function  => 'mass_mailing_preferences',
                -Activated => 1,
            },
        ]
    },

    {
        -Title     => 'Message Archives',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'View',
                -Title_URL => "$S_PROGRAM_URL?f=view_archive",
                -Function  => 'view_archive',
                -Activated => 1,
            },

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=archive_options",
                -Function  => 'archive_options',
                -Activated => 1,
            },

            {
                -Title     => 'Advanced Options',
                -Title_URL => "$S_PROGRAM_URL?f=adv_archive_options",
                -Function  => 'adv_archive_options',
                -Activated => 1,
            },
        ]
    },

    {
        -Title     => 'Appearance and Templates',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'Your Mailing List Template',
                -Title_URL => "$S_PROGRAM_URL?f=edit_template",
                -Function  => 'edit_template',
                -Activated => 1,
            },

            {
                -Title     => 'Email Message Templates',
                -Title_URL => "$S_PROGRAM_URL?f=edit_type",
                -Function  => 'edit_type',
                -Activated => 1,
            },

            {
                -Title     => 'HTML Screen Templates',
                -Title_URL => "$S_PROGRAM_URL?f=edit_html_type",
                -Function  => 'edit_html_type',
                -Activated => 1,
            },

            {
                -Title     => 'Subscription Form HTML',
                -Title_URL => "$S_PROGRAM_URL?f=html_code",
                -Function  => 'html_code',
                -Activated => 1,
            },

            {
                -Title     => 'Create a Back Link',
                -Title_URL => "$S_PROGRAM_URL?f=back_link",
                -Function  => 'back_link',
                -Activated => 1,
            },

        ]
    },

    {
        -Title     => 'Profiles',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'Profile Fields',
                -Title_URL => "$S_PROGRAM_URL?f=profile_fields",
                -Function  => 'profile_fields',
                -Activated => 1,
            },
        ]
    },
    {
        -Title     => 'Plugins',
        -Activated => 1,
        -Submenu   => [

            #					# These are plugins. Make sure you install them
            #					# if you want to use them!

            #					{
            #					-Title      => 'Mailing Monitor',
            #					-Title_URL  => $PLUGIN_URL."/mailing_monitor.cgi",
            #					-Function   => 'mailing_monitor',
            #					-Activated  => 0,
            #					},

            #					{
            #					-Title      => 'Tracker',
            #					-Title_URL  => $PLUGIN_URL."/tracker.cgi",
            #					-Function   => 'tracker',
            #					-Activated  => 1,
            #					},

            #					{
            #					-Title      => 'Bounce Handler',
            #					-Title_URL  => $PLUGIN_URL."/bounce_handler.cgi",
            #					-Function   => 'bounce_handler',
            #					-Activated  => 1,
            #					},

            #					{
            #					-Title      => 'Bridge',
            #					-Title_URL  => $PLUGIN_URL."/bridge.cgi",
            #					-Function   => 'bridge',
            #					-Activated  => 1,
            #					},

            #					{
            #					-Title      => 'Scheduled Mailings',
            #					-Title_URL  => $PLUGIN_URL."/scheduled_mailings.pl",
            #					-Function   => 'scheduled_mailings',
            #					-Activated  => 1,
            #					},

            #					{
            #					-Title      => 'Change the Program Root Password',
            #					-Title_URL  => $PLUGIN_URL."/change_root_password.cgi",
            #					-Function   => 'change_root_password',
            #					-Activated  => 0,
            #					},

            #					{
            #					-Title      => 'Change Your List Short Name',
            #					-Title_URL  => $PLUGIN_URL."/change_list_shortname.cgi",
            #					-Function   => 'change_list_shortname',
            #					-Activated  => 0,
            #					},

          #					{
          #					-Title      => 'Default Mass Mailing Messages',
          #					-Title_URL  => $PLUGIN_URL."/default_mass_mailing_messages.cgi",
          #					-Function   => 'default_mass_mailing_messages',
          #					-Activated  => 1,
          #					},

           #					{
           #					-Title      => 'Password Protect Directories',
           #					-Title_URL  => $PLUGIN_URL."/password_protect_directories.cgi",
           #					-Function   => 'password_protect_directories',
           #					-Activated  => 1,
           #					},

            #					{
            #					-Title      => 'View Logs',
            #					-Title_URL  => $PLUGIN_URL."/log_viewer.cgi",
            #					-Function   => 'log_viewer',
            #					-Activated  => 1,
            #					},


            #					{
            #					-Title      => 'Screen Cache',
            #					-Title_URL  => $PLUGIN_URL."/screen_cache.cgi",
            #					-Function   => 'screen_cache',
            #					-Activated  => 0,
            #					},

			#					{
			#					-Title      => 'Global Configuration',
			#					-Title_URL  => $PLUGIN_URL."/global_config.cgi",
			#					-Function   => 'global_config',
			#					-Activated  => 0,
			#					},

            #					{
            #					-Title      => 'Boilerplate Example',
            #					-Title_URL  => $PLUGIN_URL."/boilerplate_plugin.cgi",
            #					-Function   => 'boilerplate',
            #					-Activated  => 1,
            #					},


            #					{
            #					-Title      => 'View List Settings',
            #					-Title_URL  => $PLUGIN_URL."/view_list_settings.cgi",
            #					-Function   => 'view_list_settings',
            #					-Activated  => 1,
            #					},





        ],
    },

    # Shortcut to the Extensions. Make sure you install them
    # if you want to use them!

    {
        -Title     => 'Extensions',
        -Activated => 1,
        -Submenu   => [

            #					{
            #					-Title      => 'Multiple Subscribe',
            #					-Title_URL  => $EXT_URL."/multiple_subscribe.cgi",
            #					-Function   => 'multiple_subscribe',
            #					-Activated  => 1,
            #					},

            #					{
            #					-Title      => 'Archive Blog Index',
            #					-Title_URL  => $EXT_URL."/blog_index.cgi?mode=html&list=<!-- tmpl_var list_settings.list -->",
            #					-Function   => 'blog_index',
            #					-Activated  => 1,
            #					},

        ],
    },

    {
        -Title     => 'Your List Control Panel',
        -Activated => 0,
        -Submenu   => [
            {
                -Title     => 'Customize Feature Set',
                -Title_URL => "$S_PROGRAM_URL?f=feature_set",
                -Function  => 'feature_set',
                -Activated => 0,
            },

            {
                -Title     => 'Options',
                -Title_URL => "$S_PROGRAM_URL?f=list_cp_options",
                -Function  => 'list_cp_options',
                -Activated => 0,
            }
        ],
    },

    {
        -Title     => 'App Information',
        -Activated => 1,
        -Submenu   => [
            {
                -Title     => 'Configuration',
                -Title_URL => "$S_PROGRAM_URL?f=setup_info",
                -Function  => 'setup_info',
                -Activated => 1,
            },

            {
                -Title     => 'About Dada Mail',
                -Title_URL => "$S_PROGRAM_URL?f=manage_script",
                -Function  => 'manage_script',
                -Activated => 1,
            },

        ],
    },
];

$LIST_QUOTA ||= 3;
$SUBSCRIPTION_QUOTA ||= 1000;
$MAILOUT_AT_ONCE_LIMIT ||= 1;
$MAILOUT_STALE_AFTER   ||= 86400;

$EMAIL_CASE ||= 'lc_all';

@EMAIL_EXCEPTIONS = qw()
  unless scalar @EMAIL_EXCEPTIONS;

$LIST_IN_ORDER ||= 0;

$FILE_CHMOD ||= 0666;
$DIR_CHMOD  ||= 0755;

$HTML_CHARSET ||= 'UTF-8';

# http://www.w3.org/International/O-charset.html
# http://www.w3.org/International/O-HTTP-charset

@CHARSETS = (
    'UTF-8	UTF-8',
    'Afrikaans (af)	 iso-8859-1',
    'Afrikaans (af)	windows-1252',
    'Albanian (sq)	 iso-8859-1',
    'Albanian (sq)	 windows-1252',
    'Arabic (ar)	iso-8859-6',
    'Basque (eu)	iso-8859-1',
    'Basque (eu)	windows-1252',
    'Bulgarian (bg)	 iso-8859-5',
    'Byelorussian (be)	 iso-8859-5',
    'Catalan (ca)	iso-8859-1',
    'Catalan (ca)	windows-1252',
    'Croatian (hr)	 iso-8859-2',
    'Czech (cs)	 iso-8859-2',
    'Danish (da)	iso-8859-1',
    'Danish (da)	windows-1252',
    'Dutch (nl)	 iso-8859-1',
    'Dutch (nl)	 windows-1252',
    'English (en)	iso-8859-1',
    'English (en)	windows-1252',
    'Esperanto (eo)	 iso-8859-3',
    'Estonian (et)	 iso-8859-15',
    'Faroese (fo)	iso-8859-1',
    'Faroese (fo)	windows-1252',
    'Finnish (fi)	iso-8859-1',
    'Finnish (fi)	windows-1252',
    'French (fr)	iso-8859-1',
    'French (fr)	windows-1252',
    'Galician (gl)	 iso-8859-1',
    'Galician (gl)	 windows-1252',
    'German (de)	iso-8859-1',
    'German (de)	windows-1252',
    'Greek (el)	 iso-8859-7',
    'Hebrew (iw)	iso-8859-8',
    'Hungarian (hu)	 iso-8859-2',
    'Icelandic (is)	 iso-8859-1',
    'Icelandic (is)	 windows-1252',
    'Inuit (Eskimo)	 iso-8859-10',
    'Irish (ga)	 iso-8859-1',
    'Irish (ga)	 windows-1252',
    'Italian (it)	iso-8859-1',
    'Italian (it)	windows-1252',
    'Japanese (ja)	 shift_jis',
    'Japanese (ja)	iso-2022-jp',
    'Japanese (ja)	 euc-jp',
    'Lapp()	iso-8859-10',
    'Latvian (lv)	iso-8859-13',
    'Latvian (lv)	windows-1257',
    'Lithuanian (lt)	iso-8859-13',
    'Lithuanian (lt)	windows-1257',
    'Macedonian (mk)	iso-8859-5',
    'Maltese (mt)	iso-8859-3',
    'Norwegian (no)	 iso-8859-1',
    'Norwegian (no)	 windows-1252',
    'Polish (pl)	iso-8859-2',
    'Portuguese (pt)	iso-8859-1',
    'Portuguese (pt)	windows-1252',
    'Romanian (ro)	 iso-8859-2',
    'Russian (ru)	koi8-r',
    'Russian (ru)	iso-8859-5',
    'Scottish (gd)	 iso-8859-1',
    'Scottish (gd)	 windows-1252',
    'Serbian (sr)	iso-8859-5',
    'Slovak (sk)	iso-8859-2',
    'Slovenian (sl)	 iso-8859-2',
    'Spanish (es)	iso-8859-1',
    'Spanish (es)	windows-1252',
    'Swedish (sv)	iso-8859-1',
    'Swedish (sv)	windows-1252',
    'Thai (th)	windows-874',
    'Turkish (tr)	iso-8859-9',
    'Turkish (tr)	windows-1254',
    'Ukrainian (uk)	 iso-8859-5'
) unless scalar @CHARSETS;

@CONTENT_TYPES = qw(
  text/plain
  text/html
  ) unless scalar @CONTENT_TYPES;

%PRIORITIES = (
    'none' => 'Do not set a, "X-Priority" Header.',
    5      => 'lowest',
    4      => 'low',
    3      => 'normal',
    2      => 'high',
    1      => 'highest',
) unless keys %PRIORITIES;

@CONTENT_TRANSFER_ENCODINGS = qw(
  7bit
  8bit
  quoted-printable
  base64
  binary
  ) unless scalar @CONTENT_TRANSFER_ENCODINGS;

$HTML_TEXTTOHTML_OPTIONS ||= {
    escape_HTML_chars => 0,    # This will also be overridden to, 0 by Dada Mail
                               # BUT! Dada Mail will provide it's own
                               # escape_HTML_chars-like routine

};

$HTML_SCRUBBER_OPTIONS ||= {
    rules   => [ script => 0, ],
    default => [
        1 => {
            '*' => 1,          # default rule, allow all attributes
            'href'     => qr{^(?!(?:java)?script)}i,
            'src'      => qr{^(?!(?:java)?script)}i,
            'cite'     => '(?i-xsm:^(?!(?:java)?script))',
            'language' => 0,
            'name'        => 1,    # could be sneaky, but hey ;)
            'onblur'      => 0,
            'onchange'    => 0,
            'onclick'     => 0,
            'ondblclick'  => 0,
            'onerror'     => 0,
            'onfocus'     => 0,
            'onkeydown'   => 0,
            'onkeypress'  => 0,
            'onkeyup'     => 0,
            'onload'      => 0,
            'onmousedown' => 0,
            'onmousemove' => 0,
            'onmouseout'  => 0,
            'onmouseover' => 0,
            'onmouseup'   => 0,
            'onreset'     => 0,
            'onselect'    => 0,
            'onsubmit'    => 0,
            'onunload'    => 0,

            #'src'        => 0, # borks images?
            'type' => 0,
        },
    ],
    deny => [
        qw(
          embed
          object
          frame
          iframe
          meta
          )
    ],
    comment => 1,
    process => 0,
};


%MIME_TYPES = (
    '.gif'  => 'image/gif',
    '.jpg'  => 'image/jpg',
    '.png'  => 'image/png',
    '.jpeg' => 'image/jpeg',

    '.pdf' => 'application/pdf',
    '.psd' => 'application/psd',

    '.html' => 'text/html',
    '.txt'  => 'text/plain',

    '.doc' => 'application/msword',
    '.xls' => 'application/x-msexcel',
    '.ppt' => 'application/x-mspowerpoint',

    '.mp3' => 'application/octet-stream',
    '.mov' => 'video/quicktime',

) unless keys %MIME_TYPES;

$DEFAULT_MIME_TYPE ||= 'application/octet-stream';
$MIME_PARANOID     ||= 0;
$MIME_HUSH         ||= 0;
$MIME_OPTIMIZE     ||= 'no tmp files';

%LIST_SETUP_DEFAULTS = (

    # Your Mailing List >> List Information
    
    list             => '',    # don't default...
    list_name        => '',
    list_owner_email => '',
    admin_email      => undef,
    info             => '',    
    privacy_policy   => '',
    physical_address => '',
        # (Dummy)
        list_info => undef,

    # Your Mailing List >> List Password
    password         => '',      # you'll need to encrypt it to use this...
    cipher_key       => undef,

    # Your Mailing List >> Options
    private_list     => 0,
    
    #mailing list options
    mx_check         => 0,
    closed_list      => 0,
    invite_only_list => 0,
    show_hidden      => 0,
    hide_list        => 0,
    
    

    # Mass Mailing Options
    mass_mailing_convert_plaintext_to_html => 0,
    mass_mailing_block_css_to_inline_css   => 0,

    #quotas
    use_subscription_quota => 0,
    subscription_quota     => 0,

    
    email_your_subscribed_msg        => 1,    # Notice the incorrect, "your" instead of, "you're" - doh!
    email_you_are_not_subscribed_msg => 0,

    send_unsub_success_email => 1,
    send_sub_success_email   => 1,

    get_sub_notice              => 1,
    send_subscription_notice_to => 'list_owner',

    unsub_show_email_hint         => 1,
    get_unsub_notice              => 1,
    send_unsubscription_notice_to => 'list_owner',

    enable_closed_loop_opt_in     => 1,    # Closed-Loop Opt-In
    skip_sub_confirm_if_logged_in => 0,

    limit_sub_confirm             => 1,
    limit_sub_confirm_use_captcha => 1,

    use_alt_url_sub_confirm_success  => 0,
    alt_url_sub_confirm_success_w_qs => 0,
    alt_url_sub_confirm_success      => '',

    use_alt_url_sub_confirm_failed  => 0,
    alt_url_sub_confirm_failed_w_qs => 0,
    alt_url_sub_confirm_failed      => '',

    use_alt_url_sub_success  => 0,
    alt_url_sub_success_w_qs => 0,
    alt_url_sub_success      => '',

    use_alt_url_sub_failed  => 0,
    alt_url_sub_failed_w_qs => 0,
    alt_url_sub_failed      => '',

    use_alt_url_unsub_success  => 0,
    alt_url_unsub_success_w_qs => 0,
    alt_url_unsub_success      => '',

    use_alt_url_subscription_approval_step  => 0,
    alt_url_subscription_approval_step      => '',
    alt_url_subscription_approval_step_w_qs => 0,

    enable_subscription_approval_step => 0,
    captcha_sub                       => 0,

    send_subscribed_by_list_owner_message   => 0,
    send_unsubscribed_by_list_owner_message => 0,

    send_last_archived_msg_mass_mailing => 0,

    # SMTP Options

    smtp_server => undef,
    smtp_port   => 25,

    use_smtp_ssl        => 0,
    use_pop_before_smtp => 0,

    pop3_server   => undef,
    pop3_username => undef,
    pop3_password => undef,
    pop3_use_ssl  => undef,

    # Can be set to,
    # BEST, PASS, APOP, or CRAM-MD5
    pop3_auth_mode => 'BEST',

    set_smtp_sender => 1,

    use_sasl_smtp_auth  => 0,
    sasl_auth_mechanism => 'PLAIN',
    sasl_smtp_username  => undef,
    sasl_smtp_password  => undef,

    smtp_max_messages_per_connection => undef,

    # Sending Options

    # Enable Batch Sending
    enable_bulk_batching => 1,

    # adjust_batch_sleep_time
    adjust_batch_sleep_time => 1,

    # Receive Finishing Message
    get_finished_notification => 1,

    # Send: [x] message(s) per batch
    mass_send_amount => 1,

    # and then wait: [x] seconds, before the next
    bulk_sleep_amount => 8,

    # Auto-Pickup Dropped Mass Mailings
    auto_pickup_dropped_mailings => 1,

    # Restart Mailings After Each Batch
    # TODO - this variable should really be called, "reload_mailings_after_each_batch"
    restart_mailings_after_each_batch => 0,

    # sendmail, smtp, amazon_ses
    sending_method => 'sendmail',

    # Send a copy to the List Owner
    mass_mailing_send_to_list_owner => 1,
	mass_mailing_save_logs          => 0,

    amazon_ses_auto_batch_settings => 0,

    # For mass mailings, connect only once per batch?
    # 0 = no
    # 1 = yes!
    smtp_connection_per_batch => 0,

    # adv sending options

    precedence => undef,
    charset    => 'UTF-8	UTF-8',

    # (Dummy)
    charset_value => 'UTF-8',
    priority      => 3,

    print_errors_to_header       => 0,
    print_return_path_header     => 0,
    plaintext_encoding           => 'quoted-printable',
    html_encoding                => 'quoted-printable',
    strip_message_headers        => 0,
    add_sendmail_f_flag          => 1,
    verp_return_path             => 0,
    use_domain_sending_tunings   => 0,
    domain_sending_tunings       => undef,
    mime_encode_words_in_headers => 1,

    # view list prefs

    view_list_subscriber_number  => 100,
    view_list_show_timestamp_col => 1, 
    view_list_order_by           => 'email', 
    view_list_order_by_direction => 'ASC', 

    # add list prefs
    use_add_list_import_limit               => 1, 
    add_list_import_limit                   => 1000, 
    allow_profile_editing => 0, 
    
    # archive prefs

    archive_messages                       => 1,
    show_archives                          => 1,
    archives_available_only_to_subscribers => 0,
    archive_subscribe_form                 => 1,
    archive_search_form                    => 1,
    captcha_archive_send_form              => 0,
    archive_send_form                      => 0,
    send_newest_archive                    => 0,

    archive_show_second          => 0,
    archive_show_hour_and_minute => 0,
    archive_show_month           => 1,
    archive_show_day             => 1,
    archive_show_year            => 1,
    archive_index_count          => 10,

    sort_archives_in_reverse    => 1,
    disable_archive_js          => 1,
    style_quoted_archive_text   => 1,
    stop_message_at_sig         => 1,
    publish_archives_rss        => 1,
    ping_archives_rss           => 0,
    html_archives_in_iframe     => 0,
    display_attachments         => 1,
    add_subscribe_form_to_feeds => 1,

    add_social_bookmarking_badges => 1,

    # Can be set to, "none", "spam_me_not", or, "recaptcha_mailhide"
    archive_protect_email => 'spam_me_not',

    enable_gravatars     => 0,
    default_gravatar_url => undef,

    # archive editing prefs

    editable_headers => 'Subject',

    #blacklist
    black_list                           => 1,
    add_unsubs_to_black_list             => 1,
    allow_blacklisted_to_subscribe       => 1,
    allow_admin_to_subscribe_blacklisted => 0,

    # White List Prefs

    # white list
    enable_white_list => 0,

    # List Invite Prefs

    invites_check_for_already_invited => 1,
    invites_prohibit_reinvites        => 1,

    # Your Mailing List Template Prefs

    get_template_data => 'from_default_template',
    url_template      => '',

    # Create a Back Link prefs

    website_name => '',
    website_url  => '',

    #SQL stuff

    # I don't think this is honored...
    # Don't change.
    subscription_table => 'dada_subscribers',

    # Not used?
    hard_remove => 1,

    # Not used?
    merge_fields => '',

    fallback_field_values => '',

    # Email Templates

    confirmation_message_subject => undef,
    confirmation_message         => undef,



	# Subscription Requests
	# List Owner

    subscription_approval_request_message_subject   => undef,
    subscription_approval_request_message           => undef,
	
	# Subscriber
    subscription_request_approved_message_subject   => undef,
    subscription_request_approved_message           => undef,

	# Subscriber  
    subscription_request_denied_message_subject     => undef,
    subscription_request_denied_message             => undef,


	# Unsubscription Requests
	# List Owner
    unsubscription_approval_request_message_subject => undef,
	unsubscription_approval_request_message         => undef,

	# Subscriber
    unsubscription_request_approved_message_subject => undef,
    unsubscription_request_approved_message         => undef,

	# Subscriber
    unsubscription_request_denied_message_subject   => undef,
    unsubscription_request_denied_message           => undef,

    
    subscribed_message_subject => undef,
    subscribed_message         => undef, 

    subscribed_by_list_owner_message_subject => undef,
    subscribed_by_list_owner_message         => undef,

    unsubscribed_by_list_owner_message_subject => undef,
    unsubscribed_by_list_owner_message         => undef,

    unsubscribed_message_subject => undef, 
    unsubscribed_message         => undef,


    mailing_list_message_from_phrase => undef, 
    mailing_list_message_to_phrase   => undef,
    mailing_list_message_subject     => undef,
    mailing_list_message             => undef,
    mailing_list_message_html        => undef,
    
    digest_message_subject           => undef, 
    digest_message                   => undef, 
    digest_message_html              => undef, 
    

    send_archive_message_subject     => undef,
    send_archive_message             => undef,
    send_archive_message_html        => undef,

    you_are_already_subscribed_message_subject => undef, 
    you_are_already_subscribed_message => undef,

    you_are_not_subscribed_message         => undef,
    you_are_not_subscribed_message_subject => undef,

    admin_subscription_notice_message_subject => undef,
    admin_subscription_notice_message         => undef,

    admin_unsubscription_notice_message_subject => undef,
    admin_unsubscription_notice_message         => undef,

    enable_email_template_expr                  => 0,

    # HTML Screen Templates

    html_confirmation_message         => undef,
    html_subscribed_message           => undef,
    html_unsubscribed_message         => undef,
    html_subscription_request_message => undef,

    # Send a List Invitation

    invite_message_from_phrase => undef, 
    invite_message_to_phrase   => undef,
    invite_message_text        => undef,
    invite_message_html        => undef,
    invite_message_subject     => undef,

    # Feature Set
    admin_menu           => undef,
    disabled_screen_view => 'grey_out',

    # List CP -> Options

    use_wysiwyg_editor                      => 'ckeditor',
    enable_mass_subscribe                   => 1,
    enable_mass_subscribe_only_w_root_login => 1,

    # Send me the list password.
    pass_auth_id => undef,

### Plugins

    # Bridge Plugin:

    group_list                     => 0,
	group_list_pp_mode             => 1, 
	group_list_pp_mode_from_phrase => '<!-- tmpl_var original_from_phrase default="Subscriber" --> <!-- tmpl_var subscriber.email --> [<!-- tmpl_var list_settings.list_name -->]',  
	                                    
    open_discussion_list => 0,

    discussion_template_defang   => 1,
    only_allow_group_plain_text  => 0,
    mail_group_message_to_poster => 1,
    prefix_list_name_to_subject  => 1,

    no_prefix_list_name_to_subject_in_archives => 1,

    set_to_header_to_list_address        => 0,
    prefix_discussion_list_subjects_with => 'list_shortname',
    send_received_msg                    => 1, 
    send_msgs_to_list                    => 1,
    disable_discussion_sending           => 1,
    mail_discussion_message_to_poster    => 1,

    ignore_spam_messages                => 0,
    find_spam_assassin_score_by         => 'looking_for_embedded_headers',
    ignore_spam_messages_with_status_of => 6,
    rejected_spam_messages              => 'ignore_spam',

    enable_moderation              => 0,
    moderate_discussion_lists_with => 'list_owner_email',
    send_moderation_msg            => 0,
    send_moderation_accepted_msg   => 0,
    send_moderation_rejection_msg  => 0,
    send_msg_copy_address          => '',

    enable_authorized_sending        => 0,

    authorized_sending_no_moderation => 0,
    subscriber_sending_no_moderation => 0,

    strip_file_attachments    => 0,
    file_attachments_to_strip => '',
    discussion_pop_server     => '',
    discussion_pop_username   => '',
    discussion_pop_email      => '',
    bridge_list_email_type    => 'pop3_account',
    discussion_pop_password   => '',

    discussion_pop_auth_mode => 'BEST',
    discussion_pop_use_ssl   => 0,

    send_not_allowed_to_post_msg => 0,
    send_invalid_msgs_to_owner   => 0,
    send_msg_copy_to             => 0,
    rewrite_anounce_from_header  => 1,
    discussion_clean_up_replies  => 0,

    not_allowed_to_post_msg_subject => undef, ,
    not_allowed_to_post_msg         => undef,

    invalid_msgs_to_owner_msg_subject => undef,
    invalid_msgs_to_owner_msg => undef,

    moderation_msg_subject => undef, 
    moderation_msg => undef,
    
    await_moderation_msg_subject => undef,
    await_moderation_msg => undef,
    
    accept_msg_subject => undef,
    accept_msg => undef,
    
    rejection_msg_subject => undef,
    rejection_msg => undef,
    
    msg_too_big_msg_subject => undef,
    msg_too_big_msg         => undef,
    
    msg_received_msg_subject => undef, 
    msg_received_msg         => undef, 
    
    msg_labeled_as_spam_msg_subject => undef,
    msg_labeled_as_spam_msg => undef,

    digest_enable               => 0, 
    digest_schedule             => 86400, 
    digest_last_archive_id_sent => undef, 

    # Tracker
    tracker_record_view_count                       => 10,
    tracker_auto_parse_links                        => 1,
    tracker_auto_parse_mailto_links                 => 0,
    tracker_track_opens_method                      => 'directly',
    tracker_track_email                             => 1,

    tracker_clean_up_reports                        => 1,
    tracker_show_message_reports_in_mailing_monitor => 0,

    tracker_update_profiles_w_geo_ip_data            => 0,
    tracker_update_profile_fields_ip_dada_meta       => undef, 


    #	tracker_enable_data_cache                           => 1,
    #	tracker_dada_cache_expires                          => 1, # in hours

    # Bounce Handler

    bounce_handler_threshold_score            => 10,
    bounce_handler_hardbounce_score           => 4,
    bounce_handler_softbounce_score           => 1,
    bounce_handler_decay_score                => 1,
    bounce_handler_forward_msgs_to_list_owner => 0,
    bounce_handler_when_threshold_reached     => 'move_to_bounced_sublist',


    # default messages
    default_plaintext_message_content_src             => 'default',    # default/url_or_path
    default_plaintext_message_content_src_url_or_path => undef,
    default_html_message_content_src                  => 'default',    # default/url_or_path
    default_html_message_content_src_url_or_path      => undef,
    
    public_api_key   =>  undef, 
    private_api_key  => undef, 
    
    
    schedule_last_checked_time => undef, 

) unless keys %LIST_SETUP_DEFAULTS;

%LIST_SETUP_INCLUDE = ()
  unless keys %LIST_SETUP_INCLUDE;

%LIST_SETUP_DEFAULTS = ( %LIST_SETUP_DEFAULTS, %LIST_SETUP_INCLUDE );

%LIST_SETUP_OVERRIDES = ()
  unless keys %LIST_SETUP_OVERRIDES;

@LIST_SETUP_DONT_CLONE = qw(

  list
  list_name
  info
  list_info
  list_owner_email
  privacy_policy
  physical_address
  password

  bridge_list_email_type

  disable_discussion_sending
  discussion_pop_server
  discussion_pop_username
  discussion_pop_email
  discussion_pop_password
  discussion_pop_auth_mode
  discussion_pop_use_ssl


  ) unless keys %LIST_SETUP_OVERRIDES;

$OS ||= $^O;

$NULL_DEVICE ||= '/dev/null';

srand( time() ^ ( $$ + ( $$ << 15 ) ) );

$FIRST_SUB ||= 0;
$SEC_SUB   ||= 2;

@C = ( 'a' .. 'z', 'A' .. 'Z', '0' .. '9', '.' );
$SALT = $C[ rand(@C) ] . $C[ rand(@C) ];

# Pick a word. It really doesn't matter what the word is - a longer
# word doesn't necessarily mean a better pin number.

if ( !defined($PIN_WORD) ) {
    $PIN_WORD =
      ( $ROOT_PASS_IS_ENCRYPTED == 1 ) ? ($PROGRAM_ROOT_PASSWORD) : ('dada');
}

# Pick a number. I would keep it between 1 and 9.
$PIN_NUM ||= unpack( "%32C*", $FILES );

$TEXT_CSV_PARAMS ||= {

    binary              => 1,
    allow_loose_escapes => 1,
};

BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File) }

$ATTACHMENT_TEMPFILE ||= 0;

$MAIL_VERP_SEPARATOR ||= '-';

$VERSION = 7.4.1;
$VER     = '7.4.1 Stable 02/20/14';

#
#
#
#####################################################################

$PROGRAM_NAME ||= "Dada Mail";

%EMAIL_HEADERS = (

    Date          => undef,
    From          => undef,
    To            => undef,
    Cc            => undef,
    Bcc           => undef,
    Sender        => undef,
    'Return-Path' => undef,
    'Reply-To'    => undef,
    'In-Reply-To' => undef,
    'Errors-To'   => undef,
    References    => undef,
    'X-Priority'  => undef,

    'Content-Base'     => undef,
    List               => undef,
    'List-Archive'     => undef,
    'List-Digest'      => undef,
    'List-Help'        => undef,
    'List-ID'          => undef,
    'List-Owner'       => undef,
    'List-Post'        => undef,
    'List-Subscribe'   => undef,
    'List-Unsubscribe' => undef,
    'List-URL'         => undef,
    'X-BeenThere'      => undef,

    'Message-ID' => undef,
    'Precedence' => 'list',
    'X-Mailer'   => "$PROGRAM_NAME $VER ",

    'Content-type'              => undef,
    'Content-Transfer-Encoding' => undef,

    # Content-Length            =>    undef, # See it *should* be here,
    # but it also states it's unofficial

    'Content-Disposition' => undef,
    'MIME-Version'        => undef,

    Subject => '(no subject)',

    Body => 'blank',

) unless keys %EMAIL_HEADERS;

@EMAIL_HEADERS_ORDER = qw(
  Date
  From
  To
  Cc
  Bcc
  Sender
  Return-Path
  Reply-To
  In-Reply-To
  Errors-To
  References
  X-Priority
  Precedence

  List
  X-List
  List-Archive
  List-Digest
  List-Help
  List-ID
  List-Owner
  List-Post
  List-Subscribe
  List-Unsubscribe
  List-URL
  X-BeenThere

  X-Message-ID
  Message-ID

  X-Mailer

  Content-type
  Content-Transfer-Encoding
  Content-Disposition
  Content-Base

  MIME-Version

  Subject
  ) unless scalar @EMAIL_HEADERS_ORDER;

######################################################################

# http://dadamailproject.com/purchase/pro.html
#
#
#
#

$GIVE_PROPS_IN_EMAIL = 1;

$GIVE_PROPS_IN_HTML = 1;

$GIVE_PROPS_IN_ADMIN = 1;

$GIVE_PROPS_IN_SUBSCRIBE_FORM = 1;

##########################################

#

sub _config_import {

# There's no user-servicable parts in the subroutine, so don't make any changes,
# unless you're customizing Dada Mail or debugging something interesting.
#
    if ( exists( $ENV{NO_DADA_MAIL_CONFIG_IMPORT} ) ) {
        if ( $ENV{NO_DADA_MAIL_CONFIG_IMPORT} == 1 ) {
            return;
        }
    }

    # Keep this as, 'http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi'
    # What we're doing is, seeing if you've actually changed the variable from
    # it's default, and if not, we take a best guess.

    my $CONFIG_FILE_DIR = undef;

    if ( defined($OS) !~ m/^Win|^MSWin/i ) {
        my $getpwuid_call;
        my $good_getpwuid;
        eval { $getpwuid_call = ( getpwuid $> )[7]; };
        if ( !$@ ) {
            $good_getpwuid = $getpwuid_call;
        }
        if ( $PROGRAM_CONFIG_FILE_DIR eq 'auto' ) {
			$good_getpwuid =~ s/\/$//; 
            $CONFIG_FILE_DIR = $good_getpwuid . '/.dada_files/.configs';
        }
        else {
            $CONFIG_FILE_DIR = $PROGRAM_CONFIG_FILE_DIR;
        }
    }

    $CONFIG_FILE = $CONFIG_FILE_DIR . '/.dada_config';

    # yes, shooting yourself in the foot, RTM
    $CONFIG_FILE =~ /(.*)/;
    $CONFIG_FILE = $1;

    if ( -e $CONFIG_FILE && -f $CONFIG_FILE && -s $CONFIG_FILE ) {
        open( CONFIG, '<:encoding(UTF-8)', $CONFIG_FILE )
          or warn
          "could not open outside config file, '$CONFIG_FILE' because: $!";
        my $conf;
        $conf = do { local $/; <CONFIG> };

        # shooting again,
        $conf =~ m/(.*)/ms;
        $conf = $1;
        eval $conf;
        if ($@) {
            die
"$PROGRAM_NAME $VER ERROR - Outside config file '$CONFIG_FILE' contains errors:\n\n$@\n\n";
        }
        if ( $PROGRAM_CONFIG_FILE_DIR eq 'auto' ) {
            if ( !defined $PROGRAM_ERROR_LOG ) {
                $PROGRAM_ERROR_LOG = $LOGS . '/errors.txt';
                open( STDERR, ">>$PROGRAM_ERROR_LOG" )
                  || warn
"$PROGRAM_NAME Error: Cannot redirect STDERR, it's possible that Dada Mail does not have write permissions to this file ($PROGRAM_ERROR_LOG) or it doesn't exist! If Dada Mail cannot make this file for you, create it yourself and give it enough permissions so it may write to it: $!";
            }
        }
    }

    if ( $PROGRAM_URL eq
        'http://www.changetoyoursite.com/cgi-bin/dada/mail.cgi' )
    {
        require CGI;
        $PROGRAM_URL = CGI::url();
    }

   # I really DO NOT think this is the place to massage Config variables if they
   # aren't set right, but it will save people headaches, in the long run:

    my %default_table_names = (
        subscriber_table                   => 'dada_subscribers',
        profile_table                      => 'dada_profiles',
        profile_fields_table               => 'dada_profile_fields',
        profile_fields_attributes_table    => 'dada_profile_fields_attributes',
        profile_settings_table             => 'dada_profile_settings',
        archives_table                     => 'dada_archives',
        settings_table                     => 'dada_settings',
        session_table                      => 'dada_sessions',
        bounce_scores_table                => 'dada_bounce_scores',
        clickthrough_urls_table            => 'dada_clickthrough_urls',
        clickthrough_url_log_table         => 'dada_clickthrough_url_log',
        mass_mailing_event_log_table       => 'dada_mass_mailing_event_log',
        password_protect_directories_table => 'dada_password_protect_directories',
        confirmation_tokens_table          => 'dada_confirmation_tokens',
		message_drafts_table               => 'dada_message_drafts', 
    );
    for ( keys %default_table_names ) {
        if ( !exists( $SQL_PARAMS{$_} ) ) {
            $SQL_PARAMS{$_} = $default_table_names{$_};
        }
    }

}

=pod

=head1 COPYRIGHT

Copyright (c) 1999 - 2014 Justin Simoni 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.

=cut

# Don't remove the '1'. It lives here at the bottom. It likes it there.

1;

__END__