version 1.8, 2007/08/31 17:02:46
|
version 1.10, 2014/05/06 00:42:15
|
Line 55 use HTTP::Request ;
|
Line 55 use HTTP::Request ;
|
use URI::Escape ; |
use URI::Escape ; |
use MIME::Parser ; |
use MIME::Parser ; |
use MIME::Words qw/decode_mimewords encode_mimeword/ ; |
use MIME::Words qw/decode_mimewords encode_mimeword/ ; |
use Unicode::MapUTF8 qw/to_utf8 from_utf8/ ; |
use Unicode::MapUTF8 qw/to_utf8 from_utf8 utf8_charset_alias/ ; |
use HTML::TokeParser ; |
use HTML::TokeParser ; |
|
|
# Changed by LG - commented out configs. |
# Changed by LG - commented out configs. |
Line 205 if ( exists $Opt{'comments'} ) {
|
Line 205 if ( exists $Opt{'comments'} ) {
|
$Opt{'prop_opt_nocomments'} = "" ; |
$Opt{'prop_opt_nocomments'} = "" ; |
$Opt{'prop_opt_noemail'} = 1 ; |
$Opt{'prop_opt_noemail'} = 1 ; |
} elsif ( $Opt{'comments'} =~ /^\s*((off)|(no))\s*$/i ) { |
} elsif ( $Opt{'comments'} =~ /^\s*((off)|(no))\s*$/i ) { |
$Opt{'prop_opt_nocomments'} = 1 |
$Opt{'prop_opt_nocomments'} = 1 ; |
} else { |
} else { |
$Opt{'prop_opt_nocomments'} = $Opt{'comments'} ; |
$Opt{'prop_opt_nocomments'} = $Opt{'comments'} ; |
} |
} |
Line 218 if ( exists $Opt{'comments'} ) {
|
Line 218 if ( exists $Opt{'comments'} ) {
|
$Opt{'prop_taglist'} = join( ", ", @opt_taglist ) if ( @opt_taglist ) ; |
$Opt{'prop_taglist'} = join( ", ", @opt_taglist ) if ( @opt_taglist ) ; |
|
|
# Convert $opt_ljcut_text to UTF8. |
# Convert $opt_ljcut_text to UTF8. |
|
$opt_ljcut = 0 unless defined $opt_ljcut ; # Safety |
if ( defined $opt_ljcut_text ) { |
if ( defined $opt_ljcut_text ) { |
$opt_ljcut_text = |
$opt_ljcut_text = |
to_utf8({ -string => $opt_ljcut_text, -charset => $SystemCharset }) ; |
to_utf8({ -string => $opt_ljcut_text, -charset => $SystemCharset }) ; |
Line 233 href2utf8( \%Opt, $SystemCharset) ;
|
Line 234 href2utf8( \%Opt, $SystemCharset) ;
|
umask 077 ; |
umask 077 ; |
|
|
|
|
|
# Changed by LG: make sure that 'UTF-8' is recognized as a valid charset |
|
# along with "UTF8" ;-) |
|
utf8_charset_alias({ 'UTF-8' => 'UTF8' }); |
|
|
|
|
# Changed by LG - moved from above. |
# Changed by LG - moved from above. |
my $alias = shift @ARGV || "none" ; |
my $alias = shift @ARGV || "none" ; |
my $mp = new MIME::Parser() or die "new MIME::Parser(): $!\n" ; |
my $mp = new MIME::Parser() or die "new MIME::Parser(): $!\n" ; |
Line 613 sub str2utf8 {
|
Line 619 sub str2utf8 {
|
|
|
sub post_me2req { |
sub post_me2req { |
my ($me, $e, $hints) = @_ ; |
my ($me, $e, $hints) = @_ ; |
my $mebh = $me->bodyhandle() or die "post_message(): no body?\n" ; |
# Changed by LG - if no body found (may happen sometimes in multipart |
|
# messages) then attempt to grab the very first MIME part. This is |
|
# somewhat hack-ish, but generally works ;-) |
|
# my $mebh = $me->bodyhandle() or die "post_message(): no body?\n" ; |
|
my $mebh = $me->bodyhandle() ; |
my $mehh = $me->head() ; |
my $mehh = $me->head() ; |
|
if ( ! defined $mebh ) { |
|
# Hack! And get the corresponding header instead of overall one. |
|
$mebh = $me->parts(0)->bodyhandle() or die "post_message(): no body?\n" ; |
|
$mehh = $me->parts(0)->head() ; |
|
} |
my $charset = $mehh->mime_attr("content-type.charset") || $e ; |
my $charset = $mehh->mime_attr("content-type.charset") || $e ; |
my $subject = hdr2utf8($me->get('Subject') || "", $charset) ; |
my $subject = hdr2utf8($me->get('Subject') || "", $charset) ; |
chomp $subject ; # Changed by LG |
chomp $subject ; # Changed by LG |
Line 1028 Options:
|
Line 1043 Options:
|
Insert the From: field from the e-mail as the first line of |
Insert the From: field from the e-mail as the first line of |
the posted message. The field is added in plain text (without |
the posted message. The field is added in plain text (without |
any HTML-formatting - see '--fromh' for that). For slight |
any HTML-formatting - see '--fromh' for that). For slight |
antispam protection, '\@' is replaced by '[_\@_]'. The option |
antispam protection, '\@' is replaced by '$newdog'. The option |
can be negated ('--nofrom'). Default is '--nofrom'. |
can be negated ('--nofrom'). Default is '--nofrom'. |
Note: this option is independent from '--obfuscate' (i.e. the |
Note: this option is independent from '--obfuscate' (i.e. the |
prepended From is always obfuscated, even if the rest of the |
prepended From is always obfuscated, even if the rest of the |
Line 1043 Options:
|
Line 1058 Options:
|
-o, --obfuscate |
-o, --obfuscate |
Obfuscate all e-mail addresses that are present in the body |
Obfuscate all e-mail addresses that are present in the body |
of the message. For slight antispam protection, '\@' in these |
of the message. For slight antispam protection, '\@' in these |
addresses is replaced by '[_\@_]'. The option can be negated |
addresses is replaced by '$newdog'. The option can be negated |
('--noobfuscate'). Default is '--noobfuscate'. |
('--noobfuscate'). Default is '--noobfuscate'. |
|
|
--spaces, --keepspaces |
--spaces, --keepspaces |