--- trunk/httpd.pl 2004/05/10 22:04:01 42 +++ trunk/httpd.pl 2004/05/11 22:59:27 47 @@ -3,6 +3,34 @@ # based on post # http://www.mail-archive.com/libwww@perl.org/msg04750.html +BEGIN { + my $basedir = readlink($0) || $0; $basedir =~ s#/[^/]+$##; + unshift(@INC, $basedir); +} + +=head1 NAME + +httpd.pl - http server for Mail::Box Web Search + +=head1 SYNOPSYS + + httpd.pl [local.conf] + +=head1 DESCRIPTION + +This is small http server, based on C which is designed +for single-user use (on laptop for example) via loopback. + +It doesn't provide any authentification or authorisation, and it can handle +just one request at the time, so it's not suted for public-facing sites, +even if you don't care about security of your mailboxes. + +=head1 SEE ALSO + +C perl modules which are part of this package + +=cut + use strict; use warnings; use MWS::SWISH; @@ -266,7 +294,8 @@ $text =~ s/(\s*--+\s*Forwarded\s+message.+\s*--+.*)$//si; # remove signature - $text =~ s/[\n\r]+--\s*[\n\r]+.*$//s; + $text =~ s/(?:^|[\n\r]+)*--\s*[\n\r]+.*$//s; + $text =~ s/(?:^|[\n\r]+)*_____+[\n\r]+.*$//s; # compress cr/lf $text =~ s/[\n\r]+/\n/gs; @@ -298,6 +327,8 @@ # remove signature if ($text =~ s/([\n\r]+)(--\s*[\n\r]+.*)$//s) { $sig = "$1#-#signature##$2##signature#-#"; + } elsif ($text =~s/(^|[\n\r]+)*(_____+[\n\r]+.*)$//s) { + $sig = "$1#-#signature##$2##signature#-#"; } # find quoted text