X-Git-Url: https://git.deb.at/w?p=pkg%2Ft-prot.git;a=blobdiff_plain;f=t-prot;h=1cd6e9d74c5c08e8c1d01a5a40c9a093a4c6e18a;hp=ee846679214fb2c073f421d2579e3e529888f584;hb=85acafdeccdc72409c35b05991c4bf9b350f1ecb;hpb=59f87ac047552c79d2885106c9dde3967563190a diff --git a/t-prot b/t-prot index ee84667..1cd6e9d 100755 --- a/t-prot +++ b/t-prot @@ -1,13 +1,13 @@ #!/usr/bin/perl -w -# $Id: t-prot,v 1.236 2005/04/25 16:35:56 jochen Exp $ +# $Id: t-prot,v 1.243 2005/05/27 10:00:35 jochen Exp $ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); use Getopt::Mixed qw(nextOption); -use constant VER => '1.101'; +use constant VER => '2.0'; use constant REV => ''; -use constant REL => q$Revision: 1.236 $=~m/(\d+(?:\.\d+)+)/; +use constant REL => q$Revision: 1.243 $=~m/(\d+(?:\.\d+)+)/; # MTA expecting mail on STDIN # (you might have to adjust this if using a different MTA) use constant SENDMAIL => '/usr/sbin/sendmail -oi'; @@ -252,7 +252,7 @@ sub decomb { ($$L[$x+1] !~ /^[\s^]/) && ($$L[$x] !~ /-$/) && ($$L[$x+1] !~ /^\Q[...]\E\s*$/) && - ($mua ne 'mutt' || $$L[$x+1] !~ /^(?:\e.+?\a)?\[-- .* --]/) && + ($mua ne 'mutt' || $$L[$x+1] !~ /^(?:\e[^\a]+\a)?\[-- /) && (length($$L[$x])+index($$L[$x+1], ' ')>$max || (index($$L[$x+1], ' ')<0 && length($$L[$x])+length($$L[$x+1])>$max)) && (length($$L[$x])+length($$L[$x+1])<$kmaxl) && @@ -311,11 +311,14 @@ sub pgp { my $ok = 0; while ($X<$Z) { - if ($$L[$X] =~ /^gpg:\s(?:\Q$gpg_WARNING\E|\Q$gpg_Warning\E|\Q$gpg_bad\E|\Q$gpg_Cantcheck\E|\Q$gpg_expired\E)/o) + if (index($$L[$X], "gpg: $gpg_WARNING")==0 || + index($$L[$X], "gpg: $gpg_Warning")==0 || + index($$L[$X], "gpg: $gpg_bad")==0 || + index($$L[$X], "gpg: $gpg_Cantcheck")==0 || + index($$L[$X], "gpg: $gpg_expired")==0 || + index($$L[$X], "gpg: $gpg_bug")==0) { return 0; } - if ($$L[$X] =~ /^gpg:\s\Q$gpg_bug/o) - { return 0; } - if ($$L[$X] =~ /^gpg:\s\Q$gpg_good/o) + if (index($$L[$X], "gpg: $gpg_good")==0) { $ok = 1; } $X++; } @@ -333,32 +336,34 @@ sub pgp { for (my $x=0; $x1 && - $$L[$i] =~ /^gpg:\s\Q$gpg_aka/o && $$L[$i] !~ /\Q$from/) + index($$L[$i], "gpg: $gpg_aka")==0 && + index($$L[$i], $from)<0) { splice(@$L, $i, 1); splice(@$V, $i, 1); $i--; } - elsif ($$L[$i]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutend\E)/o) + elsif ($$L[$i]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutend\E)/o) { if ($pgpmove || ($pgpmovevrf && (!$sigint) && verified($L, $x+1, $i))) @@ -374,7 +379,12 @@ sub pgp { } } elsif ($tmp && - $$L[$x]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpencrypted\E|\Q$mutt_pgpclearsigned\E|\Q$mutt_pgpsigned\E)/o) + $$L[$x] =~ /^ + (?:\e[^\a]+\a)? + (?:\Q$mutt_pgpencrypted\E | + \Q$mutt_pgpclearsigned\E| + \Q$mutt_pgpsigned\E) + /ox) { splice(@$L, $x+1, 0, @{$tmp[$tmp]}); for (my $i=$x; $i=scalar(@$lines)) { exit(EX_DATAERR); } - if ($bar =~ /^text\/plain/i) { + if ($bar =~ m!^text/plain!) { my $z; for ($z=1; $x+$z<@$lines; $z++) { if (index($$lines[$x+$z], '--'.$foo)==0) { @@ -529,7 +539,7 @@ sub process_msg { for ($x=0; $x