From afc6f7175ce2809eab34f213614ac478cbbf0ac3 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Wed, 17 Feb 2010 20:56:09 +0100 Subject: [PATCH] Imported Upstream version 2.12 --- ChangeLog | 12 ++++ ...r1.269-gol.diff => t-prot-r1.271-gol.diff} | 66 +++++++++---------- t-prot | 17 ++++- t-prot.1 | 4 +- 4 files changed, 61 insertions(+), 38 deletions(-) rename contrib/{t-prot-r1.269-gol.diff => t-prot-r1.271-gol.diff} (97%) diff --git a/ChangeLog b/ChangeLog index a38d94c..1fc6cf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-01-08 11:10 Jochen Striepe + + * t-prot: Release as v2.12. + +2010-01-08 11:08 Jochen Striepe + + * t-prot, t-prot.1: Exit with exit status EX_OK when --max-lines + hits and -Mmutt is set (mutt is picky when a display_filter fails). + Provide a notification line in that case. Update man page. Many + thanks to Gerfried Fuchs, Martin F. Krafft and Tino Keitel for + reporting, providing a patch and testing. + 2010-01-05 12:05 Jochen Striepe * t-prot: Release as v2.11. diff --git a/contrib/t-prot-r1.269-gol.diff b/contrib/t-prot-r1.271-gol.diff similarity index 97% rename from contrib/t-prot-r1.269-gol.diff rename to contrib/t-prot-r1.271-gol.diff index bef8f22..1896bd1 100644 --- a/contrib/t-prot-r1.269-gol.diff +++ b/contrib/t-prot-r1.271-gol.diff @@ -1,14 +1,14 @@ ---- t-prot 2010-01-05 13:03:01.000000000 +0100 -+++ t-prot-gol 2010-01-05 13:04:08.000000000 +0100 +--- t-prot 2010-01-08 12:10:26.000000000 +0100 ++++ t-prot-gol 2010-01-08 12:14:18.000000000 +0100 @@ -4,7 +4,7 @@ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); -use Getopt::Mixed qw(nextOption); +use Getopt::Long qw(:config gnu_getopt no_ignore_case); - use constant VER => '2.11'; + use constant VER => '2.12'; use constant REV => ''; - use constant REL => q$Revision: 1.268 $=~m/(\d+(?:\.\d+)+)/; + use constant REL => q$Revision: 1.271 $=~m/(\d+(?:\.\d+)+)/; @@ -914,84 +914,83 @@ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); my $ifile = '-'; # use STDIN if nothing specified @@ -38,6 +38,32 @@ - while ($val && $val =~ /^([^,\s]+)(?:,(\S+))?$/) { - my $foo = $1; - $val = $2; +- +- if ($foo =~ /^ratio(?:=(0?\.\d+))?$/) { +- $check_ratio = $1?$1:0.75; +- } +- } +- } +- elsif ($opt eq 'd') { $sysl = 1; } +- elsif ($opt eq 'diff') { $diff = 1; } +- elsif ($opt eq 'e') { $elli = 1; } +- elsif ($opt eq 'ftr-ad') { $ftr_ad = 1; $ad = 1; } +- elsif ($opt eq 'ftr-ml') { $ftr_ml = 1; $ml = 1; } +- elsif ($opt eq 'groupwise') { $gw = 1; } +- elsif ($opt eq 'i') { $ifile = $val; } +- elsif ($opt eq 'k') { $kamm = 1; } +- elsif ($opt eq 'kminl') { $kminl = $val; $kamm = 1; } +- elsif ($opt eq 'kmaxl') { $kmaxl = $val; $kamm = 1; } +- elsif ($opt eq 'kdiff') { $kdiff = $val; $kamm = 1; } +- elsif ($opt eq 'L') { $footers = $val; } +- elsif ($opt eq 'l') { $ml = 1; } +- elsif ($opt eq 'lax-security') { $lax = 1; } +- elsif ($opt eq 'locale') { $locale = $val; } +- elsif ($opt eq 'm') { $ms = 1; } +- elsif ($opt eq 'max-lines') { $maxlines = $val; } +- elsif ($opt eq 'ms-smart') { $ms_smart = 1; $ms = 1; } +- elsif ($opt eq 'M') { +- $mua = lc($val); +if (!Getopt::Long::GetOptions( + 'a' => \$ad, + 'A=s' => \$ads, @@ -82,9 +108,9 @@ + help(); +} -- if ($foo =~ /^ratio(?:=(0?\.\d+))?$/) { -- $check_ratio = $1?$1:0.75; -- } +- if ($mua eq 'mutt') { +- # mutt still displays the message when ^C'ing pgp verification: +- $SIG{'INT'} = 'sigint_handler'; - } +# clean up temp vals: +if (defined $_t1) { @@ -111,32 +137,6 @@ + $_t9 = $2; + if ($foo =~ /^ratio(?:=(0?\.\d+))?$/) { $check_ratio = $1?$1:0.75; } } -- elsif ($opt eq 'd') { $sysl = 1; } -- elsif ($opt eq 'diff') { $diff = 1; } -- elsif ($opt eq 'e') { $elli = 1; } -- elsif ($opt eq 'ftr-ad') { $ftr_ad = 1; $ad = 1; } -- elsif ($opt eq 'ftr-ml') { $ftr_ml = 1; $ml = 1; } -- elsif ($opt eq 'groupwise') { $gw = 1; } -- elsif ($opt eq 'i') { $ifile = $val; } -- elsif ($opt eq 'k') { $kamm = 1; } -- elsif ($opt eq 'kminl') { $kminl = $val; $kamm = 1; } -- elsif ($opt eq 'kmaxl') { $kmaxl = $val; $kamm = 1; } -- elsif ($opt eq 'kdiff') { $kdiff = $val; $kamm = 1; } -- elsif ($opt eq 'L') { $footers = $val; } -- elsif ($opt eq 'l') { $ml = 1; } -- elsif ($opt eq 'lax-security') { $lax = 1; } -- elsif ($opt eq 'locale') { $locale = $val; } -- elsif ($opt eq 'm') { $ms = 1; } -- elsif ($opt eq 'max-lines') { $maxlines = $val; } -- elsif ($opt eq 'ms-smart') { $ms_smart = 1; $ms = 1; } -- elsif ($opt eq 'M') { -- $mua = lc($val); -- -- if ($mua eq 'mutt') { -- # mutt still displays the message when ^C'ing pgp verification: -- $SIG{'INT'} = 'sigint_handler'; -- } -- } - elsif ($opt eq 'o') { $ofile = $val; } - elsif ($opt eq 'P') { $boun = $val; } - elsif ($opt eq 'p') { $mda = $val ? $val : '1'; } diff --git a/t-prot b/t-prot index 441cd90..c67f94b 100755 --- a/t-prot +++ b/t-prot @@ -1,13 +1,13 @@ #!/usr/bin/perl -w -# $Id: t-prot,v 1.269 2010/01/05 12:05:03 jochen Exp $ +# $Id: t-prot,v 1.271 2010/01/08 11:10:26 jochen Exp $ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); use Getopt::Mixed qw(nextOption); -use constant VER => '2.11'; +use constant VER => '2.12'; use constant REV => ''; -use constant REL => q$Revision: 1.269 $=~m/(\d+(?:\.\d+)+)/; +use constant REL => q$Revision: 1.271 $=~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'; @@ -1069,8 +1069,19 @@ close IN; # First, check msg length and stop processing if msg is too long: if ((defined $maxlines) && (@message > $maxlines)) { if ($ofile ne 'NONE') { + if ($mua eq 'mutt') { + my $x = 0; + if (!$nohdr) { + do { $x++; } while ($x<$#message && $message[$x]!~/^$/); + $x++; + } + splice(@message, $x, 0, + ("[---=| Processing by $0 skipped: message too long |=---]\n\n")); + } + write_msg(($mda?'|'.SENDMAIL." $mda":">$ofile"), \@message); } + if ($mua eq 'mutt') { exit(EX_OK); } exit(EX_DATAERR); } diff --git a/t-prot.1 b/t-prot.1 index 2d517c6..6ed54e1 100644 --- a/t-prot.1 +++ b/t-prot.1 @@ -1,4 +1,4 @@ -.\" $Id: t-prot.1,v 1.143 2010/01/05 11:46:38 jochen Exp $ +.\" $Id: t-prot.1,v 1.144 2010/01/08 11:08:50 jochen Exp $ .\" .TH T-PROT "1" "January 2010" "T-PROT" .SH NAME @@ -307,7 +307,7 @@ Requires .BR "\-\-max\-lines" =x Maximum number of lines a message may count (with headers). If the message is longer than x lines, the message will not be processed but printed -unmodified. Exit status will be EX_DATAERR. +unmodified. Exit status will be EX_DATAERR except when called with -Mmutt. .TP .BR "\-o" =FILE "output file": -- 2.39.2