From eaaeebe9048266deff624831bf50ba847ae7f048 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Wed, 17 Feb 2010 20:59:52 +0100 Subject: [PATCH] Imported Upstream version 2.13.1 --- ChangeLog | 49 +++++++++++++++++++ contrib/muttrc.t-prot | 8 +-- ...r1.271-gol.diff => t-prot-r1.276-gol.diff} | 24 ++++----- t-prot | 17 ++++--- t-prot.1 | 24 ++++----- 5 files changed, 81 insertions(+), 41 deletions(-) rename contrib/{t-prot-r1.271-gol.diff => t-prot-r1.276-gol.diff} (93%) diff --git a/ChangeLog b/ChangeLog index 1fc6cf8..53ff83e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,52 @@ +2010-02-07 14:31 Jochen Striepe + + * t-prot.1: RFC 5322 is offficial standard for the Internet Message + Format since October 2008, obsoleting RFC 2822. + +2010-02-06 03:29 Jochen Striepe + + * t-prot: Adjust comment to modern t-prot times. + +2010-02-04 21:33 Jochen Striepe + + * t-prot.1: Update contributers list. + +2010-02-03 17:58 Jochen Striepe + + * t-prot.1: Update date string. + +2010-02-03 17:56 Jochen Striepe + + * t-prot.1: Remove redundancies, improve some descriptions. + +2010-02-01 23:48 Jochen Striepe + + * contrib/muttrc.t-prot: By now, --bigq is pretty much standard and + extremely well-tested, so we include it into default configuration. + +2010-02-01 22:34 Jochen Striepe + + * t-prot: Revert thinko from r1.272. + +2010-02-01 22:27 Jochen Striepe + + * t-prot: Fix syntax to match coding style. + +2010-01-31 22:07 Jochen Striepe + + * t-prot: Release as v2.13. + +2010-01-29 13:03 Jochen Striepe + + * t-prot: Fix long standig false positive for mutt<1.5.18 with + Microsoft TOFU inside a PGP signed message and no lines above the + full quote (indicating a forwarded message rather than a lazy full + quote). Thanks to Gerfried Fuchs. + +2010-01-24 17:17 Jochen Striepe + + * t-prot: Fix newline stripping for locales. + 2010-01-08 11:10 Jochen Striepe * t-prot: Release as v2.12. diff --git a/contrib/muttrc.t-prot b/contrib/muttrc.t-prot index 0c5c9c2..97b8dff 100644 --- a/contrib/muttrc.t-prot +++ b/contrib/muttrc.t-prot @@ -1,17 +1,17 @@ -# $Id: muttrc.t-prot,v 1.9 2002/12/29 03:52:57 jochen Exp $ +# $Id: muttrc.t-prot,v 1.10 2010/02/01 23:48:06 jochen Exp $ # This all works only if you have mutt-1.3.12 or newer # or if you use something like the pagerfilter patch # (http://www.escape.de/users/tolot/mutt/). -set display_filter='t-prot -acelmtS -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters' +set display_filter='t-prot -acelmtS --bigq -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters' # toggle TOFU protection with ESC-0 and ESC-1 macro generic \e0 ":unset display_filter\n" "Turn TOFU protection off" -macro generic \e1 ":set display_filter='t-prot -acelmtS -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters'\n" "Turn TOFU protection on" +macro generic \e1 ":set display_filter='t-prot -acelmtS --bigq -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters'\n" "Turn TOFU protection on" # same in pager mode - ugly but what the hell... macro pager \e0 ":unset display_filter; exec exit\n:exec display-message\n" "Turn TOFU protection off" -macro pager \e1 ":set display_filter='t-prot -acelmtS -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters'; exec exit\n:exec display-message\n" "Turn TOFU protection on" +macro pager \e1 ":set display_filter='t-prot -acelmtS --bigq -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters'; exec exit\n:exec display-message\n" "Turn TOFU protection on" # highlight TOFU protection: color body brightmagenta black "^\\[---.*" diff --git a/contrib/t-prot-r1.271-gol.diff b/contrib/t-prot-r1.276-gol.diff similarity index 93% rename from contrib/t-prot-r1.271-gol.diff rename to contrib/t-prot-r1.276-gol.diff index 1896bd1..316c9b1 100644 --- a/contrib/t-prot-r1.271-gol.diff +++ b/contrib/t-prot-r1.276-gol.diff @@ -1,15 +1,15 @@ ---- t-prot 2010-01-08 12:10:26.000000000 +0100 -+++ t-prot-gol 2010-01-08 12:14:18.000000000 +0100 +--- t-prot 2010-02-01 23:34:42.000000000 +0100 ++++ t-prot-gol 2010-02-01 23:35:27.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.12'; + use constant VER => '2.13'; use constant REV => ''; - use constant REL => q$Revision: 1.271 $=~m/(\d+(?:\.\d+)+)/; -@@ -914,84 +914,83 @@ + use constant REL => q$Revision: 1.276 $=~m/(\d+(?:\.\d+)+)/; +@@ -916,84 +916,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 @@ -167,17 +167,11 @@ if ($mua eq 'mutt') { if (defined $locale && $locale ne '' && $locale ne 'C' && $locale ne 'POSIX') { -@@ -1053,11 +1052,15 @@ - m/^([^%]*)/; - } - } -- --} --else { -- if ($ms_smart || $pgpshort || $pgpmove || $pgpmovevrf) { help(); } +@@ -1058,6 +1057,13 @@ + } -+elsif ($ms_smart || $pgpshort || $pgpmove || $pgpmovevrf) { help(); } -+ + elsif ($ms_smart || $pgpshort || $pgpmove || $pgpmovevrf) { help(); } ++ +if (($ml && $footers eq '')|| # no -l without -L + ($ad && $ads eq '')|| # no -a without -A + ($nohdr && $pgpshort)|| # --body and --pgp-short are like oil and water diff --git a/t-prot b/t-prot index c67f94b..364af8e 100755 --- a/t-prot +++ b/t-prot @@ -1,13 +1,13 @@ #!/usr/bin/perl -w -# $Id: t-prot,v 1.271 2010/01/08 11:10:26 jochen Exp $ +# $Id: t-prot,v 1.277 2010/02/06 03:29:23 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.12'; +use constant VER => '2.13'; use constant REV => ''; -use constant REL => q$Revision: 1.271 $=~m/(\d+(?:\.\d+)+)/; +use constant REL => q$Revision: 1.277 $=~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'; @@ -36,8 +36,9 @@ use vars qw( ); -# Please adjust these vals to your needs (they are no constants because -# command line can change them or they are used in rexexp's): +# Please adjust these vals to your needs only if you know what you are +# doing. They are no constants because command line can change them or +# they are used in some rexexp. $0 =~ s!^.*/!!; $maxsig = 4; # max. valid signature length $maxlines = undef; # no limit of message lines @@ -720,6 +721,8 @@ sub process_msg { if ((!$k) && $$lines[$x] !~ /^\s*$/o && ((!$mua) || ($mua eq 'mutt' && + # this line seems not necessary since mutt-1.5.18: + $$lines[$x] !~ /^\e[^\a]+\a$/o && $$lines[$x] !~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_attachment\E)/o && $$lines[$x] !~ @@ -1055,9 +1058,7 @@ if ($mua eq 'mutt') { } } -else { - if ($ms_smart || $pgpshort || $pgpmove || $pgpmovevrf) { help(); } -} +elsif ($ms_smart || $pgpshort || $pgpmove || $pgpmovevrf) { help(); } # Read message: diff --git a/t-prot.1 b/t-prot.1 index 6ed54e1..035f9b9 100644 --- a/t-prot.1 +++ b/t-prot.1 @@ -1,8 +1,8 @@ -.\" $Id: t-prot.1,v 1.144 2010/01/08 11:08:50 jochen Exp $ +.\" $Id: t-prot.1,v 1.148 2010/02/07 14:31:14 jochen Exp $ .\" -.TH T-PROT "1" "January 2010" "T-PROT" +.TH T-PROT "1" "February 2010" "T-PROT" .SH NAME -t-prot \- TOFU Protection - Display Filter for RFC 2822 messages +t-prot \- TOFU Protection - Display Filter for RFC 5322 messages .SH SYNOPSIS .BI "t\-prot [" OPTIONS "]..." .SH DESCRIPTION @@ -13,8 +13,8 @@ e.g. mailing list footers, signatures, and TOFU (see definition below), as well as squeezing sequences of blank lines or punctuation. .br The filter is written in Perl and relies on input to be a single -message conforming to RFC 822 or its successor, RFC 2822. Messages -conforming to RFCs 2045-2049 should be treated reasonably correct. +message conforming to RFC 822 or its successors, RFC 2822 and RFC 5322. +Messages conforming to RFCs 2045-2049 should be treated reasonably correct. .PP Already reformatted messages are handled well: the script was initially designed to cope with the output of the MUA mutt (which @@ -74,7 +74,7 @@ be detected due to missing headers. .TP .B "\-c" "compress": -Squeezes a sequence of blank lines to two blank lines at maximum. +Squeezes a sequence of blank lines to just two blank lines. .TP .BR "\-\-check" [=FLAGS] Run checks. If successful, print an error message and quit with @@ -88,10 +88,9 @@ following (right now just one flag): .br If the quoting ratio is n or more, the message is rejected. Must be between 0 and 1, or else it is entirely disabled. Default is 0.75 -(i.e., three quarters are quoted). +(i.e., 75% of the message lines are quotes). .TP .B "\-d, \-\-debug" -"debug": Print envelope info to syslog when bouncing TOFU contaminated email. Default syslog facility is mail.debug. Requires .BR \-p . @@ -143,11 +142,9 @@ This requires a directory with footer files to be given with option .BR "\-L" =DIRECTORY. .TP .B "\-\-groupwise" -"delete Groupwise style TOFU": Hides TOFU as produced by Novell Groupwise. .TP .B "\-h, \-\-help" -"help": Displays a short help text with a summary on all options, and exits. .TP .BR "\-i" =FILE @@ -430,7 +427,6 @@ CAVEAT: This may lead to interesting effects with crossposts between mailing lists or with undetected signature attempts. .TP .B "\-v, \-\-version" -"version info": Prints the current version number and release date, and exits. .SH ENVIRONMENT The environment variables @@ -585,8 +581,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .SH IDEAS AND INSPIRATION Many good ideas, bug reports and support from (in alphabetical order) Bjoern Buerger, Bjoern Laessig, Christian Borss, Gerfried Fuchs, Martin Neitzel, Martin -Dietze, Ralf Doeblitz, Sven Guckes and many more (see the ChangeLog for active -contributors). Many thanks to all of them! +Dietze, Matthias Kilian, Ralf Doeblitz, Sven Guckes and many more (see the +ChangeLog for active contributors). Many thanks to all of them! .sp Many thanks to Gerhard H. Wrodnigg who uses a TOFU protection script in order to keep the responses to his cancel bot reasonably short. The @@ -653,7 +649,7 @@ and the part about "display_filter", .BR perl (1), .BR aliases (5), .sp -RFCs 2045-2049 and 2822, +RFCs 2045-2049 and 5322, .sp .I http://got.to/quote/ (German language), -- 2.39.2