use Mail::Address or Email::Address (whichever is available) - "Mail::Address" was required before

improved colors of warnings and errors
ScriptAlias of example apache config changed to /ezmlm-web
This commit is contained in:
lars 2007-08-10 14:00:55 +00:00
parent 2f8364f915
commit cd2ad51b08
8 changed files with 48 additions and 11 deletions

2
README
View File

@ -63,7 +63,7 @@ This version of ezmlm-web requires the following;
* clearsilver v0.10.3 (only perl support is necessary)
* Perl v5.004 and the following modules;
+ Mail::Ezmlm v0.07
+ Mail::Address v1.15
+ Mail::Address v1.15 OR Email::Address
+ CGI v2.6
+ CGI::Carp v1.06
+ DB_File v1.65

6
TODO
View File

@ -9,3 +9,9 @@ add "only for plain text mails" to the TrailerText string
check version history of Mail::Ezmlm
sort languages in selection
define default interface in example/ezmlmwebrc?
check ui_mode, ui_template in source

View File

@ -18,8 +18,9 @@ Version 3.2 - 08/07/02007
* support regional language codes (e.g.: pt_BR)
* allow to reset the "owner" attribute
* the formerly required module "Encode" is now optional
* the perl module Email::Address can be used instead of Mail::Address
* most importantly: a new color scheme! (red/blue instead of blue/gray)
(you can also use the "classic" color scheme)
(the "classic" color scheme is still supported)
Version 3.1.4 - 03/26/02006
* new setting: DOTQMAIL_DIR (useful for multi domain vpopmail setups)

View File

@ -9,5 +9,5 @@ Alias /ezmlm-web/ /usr/local/share/ezmlm-web/www-data/
# write access to the mailing list directories
# see 'man ezmlm-web-make-suid' for details
# e.g.: 'ezmlm-web-make-suid ezmlm /usr/local/bin/ezmlm-web'
#ScriptAlias /cgi-bin/ezmlm-web /usr/local/bin/ezmlm-web
#ScriptAlias /ezmlm-web /usr/local/bin/ezmlm-web

View File

@ -21,7 +21,6 @@ use strict;
use Getopt::Std;
use ClearSilver;
use Mail::Ezmlm;
use Mail::Address;
use File::Copy;
use File::Path;
use DB_File;
@ -33,8 +32,24 @@ use English;
# optional modules - they will be loaded later if they are available
#Encode
#Mail::Ezmlm::Gpg
#Mail::Address OR Email::Address
my $mail_address_package;
# we can use either the Mail::Address or the Email::Address module
# "Mail::Address" was used exclusively until ezmlm-web v3.2, thus it is proven
# to work with ezmlm-web
# the downside of Mail::Address is, that it is not available in the debian
# distribution
if (&safely_import_module("Mail::Address")) {
$mail_address_package = "Mail::Address";
} elsif (&safely_import_module("Email::Address")) {
$mail_address_package = "Email::Address";
} else {
die "Failed to import the Mail::Address and the Email::Address module.\n" .
"At least one of these modules is required for ezmlm-web.\n";
}
# the Encode module is optional - we do not break if it is absent
my $ENCODE_SUPPORT = 1;
unless (&safely_import_module("Encode")) {
@ -1511,7 +1526,12 @@ sub add_address {
tie %pretty, "DB_File", "$LIST_DIR/" . $q->param('list') . "/webnames" if ($PRETTY_NAMES);
foreach $address (@addresses) {
($add) = Mail::Address->parse($address);
# call the "parse" function of either "Mail::Address" or "Email::Address"
# based on the perl cookbook (chapter 12_14)
# we have to disable 'strict refs' for the call
no strict 'refs';
($add) = ($mail_address_package . "::parse")->($mail_address_package, $address);
use strict 'refs';
if (($add->address() =~ m/^(\w[\w\.\!\#\$\%\&\'\`\*\+\-\/\=\?\^\{\|\}\~]*)@(\w[\-\w_\.]+)$/)
&& !($list->issub($add->address(), $part))) {
# it seems, that we cannot trust the return value of "$list->sub"
@ -1654,7 +1674,7 @@ sub create_list {
-user=>$USER)
) {
# fatal error
$customError = $list->errmsg();
$customError = "[ezmlm-make] " . $list->errmsg();
return (1==0);
}
@ -2460,7 +2480,8 @@ sub safely_import_module {
my ($mod_name) = @_;
eval "use $mod_name";
if ($@) {
warn "Failed to load module '$mod_name': $@";
# we do not need the warning message
# warn "Failed to load module '$mod_name': $@";
return (1==0);
} else {
return (0==0);

View File

@ -74,10 +74,14 @@ body {
background-color: #c0c0b0;
}
#main_content div.success,
#main_content div.success {
color: #202020;
background-color: inherit; /* just to avoid css syntax warnings */
}
#main_content div.warning,
#main_content div.error {
color: #202020;
color: #eeeeec; /* the dark red background requires a light color */
background-color: inherit; /* just to avoid css syntax warnings */
}

View File

@ -78,10 +78,14 @@ body {
background-position: left;
}
#main_content div.success,
#main_content div.success {
color: #2e3436;
background-color: inherit; /* just to avoid css syntax warnings */
}
#main_content div.warning,
#main_content div.error {
color: #2e3436;
color: #eeeeec; /* the dark red background requires a light color */
background-color: inherit; /* just to avoid css syntax warnings */
}

View File

@ -194,6 +194,7 @@ button, select { cursor: pointer; }
padding: 2%;
text-align: center;
font-style: italic;
font-weight: bold;
font-size: 90%;
}