+++ /dev/null
- KNOWN BUGS
- ==========
-
-For now, please see the TODO file and the BUGS section of the manpage
-for known bugs.
-
-
- REPORTING BUGS
- ==============
-
-To report bugs, please drop an email to <t-prot-bugs@tolot.escape.de>.
-
-Please do not report a bug if
- * you found it in the TODO file or the BUGS section of the man page.
-We do know those and try to fix them as soon as possible.
- * you have an old t-prot version. If you encounter a problem, first
-see if there is a new t-prot version which fixes the issue. If you upgraded
-to the latest version and it *still* occurs, a bug report is just great.
-
-
-If you noticed a bug when processing a message and want to provide the
-t-prot team with some useful info, please:
- * if invoking t-prot by mutt's $display_filter facility, just set
-display_filter to something like "tee ~/foobar|t-prot <your options>"
-and include ~/foobar in the bug report -- this way we might reproduce
-the bug *much* easier if you are using a different environment than we
-do.
- * provide information on what command line options you use t-prot
-with, what perl version t-prot runs on your system, and what else might
-be important to enable us reproducing the bug.
+2005-05-27 10:00 Jochen Striepe
+
+ * t-prot: Re-release as v2.0. No code change since v1.104.
+
+2005-05-13 00:06 Jochen Striepe
+
+ * t-prot.1: Matthias Kilian suggested some cleanup for better
+ reading. Many thanks!
+
+2005-05-12 15:29 Jochen Striepe
+
+ * t-prot.1: Include the BUGS file in the REPORTING BUGS section.
+
+2005-05-12 15:07 Jochen Striepe
+
+ * t-prot.1: Fix typo.
+
+2005-05-12 15:07 Jochen Striepe
+
+ * t-prot.1: Provide more information on how to submit bug reports.
+
+2005-05-12 03:32 Jochen Striepe
+
+ * t-prot.1: Fix formatting.
+
+2005-05-12 03:29 Jochen Striepe
+
+ * t-prot.1: Another typo.
+
+2005-05-12 03:27 Jochen Striepe
+
+ * t-prot.1: Fix typo.
+
+2005-05-12 02:54 Jochen Striepe
+
+ * t-prot: Release as v1.104.
+
+2005-05-11 12:14 Jochen Striepe
+
+ * t-prot.1: Many clarifications and added details. Some formatting
+ cleanup.
+
+2005-05-11 09:21 Jochen Striepe
+
+ * t-prot.1: Fix copyright date string.
+
+2005-05-11 09:17 Jochen Striepe
+
+ * t-prot.1: LICENSE CHANGE!
+
+ Alfie is completely right: Since the copyright notice essentially
+ is a BSD license, it is the Right Thing to simply switch to a BSD
+ license (slightly modified, as there is no binary code in t-prot).
+
+2005-05-11 01:22 Jochen Striepe
+
+ * t-prot.1: LICENSE CHANGE! More clarifications. The meaning still
+ remains the same.
+
+2005-05-11 01:16 Jochen Striepe
+
+ * t-prot.1: LICENSE CHANGE! The meaning remains the same, but the
+ wording should be a little clearer now.
+
+2005-05-11 01:14 Jochen Striepe
+
+ * t-prot.1: Remove unnecessary text block.
+
+2005-05-11 01:09 Jochen Striepe
+
+ * t-prot: The case-sensitivity of the Content-Type: header (vs.
+ Content-type:) seems not to be absolutely clear. RFC 1049 should be
+ obsoleted by RFCs 2045-2049 by now, but to be sure, we will accept
+ both strings.
+
+2005-05-11 01:04 Jochen Striepe
+
+ * t-prot.1: RFC 822 is no longer important. RFC 2822 should
+ suffice.
+
+2005-05-11 00:59 Jochen Striepe
+
+ * t-prot.1: Update date string.
+
+2005-05-11 00:58 Jochen Striepe
+
+ * t-prot.1: Fix apostrophe.
+
+2005-05-10 13:09 Jochen Striepe
+
+ * contrib/t-prot.sl: Update copyright.
+
+2005-05-09 14:54 Jochen Striepe
+
+ * contrib/t-prot.sl: Make sure users get a hint if they look why
+ t-prot.sl does not work on their system (just as I did and wondered
+ what was wrong).
+
+2005-05-08 18:13 Jochen Striepe
+
+ * t-prot: Release as v1.103.
+
+2005-05-08 18:13 Jochen Striepe
+
+ * t-prot: More regex fixes.
+
+2005-05-08 17:50 Jochen Striepe
+
+ * t-prot: Release as v1.102.
+
+2005-05-08 17:49 Jochen Striepe
+
+ * t-prot: Many fixes to many regexes, fixing performance issues und
+ readability. Some were entirely replaced by faster means.
+
2005-04-25 16:35 Jochen Striepe
* t-prot: Release as v1.101.
text at the top; obviously they think that quoted text must not be
changed at all. This is quite annoying as it needlessly sends a lot of
data even when it is not required. Some editing of messages is desired.
- Please point these people to the page http://learn.to/edit_messages -
- thank you!
+ Please point these people to the page
+ http://www.river.com/users/share/etiquette/edit.html
+ Thank you!
2. What does the script do?
- It detects, and when demanded hides annoying parts in rfc822 messages:
+ It detects, and when demanded hides annoying parts in rfc2822 messages:
TOFU, huge quoted blocks, signatures (especially when they are too long),
excessive punktuation, blocks of empty lines, trailing spaces and tabs.
For use inside of MTAs or MDAs it may exit with appropriate libc exit
====================
For more issues and/or some details, please see the BUGS section of
-the man page.
+the man page. To report bugs, please first see the REPORTING BUGS
+section of the man page.
-To report bugs, please first see the BUGS file.
To make suggestions or tell about features you miss, please drop an
email to <t-prot@tolot.escape.de>.
These t-prot patches still did not make it into vanilla t-prot, mostly
for one of these reasons: They decrease performance, accuracy, flexibility,
-reliability or are hard to maintain.
+reliability or are a real burden to maintain.
Still, there might be a chance to have them included into vanilla t-prot:
You can send an email to the author and ask him to include this or that
at some time, because noone seems to need it.
-Some patches are there because they bring *big* changes and need some more
+Some patches exist because they bring *big* changes and need some more
testing. So if you use these patches, please send an email to the author,
and give some feedback on how well the patch works. It will be most helpful
to decide if some specific feature makes it into vanilla t-prot.
smoothly. Please send a bug report if there are some great new
features in the new mutt or gnupg which break anything inside t-prot.
-Please note that this patches will most likely be applied by the t-prot
+Please note that these patches will most likely be applied by the t-prot
package maintainer(s) of your distribution (if the distribution makes
-use of said mutt and gnupg versions), e.g. Debian Testing/Unstable.
+use of said mutt and gnupg versions).
OBSOLETE PATCHES
+++ /dev/null
---- t-prot Thu Feb 24 23:31:55 2005
-+++ t-prot-M157 Thu Feb 24 23:41:45 2005
-@@ -32,7 +32,7 @@
-
- $mutt_attachment $mutt_contenttype $mutt_pgpsigned $mutt_beginsigned
- $mutt_pgpclearsigned $mutt_pgpclearsigstart $mutt_pgpencrypted
-- $mutt_pgpoutstart $mutt_pgpoutend
-+ $mutt_pgpoutstart $mutt_pgpoutend $mutt_ssloutstart $mutt_ssloutend
- );
-
-
-@@ -69,6 +69,8 @@
- $mutt_pgpencrypted = '[-- End of PGP/MIME encrypted data --]';
- $mutt_pgpoutstart = '[-- PGP output follows (current time:';
- $mutt_pgpoutend = '[-- End of PGP output --]';
-+$mutt_ssloutstart = '[-- OpenSSL output follows';
-+$mutt_ssloutend = '[-- End of OpenSSL output --]';
-
- # set the defaults to the C locale
- $gpg_WARNING = 'WARNING: ';
-@@ -329,7 +331,7 @@
- for (my $x=0; $x<scalar(@$L); $x++) {
- if ($$V[$x]) { next; }
-
-- if ($$L[$x]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E)/o)
-+ if ($$L[$x]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E|\Q$mutt_ssloutstart\E)/o)
- {
- my $from;
- for (my $m=0; $m<scalar(@$H); $m++) {
-@@ -354,7 +356,7 @@
- splice(@$V, $i, 1);
- $i--;
- }
-- elsif ($$L[$i]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutend\E)/o)
-+ elsif ($$L[$i]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutend\E|\Q$mutt_ssloutend\E)/o)
- {
- if ($pgpmove ||
- ($pgpmovevrf && (!$sigint) && verified($L, $x+1, $i)))
-@@ -649,7 +651,7 @@
- 'Forwarded message',
- 'Weitergeleitete Nachricht / Forwarded Message');
- my $k = 0; # any text above?
-- my $tmp = 0; # flagged if inside PGP output
-+ my $tmp = 0; # flagged if inside PGP or SSL output
-
- DONE: for ($x=0; $x<scalar(@$lines); $x++) {
- if (!$vrb[$x]) {
-@@ -670,7 +672,8 @@
- ((!$spass) || $$lines[$x]!~/^\Q$spass_prefix/o))
- {
- if ($mua eq 'mutt' && (!$tmp) &&
-- $$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E)/o) {
-+ ($$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E)/o ||
-+ $$lines[$x] !~ /^(?:\e.+?\a)?(?:\Q$mutt_ssloutstart\E)/o)) {
- $tmp = 1;
- } elsif ($mua eq 'mutt' && $tmp &&
- ($$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_beginsigned\E)/o ||
-@@ -936,8 +939,8 @@
- Locale::gettext::gettext("[-- Type: %s/%s, Encoding: %s, Size: %s --]\n") =~
- m/^([^%]*)/o;
- ($mutt_pgpsigned) =
-- Locale::gettext::gettext("[-- End of signed data --]\n") =~
-- m/^(.*?)\n/mo;
-+ Locale::gettext::gettext("\n[-- End of signed data --]\n") =~
-+ m/^\n*(.*?)\n/mo;
- ($mutt_beginsigned) =
- Locale::gettext::gettext("[-- The following data is signed --]\n\n") =~
- m/^(.*?)\n/mo;
-@@ -945,16 +948,24 @@
- Locale::gettext::gettext("[-- END PGP SIGNED MESSAGE --]\n") =~
- m/^(.*?)\n/mo;
- ($mutt_pgpclearsigstart) =
-- Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\n") =~
-+ Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\n\n") =~
- m/^(.*?)\n/mo;
- ($mutt_pgpencrypted) =
- Locale::gettext::gettext("[-- End of PGP/MIME encrypted data --]\n") =~
- m/^(.*?)\n/mo;
- ($mutt_pgpoutstart) =
-- Locale::gettext::gettext("[-- PGP output follows (current time: %c) --]\n") =~
-- m/^([^%]*)/o;
-+ Locale::gettext::gettext("[-- %s output follows%s --]\n") =~
-+ m/^(.*)%s/o;
-+ $mutt_pgpoutstart =~ s/%s/PGP/;
- ($mutt_pgpoutend) =
-- Locale::gettext::gettext("[-- End of PGP output --]\n") =~
-+ Locale::gettext::gettext("[-- End of PGP output --]\n\n") =~
-+ m/^(.*?)\n/mo;
-+ ($mutt_ssloutstart) =
-+ Locale::gettext::gettext("[-- %s output follows%s --]\n") =~
-+ m/^(.*)%s/o;
-+ $mutt_ssloutstart =~ s/%s/OpenSSL/;
-+ ($mutt_ssloutend) =
-+ Locale::gettext::gettext("[-- End of OpenSSL output --]\n\n") =~
- m/^(.*?)\n/mo;
-
- Locale::gettext::textdomain('gnupg');
+++ /dev/null
---- t-prot Tue Mar 1 16:20:49 2005
-+++ t-prot-G126 Tue Mar 1 16:21:49 2005
-@@ -968,16 +968,16 @@
- Locale::gettext::gettext("Can't check signature: %s\n") =~
- m/^([^%]*)/o;
- ($gpg_aka) =
-- Locale::gettext::gettext((' 'x16).'aka "%s"') =~
-+ Locale::gettext::gettext((' 'x16).'aka "') =~
- m/^(.*?)["«%]/o;
- ($gpg_bad) =
-- Locale::gettext::gettext('BAD signature from "%s"') =~
-+ Locale::gettext::gettext('BAD signature from "') =~
- m/^(.*?)["«%]/o;
- ($gpg_expired) =
- Locale::gettext::gettext("Note: This key has expired!\n") =~
- m/^(.*?)\n/mo;
- ($gpg_good) =
-- Locale::gettext::gettext('Good signature from "%s"') =~
-+ Locale::gettext::gettext('Good signature from "') =~
- m/^(.*?)["«%]/o;
- ($gpg_bug) =
- Locale::gettext::gettext("... this is a bug (%s:%d:%s)\n") =~
--- /dev/null
+--- t-prot 2005-05-08 19:50:44.000000000 +0200
++++ t-prot-G126 2005-05-08 19:54:42.000000000 +0200
+@@ -1013,16 +1013,16 @@
+ Locale::gettext::gettext("Can't check signature: %s\n") =~
+ m/^([^%]*)/;
+ ($gpg_aka) =
+- Locale::gettext::gettext((' 'x16).'aka "%s"') =~
++ Locale::gettext::gettext((' 'x16).'aka "') =~
+ m/^([^"«%]*)["«%]/;
+ ($gpg_bad) =
+- Locale::gettext::gettext('BAD signature from "%s"') =~
++ Locale::gettext::gettext('BAD signature from "') =~
+ m/^([^"«%]*)["«%]/;
+ ($gpg_expired) =
+ Locale::gettext::gettext("Note: This key has expired!\n") =~
+ m/^(.*)\n/m;
+ ($gpg_good) =
+- Locale::gettext::gettext('Good signature from "%s"') =~
++ Locale::gettext::gettext('Good signature from "') =~
+ m/^(([^"«%]*))["«%]/;
+ ($gpg_bug) =
+ Locale::gettext::gettext("... this is a bug (%s:%d:%s)\n") =~
--- /dev/null
+--- t-prot 2005-05-08 20:13:26.000000000 +0200
++++ t-prot-M157 2005-05-08 20:11:49.000000000 +0200
+@@ -32,7 +32,7 @@
+
+ $mutt_attachment $mutt_contenttype $mutt_pgpsigned $mutt_beginsigned
+ $mutt_pgpclearsigned $mutt_pgpclearsigstart $mutt_pgpencrypted
+- $mutt_pgpoutstart $mutt_pgpoutend
++ $mutt_pgpoutstart $mutt_pgpoutend $mutt_ssloutstart $mutt_ssloutend
+ );
+
+
+@@ -69,6 +69,8 @@
+ $mutt_pgpencrypted = '[-- End of PGP/MIME encrypted data --]';
+ $mutt_pgpoutstart = '[-- PGP output follows (current time:';
+ $mutt_pgpoutend = '[-- End of PGP output --]';
++$mutt_ssloutstart = '[-- OpenSSL output follows';
++$mutt_ssloutend = '[-- End of OpenSSL output --]';
+
+ # set the defaults to the C locale
+ $gpg_WARNING = 'WARNING: ';
+@@ -336,7 +338,7 @@
+ for (my $x=0; $x<scalar(@$L); $x++) {
+ if ($$V[$x]) { next; }
+
+- if ($$L[$x]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o)
++ if ($$L[$x]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E|\Q$mutt_ssloutstart\E)/o)
+ {
+ my $from;
+ for (my $m=0; $m<scalar(@$H); $m++) {
+@@ -363,7 +365,7 @@
+ splice(@$V, $i, 1);
+ $i--;
+ }
+- elsif ($$L[$i]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutend\E)/o)
++ elsif ($$L[$i]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutend\E|\Q$mutt_ssloutend\E)/o)
+ {
+ if ($pgpmove ||
+ ($pgpmovevrf && (!$sigint) && verified($L, $x+1, $i)))
+@@ -685,7 +687,7 @@
+ 'Forwarded message',
+ 'Weitergeleitete Nachricht / Forwarded Message');
+ my $k = 0; # any text above?
+- my $tmp = 0; # flagged if inside PGP output
++ my $tmp = 0; # flagged if inside PGP or SSL output
+
+ DONE: for ($x=0; $x<scalar(@$lines); $x++) {
+ if (!$vrb[$x]) {
+@@ -708,9 +710,11 @@
+ ((!$spass) || index($$lines[$x], $spass_prefix)!=0))
+ {
+ if ($mua eq 'mutt' && (!$tmp) &&
+- $$lines[$x] =~
+- /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o) {
+- $tmp = 1;
++ ($$lines[$x] =~
++ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o ||
++ $$lines[$x] !~
++ /^(?:\e[^\a]+\a)?(?:\Q$mutt_ssloutstart\E)/o)) {
++ $tmp = 1;
+ } elsif ($mua eq 'mutt' && $tmp &&
+ ($$lines[$x] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_beginsigned\E)/o ||
+@@ -982,7 +986,7 @@
+ m/^([^%]*)/;
+ ($mutt_pgpsigned) =
+ Locale::gettext::gettext("[-- End of signed data --]\n") =~
+- m/^(.*)\n/m;
++ m/^\n*(.*)\n/m;
+ ($mutt_beginsigned) =
+ Locale::gettext::gettext("[-- The following data is signed --]\n\n") =~
+ m/^(.*)\n/m;
+@@ -990,16 +994,24 @@
+ Locale::gettext::gettext("[-- END PGP SIGNED MESSAGE --]\n") =~
+ m/^(.*)\n/m;
+ ($mutt_pgpclearsigstart) =
+- Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\n") =~
++ Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\n\n") =~
+ m/^(.*)\n/m;
+ ($mutt_pgpencrypted) =
+ Locale::gettext::gettext("[-- End of PGP/MIME encrypted data --]\n") =~
+ m/^(.*)\n/m;
+ ($mutt_pgpoutstart) =
+- Locale::gettext::gettext("[-- PGP output follows (current time: %c) --]\n") =~
+- m/^([^%]*)/;
++ Locale::gettext::gettext("[-- %s output follows%s --]\n") =~
++ m/^(.*)%s/;
++ $mutt_pgpoutstart =~ s/%s/PGP/;
+ ($mutt_pgpoutend) =
+- Locale::gettext::gettext("[-- End of PGP output --]\n") =~
++ Locale::gettext::gettext("[-- End of PGP output --]\n\n") =~
++ m/^(.*)\n/m;
++ ($mutt_ssloutstart) =
++ Locale::gettext::gettext("[-- %s output follows%s --]\n") =~
++ m/^(.*)%s/;
++ $mutt_ssloutstart =~ s/%s/OpenSSL/;
++ ($mutt_ssloutend) =
++ Locale::gettext::gettext("[-- End of OpenSSL output --]\n\n") =~
+ m/^(.*)\n/m;
+
+ Locale::gettext::textdomain('gnupg');
-% $Id: t-prot.sl,v 1.14 2005/03/31 19:39:08 jochen Exp $
-% Copyright (c) 2003 Jochen Striepe <t-prot@tolot.escape.de>
+% $Id: t-prot.sl,v 1.16 2005/05/10 13:09:06 jochen Exp $
+% Copyright (c) 2003-2005 Jochen Striepe <t-prot@tolot.escape.de>
%
% This file is provided as an example implemention for articles to be
% filtered through t-prot before displayed. They are still filtered if
% these should be reasonable defaults (they work fine for me, SCNR):
variable t_prot_params = "-aceklmtS --diff --bigq -L$HOME/.slrn/mlfooters -A$HOME/.slrn/adfooters";
-variable t_prot_tmpdir = "$HOME/tmp/slrn";
+variable t_prot_tmpdir = "$HOME/tmp/slrn"; % you better make sure it exists
variable t_prot_qp = "perl -i -p -e '$p=1 if /^Content-Transfer-Encoding: quoted-printable/i; if ($p==1) { s/=([0-9a-f][0-9a-f])/chr(hex($1))/egi; s/=\n//eg; };'";
define t_prot () {
#!/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';
($$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) &&
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++;
}
for (my $x=0; $x<scalar(@$L); $x++) {
if ($$V[$x]) { next; }
- if ($$L[$x]=~/^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E)/o)
+ if ($$L[$x]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o)
{
my $from;
for (my $m=0; $m<scalar(@$H); $m++) {
- if ($$H[$m] =~ /^From:/) {
+ if (index($$H[$m], 'From:')==0) {
$from = $$H[$m];
$m++;
while (exists($$H[$m]) && $$H[$m] =~ /^\s/) { $from .= $$H[$m]; $m++; }
last;
}
}
- ($from) = $from=~m/([a-z\d][a-z_\d\+-\.]*\@(?:[a-z_\d\+-\.]+\.)+[a-z]{2,})/i;
+ ($from) = $from=~m/(\w[\w.+-]*@(?:[\w.+-]+\.)+[A-Za-z]{2,})/;
my $uid = 1;
for (my $i=$x+1; $i<scalar(@$L); $i++) {
- if ($pgpshort && $$L[$i] =~ /^gpg:\s\Q$gpg_aka/o) { $uid++; }
+ if ($pgpshort && index($$L[$i], "gpg: $gpg_aka")==0)
+ { $uid++; }
if ($pgpshort && $uid>1 &&
- $$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)))
}
}
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(@{$tmp[$tmp]}); $i++) {
# not, we are done - non-text messages are not our business).
if ($mua ne 'mutt') {
for ($x=0; $x<scalar(@hdr); $x++) {
- if ($hdr[$x] =~ /^Content-Type:\s+(.*)$/i) {
+ if ($hdr[$x] =~ /^Content-[Tt]ype:\s+(.*)$/) {
my $foo = $1;
- if ($foo =~ /^multipart\//i) {
+ if ($foo =~ m!^multipart/!) {
undef $foo;
if ($hdr[$x] =~ /\Wboundary="([^"]+)"/i) { $foo = $1; }
my $bar = 'text/plain';
for ($x++; $x<@$lines && $$lines[$x]!~/^$/; $x++)
{
- if ($$lines[$x] =~ /^Content-Type:\s+(.*)/i) {
+ if ($$lines[$x] =~ /^Content-[Tt]ype:\s+(.*)/) {
$bar = $1;
}
}
if ($x>=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) {
for ($x=0; $x<scalar(@$lines); $x++) {
if (!$vrb[$x]) {
$z++;
- if ($$lines[$x] =~ /^$indent/) { $y++; }
+ if (index($$lines[$x], $indent)==0) { $y++; }
}
}
$y = $y/$z;
if ($vrb[$x]) { next; }
# The following regexp's are quite ugly because for most users
# these lines are coloured using termcap... (bah!)
- if (($$lines[$x] =~ /^(?:\e.+?\a)?\Q$mutt_attachment\E(\d+)(?::.*)? \-\-\]/o &&
+ if (($$lines[$x] =~
+ /^(?:\e[^\a]+\a)?\Q$mutt_attachment\E(\d+)/o &&
(($1 ne '1') ||
($x<$#$lines &&
- $$lines[$x+1] !~ /^(?:\e.+?\a)?(?:\Q$mutt_contenttype\E)(?:text\/plain|application\/pgp)/io))) ||
- ($$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpsigned\E|\Q$mutt_pgpclearsigned\E|\Q$mutt_pgpencrypted\E)/o))
+ $$lines[$x+1] !~ m!^
+ (?:\e[^\a]+\a)?
+ (?:\Q$mutt_contenttype\E)
+ (?:text/plain|application/pgp)
+ !ox))) ||
+ ($$lines[$x] =~ /^
+ (?:\e[^\a]+\a)?
+ (?:\Q$mutt_pgpsigned\E |
+ \Q$mutt_pgpclearsigned\E|
+ \Q$mutt_pgpencrypted\E)
+ /ox))
{
# Strip attachments to prepare further processing
unshift(@att, @$lines[$x..$#$lines]);
splice(@$lines, $x);
# Try to fix trailing empty lines
- while (scalar(@$lines) && $$lines[$#$lines] =~ /^(?:\e.+?\a)?\s*$/) {
+ while (scalar(@$lines) && $$lines[$#$lines] =~
+ /^(?:\e[^\a]+\a)?\s*$/) {
unshift(@att, pop(@$lines));
}
# situations.
# The following regexp is quite ugly because for most
# users the line is coloured using termcap... (bah!)
- if ($att[$x]=~/^(?:\e.+?\a)?\Q$mutt_attachment\E\d+.* --\]/o &&
- $att[$x+1] =~ /^(?:\e.+?\a)?(?:\Q$mutt_contenttype\E)message\/rfc822/o)
+ if ($att[$x] =~
+ /^(?:\e[^\a]+\a)?\Q$mutt_attachment\E\d+/o &&
+ $att[$x+1] =~ m!^
+ (?:\e[^\a]+\a)?
+ (?:\Q$mutt_contenttype\E) message/rfc822
+ !ox)
{
$x += 2;
while ($att[$x] !~ /^\s*$/) { $x++; }
if ((!$vrb[$x]) && $$lines[$x] =~ /^-- $/) {
if ($diff) {
for (my $i=1; $x+$i+1<scalar(@$lines); $i++) {
- if ($$lines[$x+$i] =~ /^\-\-\-\s+\S/ &&
- $$lines[$x+$i+1] =~ /^\+\+\+\s+\S/)
+ if ($$lines[$x+$i] =~ /^-{3}\s+\S/ &&
+ $$lines[$x+$i+1] =~ /^\+{3}\s+\S/)
{
$sig = 0;
unshift(@sig, @$lines[$x..$#$lines]);
if ((!$k) && $$lines[$x] !~ /^\s*$/o &&
((!$mua) ||
($mua eq 'mutt' &&
- $$lines[$x] !~ /^(?:\e.+?\a)?(?:\Q$mutt_attachment\E)/o &&
- $$lines[$x] !~ /^(?:\e.+?\a)?(?:\Q$mutt_contenttype\E)/o)) &&
- ((!$spass) || $$lines[$x]!~/^\Q$spass_prefix/o))
+ $$lines[$x] !~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_attachment\E)/o &&
+ $$lines[$x] !~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_contenttype\E)/o)) &&
+ ((!$spass) || index($$lines[$x], $spass_prefix)!=0))
{
if ($mua eq 'mutt' && (!$tmp) &&
- $$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpoutstart\E)/o) {
+ $$lines[$x] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o) {
$tmp = 1;
} elsif ($mua eq 'mutt' && $tmp &&
- ($$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_beginsigned\E)/o ||
- $$lines[$x] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpclearsigstart\E)/o)) {
+ ($$lines[$x] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_beginsigned\E)/o ||
+ $$lines[$x] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpclearsigstart\E)/o)) {
$tmp = 0;
} elsif (!$tmp) {
$k = 1;
my $p = 0; # levels of pgp signed parts
for (my $i=$x+1; $i<scalar(@$lines); $i++) {
- if ($$lines[$i] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpclearsigstart\E)/o) {
+ if ($$lines[$i] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpclearsigstart\E)/o) {
$p++;
}
}
if ($p) {
STAIRS: for (my $i=0; $i<scalar(@att); $i++) {
- if ($p==0 && $att[$i] =~ /^(?:\e.+?\a)?\[\-\-\ /o) {
+ if ($p==0 && $att[$i] =~ /^(?:\e[^\a]+\a)?\[-- /o) {
splice(@att, 0, $i);
unshift(@att, "\n");
goto CLEAN;
- } elsif ($att[$i] =~ /^(?:\e.+?\a)?(?:\Q$mutt_pgpclearsigned\E)/o) {
+ } elsif ($att[$i] =~
+ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpclearsigned\E)/o) {
splice(@att, 0, $i+1);
$p--;
goto STAIRS;
# Care for punctuation abuse:
if ($elli) {
for ($x=0; $x<scalar(@$lines); $x++) {
- if (!$vrb[$x]) { $$lines[$x] =~ s/(([.?!])\2\2)\2+/$1/eg; }
+ if (!$vrb[$x]) { $$lines[$x] =~ s/(([.?!])\2\2)\2+/$1/g; }
}
}
Locale::gettext::textdomain('mutt');
($mutt_attachment) =
Locale::gettext::gettext("[-- Attachment #%d") =~
- m/^([^%]*)/o;
+ m/^([^%]*)/;
($mutt_contenttype) =
Locale::gettext::gettext("[-- Type: %s/%s, Encoding: %s, Size: %s --]\n") =~
- m/^([^%]*)/o;
+ m/^([^%]*)/;
($mutt_pgpsigned) =
Locale::gettext::gettext("[-- End of signed data --]\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($mutt_beginsigned) =
Locale::gettext::gettext("[-- The following data is signed --]\n\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($mutt_pgpclearsigned) =
Locale::gettext::gettext("[-- END PGP SIGNED MESSAGE --]\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($mutt_pgpclearsigstart) =
Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($mutt_pgpencrypted) =
Locale::gettext::gettext("[-- End of PGP/MIME encrypted data --]\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($mutt_pgpoutstart) =
Locale::gettext::gettext("[-- PGP output follows (current time: %c) --]\n") =~
- m/^([^%]*)/o;
+ m/^([^%]*)/;
($mutt_pgpoutend) =
Locale::gettext::gettext("[-- End of PGP output --]\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
Locale::gettext::textdomain('gnupg');
($gpg_WARNING) =
Locale::gettext::gettext("WARNING: using insecure random number generator!!\n") =~
- m/^(.*?: )/o;
+ m/^([^:]*: )/;
($gpg_Warning) =
Locale::gettext::gettext("WARNING: message was encrypted with a weak key in the symmetric cipher.\n") =~
- m/^(.*?: )/o;
+ m/^([^:]*: )/;
($gpg_Cantcheck) =
Locale::gettext::gettext("Can't check signature: %s\n") =~
- m/^([^%]*)/o;
+ m/^([^%]*)/;
($gpg_aka) =
Locale::gettext::gettext((' 'x16).'aka "%s"') =~
- m/^(.*?)["«%]/o;
+ m/^([^"«%]*)["«%]/;
($gpg_bad) =
Locale::gettext::gettext('BAD signature from "%s"') =~
- m/^(.*?)["«%]/o;
+ m/^([^"«%]*)["«%]/;
($gpg_expired) =
Locale::gettext::gettext("Note: This key has expired!\n") =~
- m/^(.*?)\n/mo;
+ m/^(.*)\n/m;
($gpg_good) =
Locale::gettext::gettext('Good signature from "%s"') =~
- m/^(.*?)["«%]/o;
+ m/^(([^"«%]*))["«%]/;
($gpg_bug) =
Locale::gettext::gettext("... this is a bug (%s:%d:%s)\n") =~
- m/^([^%]*)/o;
+ m/^([^%]*)/;
}
}
-.\" $Id: t-prot.1,v 1.99 2005/04/15 14:03:39 jochen Exp $
+.\" $Id: t-prot.1,v 1.115 2005/05/13 00:06:10 jochen Exp $
.\"
-.TH T-PROT "1" "Apr 2005" "T-PROT"
+.TH T-PROT "1" "May 2005" "T-PROT"
.SH NAME
-t-prot \- TOFU Protection - Display Filter for RFC 822 messages
+t-prot \- TOFU Protection - Display Filter for RFC 2822 messages
.SH SYNOPSIS
.BI "t-prot [" OPTIONS "]..."
.SH DESCRIPTION
.PP
-This program is a filter which shall improve the readability
-for messages (emails and posts) by *hiding* some annoying parts,
+This program is a filter which shall improve the readability for
+messages (emails and usenet postings) by *hiding* some annoying parts,
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 it's successor, RFC 2822. Messages
-conforming to RFCs 2045, 2046 and 2049 should be treated reasonably
-correct.
+message conforming to RFC 822 or its successor, RFC 2822. 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
Defaults are 30 for n and 10 for x.
.TP
.B "\-\-body"
-Input consists just of the message's body. There are no RFC 822 header
+Input consists just of the message's body. There are no RFC 2822 header
lines.
-.br
+.IP
.IR NOTE :
This does not work with --pgp-short, and multipart messages will not
be detected due to missing headers.
With this option enabled t-prot makes footer detection really greedy: We
assume that commercial email providers aren't even frightened to append
changing texts *under* their ads which are appended to the message body.
-Because these texts even have changing *lengths* we simply detect the
+Because these texts even have changing lengths we simply detect the
lines of the footer *anywhere* in the body of the message and assume that
everything below belongs to the footer. (Man, if life where always that
easy! ;)
.TP
.B "\-k"
"anti Kammquote":
-Tries to fix those broken zig-zag-shaped lines wrapped around by some MUAs
-which are known as "Kammquoting" in German.
-.sp
-Note: This option is considered stable by now. However, sometimes Kammquotes
-should have been removed but weren't. Please send a bug report if this happens
-to you (after carefully reading the BUGS file, that is).
+Tries (not too aggressively) to fix those broken zig-zag-shaped lines
+wrapped around by some MUAs which are known as "Kammquoting" in German.
+.IP
+.IR NOTE :
+This option is considered stable by now. However, sometimes Kammquotes
+should have been removed but weren't. Please send a bug report if this
+happens to you (after carefully reading the BUGS file, that is).
+.IP
+Please also note that enabling this option is quite a performance hit.
.TP
.BR "\-\-kminl" =n
-Minimum line length for wrapped line detection on Kammquotes. Umm, don't
-know how to explain this well without describing the complete algorithm
-used. Please see the code.
+Minimum line length for wrapped line detection on Kammquotes. For
+details, please see the source code.
.br
Anyway, lower values make the algorithm more aggressive, higher values
make Kammquotes harder to detect. Default is 65.
.BR "\-k" .
.TP
.BR "\-\-kmaxl" =n
-Maximum line length for wrapped line detection on Kammquotes. Umm, don't
-know how to explain this well without describing the complete algorithm
-used. Please see the code.
+Maximum line length for wrapped line detection on Kammquotes. For
+details, please see the source code.
.br
Anyway, higher values make the algorithm more aggressive, lower values
make Kammquotes harder to detect. Default is 80.
.TP
.BR "\-\-kdiff" =n
Minimum length difference between two lines for wrapped line detection on
-Kammquotes. Umm, don't know how to explain this well without describing
-the complete algorithm used. Please see the code.
+Kammquotes. For details, please see the source code.
.br
Anyway, lower values make the algorithm more aggressive, higher values
make Kammquotes harder to detect. Default is 20.
.I "Locale::gettext"
for this feature.
.sp
-.IR Note :
+.IR NOTE :
If you use
.B mutt
or
.B gnupg
with locales, t-prot will only work correctly if you specify the corresponding
-locale string.
+locale string. Alternatively, you can use the environment variables
+.IR LC_ALL ,
+.IR LC_MESSAGES ,
+or
+.I LANG
+to specify the locale string.
.sp
-.IR "Note also" :
+.IR "NOTE also" :
You also have to make sure you are running t-prot
with matching
.B gnupg
more likely to notice. Requires
.BR "\-Mmutt" .
.sp
-.IR Note :
+.IR NOTE :
If gpg is terminated before finished (e.g. hitting Ctrl-C, or using
.IR kill (1)),
we cannot always detect if the check was interrupted. Though t-prot tries
.BR "\-S" [=n]
"supression of overlong signatures":
Signatures are to be n lines (not including the one containing dash-dash-space)
-or less. If there are more, it is probably not that spirited after all. So
-with this option you trade it for a
+or less. If there are more, it is probably not that spirited after all.
+So with this option you trade it for a
.B truely
nice line.
.br
-If no n is given, default is 4. (\fINote\fR: We do not recommend using a
-value other than 4. Consider this old-fashioned, but we actually do *like*
-RFC conformance.)
+If no n is given, default is 4. (We do not recommend using a value other
+than 4. Consider this old-fashioned, but we actually do *like* RFC
+conformance.)
.sp
-.IR Note :
+.IR NOTE :
The line containing "-- " ist not counted when testing for an overlong
signature, but it is included when displaying how many lines were deleted.
.TP
.B "\-v, \-\-version"
"version info":
Prints the current version number and release date, and exit.
+.SH ENVIRONMENT
+The environment variables
+.IR LC_ALL ,
+.IR LC_MESSAGES ,
+and
+.I LANG
+are read and respected when interpreting output by mutt or gnupg
+(unless they are overruled by the --locale option). T-prot's own
+output is English regardless of any locale setting.
.SH TOFU?
TOFU is an abbreviation which mixes German and English words;
it expands to "text oben, full-quote unten" which means
.TP
.IR Q :
I want to make my mailing list footer files match more different mailing
-list footers. Can I use regular expressions, or how can I accomplish that?
+list footers. Can I use regular expressions, or how can I accomplish
+that?
.TP
.IR A :
-Nope, regexp's do not work here. The comparison is made by the perl builtin
+Nope, regexp's do not work here. The comparison is made by the perl
+builtin
.IR index ()
function (see
.B perldoc
#v-
.br
Text coming now is not.
-.SH AUTHOR AND COPYRIGHT
+.SH AUTHOR
Written by Jochen Striepe <t-prot@tolot.escape.de>.
-.br
-Copyright \(co 2001-2005 Jochen Striepe.
+.SH COPYRIGHT
+All of the documentation and software included in the t-prot releases
+is copyrighted by Jochen Striepe.
+.PP
+Copyright \(co 2001-2005 Jochen Striepe. All rights reserved.
+.PP
+Redistribution and use, with or without modification, are permitted
+provided that the following conditions are met:
.PP
-This is free software; you may use the source to whatever you like.
-Just keep in mind to mention the original source of the script and the manpage
-when you give it away. There is NO warranty; not even for MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+.PP
+2. All advertising materials mentioning features or use of this software
+must display the following acknowledgement:
+.PP
+ This product includes software developed by Jochen Striepe and others.
+.PP
+3. Neither the name of the author nor the names of any contributors may
+be used to endorse or promote products derived from this software without
+specific prior written permission.
+.PP
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+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
in order to keep the responses to his cancel bot reasonably short. The
entire inspiration for this hack came from the "TOFU protection" line of
his script on many usenet postings.
-.SH AVAILIBILITY
+.SH AVAILABILITY
You can get the latest version from
.IR http://www.escape.de/users/tolot/mutt/ .
.SH BUGS
or even attachments begin and end is plainly embedded in the text, not
really cleanly recognizeable for t-prot. The problem should be worked
around by now, please send a bug report if it does not work for you.
-.PP
-There probably are many more bugs in this piece of software. Feel free to
-fix them - it's
-.BR perl ,
-so you have the sources. Ah, and while you're at it, please drop a note to
-the author - thanks in advance!
.SH "REPORTING BUGS"
-Please send your bug report to <t-prot-bugs@tolot.escape.de>.
+Please do
+.I not
+report a bug if
+.br
+ * you found it in the TODO file coming with the distribution. We do
+know those and try to fix them as soon as possible.
+.br
+ * you have an old t-prot version. If you encounter a problem, first
+see if there is a new t-prot version which fixes the issue. If you
+upgraded to the latest version and it still occurs, a bug report is
+just great.
+.PP
+If you noticed a bug when processing a message and want to provide the
+t-prot team with some useful info, please:
+.br
+ * if invoking t-prot by mutt's
+.I display_filter
+facility, just set display_filter to something like
+.IP
+"tee ~/foobar | t-prot <your options>"
+.PP
+and include ~/foobar in the bug report -- this way we might reproduce
+the bug much easier if you are using a different environment than we do.
+.br
+ * provide information on what command line options you use t-prot
+with, what perl version t-prot runs on your system, and what else might
+be important to enable us reproducing the bug.
+.PP
+Send your bug report to
+.IR <t-prot-bugs@tolot.escape.de> .
+Thank you.
.SH TODO
Fix bugs (see the
.I BUGS
section). Beside that, all main features should be implemented by now.
+See the TODO file for more information.
.SH "SEE ALSO"
.BR mutt (1),
.BR muttrc (5)
and the part about "display_filter",
.BR perl (1),
.BR aliases (5),
-RFCs 822, 2045, 2046, 2049, and 2822,
+RFCs 2045-2049 and 2822,
.I http://got.to/quote/
(German language),
.I http://www.river.com/users/share/etiquette/edit.html