# The configuration file for acmemail # All code must be valid Perl... package AcmemailConf; use Exporter; use strict; use vars qw(@ISA @EXPORT_OK); use Carp qw(verbose); @ISA = qw(Exporter); @EXPORT_OK = qw(image_path smtphost mailhost mailhost_type local_domain hide_email_address messages_in_new_window max_messages_per_page show_recent_messages_first temporary_mime_directory web_temporary_mime_directory session_type dope_directory db_datasource db_username db_password session_timeout force_cookies force_nojavascript force_defang_html inbox_directory html_login html_head html_bottom html_bar html_message_bar html_list_head html_list_row html_list_bottom html_message_head html_message_headers html_message_bottom html_quoted html_signature); ##### # Options ##### # Where the images are (in relation to the webserver) sub image_path() { return '/acme/graphics/'; } # What is the SMTP mail server (where I can send mail)? sub smtphost() { return '/usr/sbin/sendmail'; } # What is the mail server (where the mail resides)? sub mailhost() { return 'localhost'; } # Should I check POP3 or IMAP mail? sub mailhost_type() { # return 'pop3'; return 'imap'; } # If using IMAP, what is the name of the INBOX/Mail # directory sub inbox_directory() { return "Mail"; } # What is my local domain? sub local_domain() { return 'idiom.com'; } # Should I hide email addresses (only show names)? sub hide_email_address() { return 0; } # 0 = messages shown in same window as message list # 1 = one message list window / one message window # 2 = one message list window / new messages shown in their # own window sub messages_in_new_window() { return 0; } # How many messages to show per page sub max_messages_per_page() { return 15; } # Show recent messages first? sub show_recent_messages_first() { return 1; } # Where is the temporary mime directory? sub temporary_mime_directory() { return "mime-tmp/"; } # Where is the temporary mime directory? (in relation to the webserver) sub web_temporary_mime_directory() { return "/acme/mime-tmp/"; } # What kind of sessions are we going to use? sub session_type() { #return "POS"; # using files and Persistant::Object::Simple return "Database"; # using a real database } # If using the POS session type... # And where is our persistant object directory? sub dope_directory() { return "dope/"; } # If using the Database session type... # What is the datasource for our database? sub db_datasource() { return "dbi:mysql:webmail:idiom.com"; # for MySQL # return "dbi:Pg:dbname=acmemail"; # for PostgreSQL } # If using the Database session type... # What is the username for access to the database sub db_username() { return "impmail"; } # If using the Database session type... # What is the password for access to the database sub db_password() { return "k93fn43a"; } # How long should sessions still be valid for (in seconds)? sub session_timeout() { return 60*60; # An hour } # Should we force cookies? sub force_cookies() { return 1; # return 0; } # Should we force people to turn off javascript support? sub force_nojavascript() { # return 1; return 0; } # Should we try and remove malicious HTML tags sub force_defang_html() { return 1; # return 0; } ##### # HTML formatting ##### sub html_login($) { my $q = shift; my $return; $return .= $q->startform; $return .= qq|
|; $return .= ''; $return .= ''; $return .= ''; $return .= ''; $return .= '
User' . $q->textfield('username') . '
Password' . $q->password_field('password') . '


'; $return .= $q->submit('Log in'); $return .= $q->endform; $return .= qq|
|; $return; } sub html_head($) { my $q = shift; my $image_path = image_path(); my($js, $js2); if (force_nojavascript()) { $js = qq| |; $js2 = qq|