t-prot-2.101/0000755000175000001440000000000011463250307012130 5ustar jochenuserst-prot-2.101/contrib/0000755000175000001440000000000011463250307013570 5ustar jochenuserst-prot-2.101/contrib/README.examples0000644000175000001440000000176311463250307016274 0ustar jochenusersT-PROT EXAMPLES =============== Here are some examples on how to use t-prot effectively with other programs. muttrc.t-prot ============= You can use the `source' statement to include this into your mutt[1] configuration file -- /etc/Muttrc system-wide, or ~/.muttrc for your very personal configuration. mailcap.t-prot, nailrc.t-prot ============================= Nice and small one-line configuration examples showing how to set up metamail and Heirloom mailx ("nail") to use t-prot filtering. t-prot.sl ========= A small S-Lang macro to show how to use t-prot from within slrn[2]. Please note that there are still some problems with this macro -- see the TODO file for details. filter_innd.pl ============== An example for using t-prot to reject messages containing TOFU or excessive quoting by your INN2. Many thanks to Martin Dietze (who gave me the whole idea)[3]. Links: ====== [1] http://www.mutt.org/ [2] http://slrn.sourceforge.net/ [3] http://www.fh-wedel.de/pub/fh-wedel/staff/herbert/linux/ t-prot-2.101/contrib/README.patches0000644000175000001440000001060711463250307016102 0ustar jochenusersT-PROT PATCHES ============== 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 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 specific patch because you *need* it. Remember, filtering is a trade-off. If *many* people need a specific patch, odds are high for it to be included into vanilla t-prot, even though there are some drawbacks with it. If you keep silent, the patch will be dropped at some time, because noone seems to need it. 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. PERMANENT PATCHES ================= These patches are updated as need be, as several distributions (that is, their t-prot package maintainers) use them to adapt t-prot to the distribution's environment. They will _not_ get dropped just because nobody bugs me. :) Users: 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 Slang, mutt and gnupg versions). t-prot-*-mutt15*.diff and t-prot-*-gpg1*.diff ============================================= You want to be on the bleeding edge, using a developer version of mutt? Your distribution provides just an outdated version of gnupg? No problem, these patches add the locales needed for them to work 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. t-prot.sl-slang2.diff ===================== Patch by Gregor Herrmann, making t-prot.sl run with Slang-2. RECENT PATCHES ============== none OBSOLETE PATCHES ================ t-prot-*-gol.diff (2nd version) =============================== This patch has been incorporated in t-prot since version 2.95, when Getopt::Mixed would have broken existing configurations with the new behaviour of the -c command line switch. The performance issues are still not solved, though, so if you have an idea how to improve the performance of Getopt::Long, please drop a note. t-prot-*-adjtz.diff =================== This patch has been dropped. Noone seems to make use of it, and it depends on an external program (GNU date) that may not be available everywhere. Running this program and loading another additional Perl Module also decreases performance. t-prot-*-debug.diff =================== This patch is no longer available -- it seems most users find it too hard to apply it and include the resulting debug output to their bug report. Thanks to everyone who sent bug reports or gave feedback. t-prot-*-deb.unstable.diff ========================== This patch is no longer available. Please use t-prot-*-mutt15*.diff (or any newer replacements) for this purpose. Ah yes, and thanks to the authors of the mutt and gnupg po files for providing enough work and inconsistencies for me never to get bored. t-prot-*-ftr.diff ================= This patch is no longer available -- starting with v1.12 it is merged into vanilla t-prot. Thanks to everyone who sent bug reports or gave feedback. t-prot-*-gol.diff (first version) ================================= This patch is no longer available. The feedback to Debian Bug #193937 came only from two people: the Debian package maintainer, and the original poster of the bug report. The opinion of both of them is very appreciated, but since there came no feedback from *anyone* else, I think the vast majority of users has no interest in switching to Getopt::Long. Furthermore (as stated before), I see no benefits in using Getopt::Long over Getopt::Mixed as long as the latter is working and available at CPAN. t-prot-*-indentms.diff ====================== This patch has been dropped, since noone seems to make use of it. t-prot-*-pgphack.diff ===================== This patch is no longer available -- starting with v0.90 it is merged into vanilla t-prot. Thanks to everyone who sent bug reports or gave feedback. t-prot-*-sigtrace.diff ====================== This patch has been dropped. Noone seems to use it, *and* it looks wiser to apply stripping directly to sigtrace. t-prot-2.101/contrib/filter_innd.pl0000644000175000001440000000450611463250307016427 0ustar jochenusers# $Id: filter_innd.pl,v 1.6 2010/01/05 12:01:13 jochen Exp $ # Copyright (c) 2004-2005 Jochen Striepe # # This file is provided as an example how t-prot can be used for # Perl filtering with INN2. It is NOT meant for production use. # Read the README.perl_hook coming with your version of INN2, and # adapt the script to your needs. # # Please see t-prot's man page for command line parameter details. # # Requirements/Bugs: mktemp(1) should be quite widely spread by # now -- if it is not installed on your system, get the sources # from Debian Linux or OpenBSD. Of course, rm(1) is POSIX and will # be present on any reasonably Unix-like system. # The script should not be run on any heavy-duty machines -- the # writes to /tmp will be costly when many articles are committed # at the same time. Sadly, there seems to be no really clean, # portable, and standard way to realize a two-way pipe with perl. # Please point me to some documentation if I am wrong. Thank you. :) # # License: This file is part of the t-prot package and therefore # available under the same conditions. See t-prot's man page for # details. # The whole idea is robbed from Martin Dietze -- see his version at # http://www.fh-wedel.de/pub/fh-wedel/staff/herbert/linux/ # Please note that there is no code copied from there, so the files # in the t-prot package are *not* available under the terms of the # GPL. sub filter_art { my $rval = "" ; # Assume we'll accept. Cannot be `0' # Here we only filter local.* news groups. Another useful idea is to # filter just locally submitted articles: # if (index($hdr{'Path'}, '!')<0) { if ($hdr{'Newsgroups'} =~ /^local\./) { my $foo = $hdr{'__BODY__'}; $foo =~ s/\r\n/\n/gs; # Note that here might be a security problem lurking. The directory # used for temporary files should not be writable for anyone but the # user INN runs as. As mentioned above, this example file is NOT # meant for production use. open(TMP, '/usr/bin/mktemp -q /tmp/INN2/tmp.XXXXXX | tr -d \'\n\'|') || return ''; my $f = ; close TMP; open(OUT, ">$f") || return ''; print OUT $foo; close OUT; open(IN, "/usr/bin/t-prot -m -t -p --body --check=ratio -i $f|") || goto FINISH; $rval = ; close IN; FINISH: unlink($f); } $rval ; } sub filter_mode { } sub filter_messageid { $rval = ''; $rval; } t-prot-2.101/contrib/mailcap.t-prot0000644000175000001440000000030511463250307016343 0ustar jochenusers# $Id: mailcap.t-prot,v 1.1 2010/03/04 18:45:52 jochen Exp $ # sample line for metamail(1) tools. Put this into your ~/.mailcap. text/plain; t-prot --body -mtS --bigq=5,2 -c1 -i %s; copiousoutput t-prot-2.101/contrib/muttrc.t-prot0000644000175000001440000000203211463250307016252 0ustar jochenusers# $Id: muttrc.t-prot,v 1.11 2010/02/19 16:21:14 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 -aelmtS -c --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 -aclmtS -c --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 -aelmtS -c --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 "^\\[---.*" color body green black "^#v[-+]" t-prot-2.101/contrib/muttrc.t-prot.m15120000644000175000001440000000170711463250307017026 0ustar jochenusers# 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/). # # The $my_tprot variable works since mutt-1.5.12, in older # versions you must copy its value in each macro. set my_tprot='t-prot -aelmtS -c --bigq -Mmutt --spass -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters' set display_filter=$my_tprot # 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='$my_tprot'\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='$my_tprot'; exec exit\n:exec display-message\n" "Turn TOFU protection on" # highlight TOFU protection: color body brightmagenta black "^\\[---.*" color body green black "^#v[-+]" t-prot-2.101/contrib/nailrc.t-prot0000644000175000001440000000034111463250307016205 0ustar jochenusers# $Id: nailrc.t-prot,v 1.1 2010/03/04 18:45:52 jochen Exp $ # Use t-prot together with Heirloom mailx(1) (aka "nail"). # Put something like this definition into your ~/.mailrc. set pipe-text/plain="t-prot --body -mtS --bigq" t-prot-2.101/contrib/t-prot-r1.238-gpg126.diff0000644000175000001440000000206511463250307017511 0ustar jochenusers--- 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") =~ t-prot-2.101/contrib/t-prot-r1.311-mutt1512.diff0000644000175000001440000001123011463250307017767 0ustar jochenusers--- t-prot 2010-10-31 11:13:22.000000000 +0100 +++ t-prot-mutt1520 2010-10-31 11:40:45.000000000 +0100 @@ -33,6 +33,7 @@ $mutt_attachment $mutt_contenttype $mutt_pgpsigned $mutt_beginsigned $mutt_pgpclearsigned $mutt_pgpclearsigstart $mutt_pgpencrypted $mutt_pgpoutstart $mutt_pgpoutend $mutt_pgpcryptend $mutt_pgpcryptstart + $mutt_ssloutstart $mutt_ssloutend ); @@ -74,6 +75,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: '; @@ -412,7 +415,7 @@ for (my $x=0; $x schrieb:'); 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 % % This file is provided as an example implemention for articles to be % filtered through t-prot before displayed. They are still filtered if % you reply to such a message so you will have to deactivate this if % you want to include quotes of the original article. % % Activate this macro by adding % interpret t-prot.sl % to your ~/.slrnrc. % % If you are not happy with the suggested t-prot default parameters, % put something like % variable t_prot_params = "-c -emtS"; % variable t_prot_tmpdir = "$HOME/.tmpdir"; % variable t_prot_qp = ""; % into ~/.slrn/t-prot-cfg and add % interpret .slrn/t-prot-cfg % to your ~/.slrnrc (after 'interpret t-prot.sl'). If "mimedecode" is % installed on your system you might want to use % variable t_prot_qp = "mimedecode"; % You can get mimedecode at % http://packages.debian.org/stable/mail/mimedecode.html % % However, please keep in mind that the path of the temp directory should % NOT be readable to other users -- otherwise it might reveal information on % what you read, and probably even be a security hole. Please see t-prot's % man page for details on command line parameters. % % If you want to toggle t-prot filtering on/off without leaving slrn, % you may want to add something like % setkey article register_t_prot "\e6" % setkey article unregister_t_prot "\e7" % to your ~/.slrnrc -- press ESC-6 to activate t-prot filtering, and % ESC-7 to disable it (this will take effect on the next article you % read, see the package's TODO file). % % Requirements/Bugs: tr(1) and rm(1) are POSIX and should be available % on any Unix-like system, mktemp(1) should be available on any recent % OpenBSD or Debian Linux system -- you can get the sources there % if your system happens to lack this program. This macro has been % tested with slrn-0.9.7.4 to slrn-0.9.8.0 and S-Lang v1.4.5, it might % fail with other versions (and will definitely fail with S-Lang v2.x). % As always, bug reports, patches (preferrably in unified diff format), % comments and suggestions are welcome. % % License: This file is part of the t-prot package and therefore % available under the same conditions. See t-prot's man page for % details. % these should be reasonable defaults (they work fine for me, SCNR): variable t_prot_params = "-aeklmtc -S --diff --bigq -L$HOME/.slrn/mlfooters -A$HOME/.slrn/adfooters"; 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 () { variable art, f, fname, line, qp; art = ""; % Keep in mind that the path should NOT be readable to other users -- % otherwise it might reveal information on what you read, and probably % even be a security hole: f = popen ("mktemp -q "+t_prot_tmpdir+"/t-prot.sl.XXXXXX | tr -d '\n'", "r"); if (f == NULL) return; if (-1 == fgets (&fname, f)) return; pclose (f); if (t_prot_qp != "") { qp = t_prot_qp+"|"; } else { qp = ""; } f = popen (qp+"t-prot "+t_prot_params+" >"+fname, "w"); if (f == NULL) { error ("Unable to filter article to "+fname); return; } () = fputs (article_as_string(), f); () = pclose (f); f = fopen (fname, "r"); if (f == NULL) { error (fname+" could not be opened."); return; } while (-1 != fgets (&line, f)) { art = art + line; } fclose (f); if (0 != remove(fname)) error ("Unable to remove "+fname); replace_article (art); } define register_t_prot () { if (1 == register_hook("read_article_hook", "t_prot")) { error("t-prot filtering activated"); } else { error("t-prot filtering NOT activated"); } } define unregister_t_prot () { if (1 == unregister_hook("read_article_hook", "t_prot")) { error("t-prot filtering deactivated"); } else { error("t-prot filtering NOT deactivated"); } } % filtering is enabled by default: register_hook("read_article_hook", "t_prot"); t-prot-2.101/contrib/t-prot.sl-slang2.diff0000644000175000001440000000252611463250307017455 0ustar jochenusersPatch 2005-12-23 (c) by Gregor Herrmann, making t-prot.sl run with slang2. His comment: | After some fiddling around and reading manuals I found a workaround: | replace "error" by "message". | I don't know if this is the canonical solution but at least the | errors are gone :-) --- t-prot.sl.2.0.2-1 2005-12-23 19:20:43.000000000 +0100 +++ t-prot.sl 2005-12-23 19:21:24.000000000 +0100 @@ -73,3 +73,3 @@ if (f == NULL) { - error ("Unable to filter article to "+fname); + message ("Unable to filter article to "+fname); return; @@ -82,3 +82,3 @@ if (f == NULL) { - error (fname+" could not be opened."); + message (fname+" could not be opened."); return; @@ -90,3 +90,3 @@ - if (0 != remove(fname)) error ("Unable to remove "+fname); + if (0 != remove(fname)) message ("Unable to remove "+fname); @@ -97,6 +97,6 @@ if (1 == register_hook("read_article_hook", "t_prot")) { - error("t-prot filtering activated"); + message ("t-prot filtering activated"); } else { - error("t-prot filtering NOT activated"); + message ("t-prot filtering NOT activated"); } @@ -106,6 +106,6 @@ if (1 == unregister_hook("read_article_hook", "t_prot")) { - error("t-prot filtering deactivated"); + message ("t-prot filtering deactivated"); } else { - error("t-prot filtering NOT deactivated"); + message ("t-prot filtering NOT deactivated"); } t-prot-2.101/t-prot0000755000175000001440000013346011463250307013312 0ustar jochenusers#!/usr/bin/perl -w # $Id: t-prot,v 1.312 2010/10/31 11:18:15 jochen Exp $ require 5.006; use strict; use Fcntl qw(O_EXCL O_WRONLY O_CREAT); use Getopt::Long qw(:config gnu_getopt no_ignore_case); use constant VER => '2.101'; use constant REV => ''; use constant REL => q$Revision: 1.312 $=~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'; # From # (you might have to adjust those if your libc wants different values) use constant EX_OK => 0; use constant EX_USAGE => 64; use constant EX_DATAERR => 65; use constant EX_UNAVAILABLE => 69; use constant EX_SOFTWARE => 70; use constant EX_IOERR => 74; use constant EX_BOUNCE => EX_UNAVAILABLE; use vars qw( $ad $ads $bigqn $bigqx $boun $check $check_ratio $cr $crshrink $diff $elli $fixind $footers $ftr_ad $ftr_ml $hdrs $indent $kamm $kdiff $kminl $kmaxl $lax $lsig $maxsig $maxlines $mda $ml $gw $ms $ms_smart $msg_quote $msg_ratio $mua $nohdr $ofile $pgpshort $pgpmove $pgpmovevrf $reply $sani $sig $sigint $sign $spass $spass_prefix $sysl $trad $trsp $gpg_WARNING $gpg_Warning $gpg_Cantcheck $gpg_aka $gpg_bad $gpg_expired $gpg_good $gpg_bug $mutt_attachment $mutt_contenttype $mutt_pgpsigned $mutt_beginsigned $mutt_pgpclearsigned $mutt_pgpclearsigstart $mutt_pgpencrypted $mutt_pgpoutstart $mutt_pgpoutend $mutt_pgpcryptend $mutt_pgpcryptstart ); # 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 $crshrink = 2; # multiple blank lines are shrunk to $crshrink lines $indent = '>'; # Indent string to identify a quoted line $kminl = 65; # see decomb() for details $kmaxl = 80; $kdiff = 20; $pgpshort = 0; # hide pgp key ids if set $pgpmove = 0; # move pgp output to bottom if set $pgpmovevrf = 0; $sign = 1; # max number of sigs tolerated, undef for no limit $boun = "Blocked by $0: This user does not accept TOFUed email. Please see and for more info. Have a nice day!\n"; $ftr_ad = undef; # too hard on performance to be default $ftr_ml = undef; # too hard on performance to be default $ofile = '-'; # use STDOUT if nothing is specified $spass_prefix = 'SPAM: '; $check_ratio = 0; # off by default $msg_quote = "Blocked by $0: This message has been rejected because of a full quote. Please see http://learn.to/quote/ and http://www.escape.de/users/tolot/mutt/ for more info. Have a nice day!\n"; $msg_ratio = "Blocked by $0: This message has been rejected because of excessive quoting. Please see http://learn.to/quote/ and http://www.escape.de/users/tolot/mutt/ for more info. Have a nice day!\n"; # end of user adjusted vals # set the defaults to the C locale $mutt_attachment = '[-- Attachment #'; $mutt_contenttype = '[-- Type: '; $mutt_pgpsigned = '[-- End of signed data --]'; $mutt_beginsigned = '[-- The following data is signed --]'; $mutt_pgpclearsigstart = '[-- BEGIN PGP SIGNED MESSAGE --]'; $mutt_pgpcryptend = '[-- END PGP MESSAGE --]'; $mutt_pgpcryptstart = '[-- BEGIN PGP MESSAGE --]'; $mutt_pgpclearsigned = '[-- END PGP SIGNED MESSAGE --]'; $mutt_pgpencrypted = '[-- End of PGP/MIME encrypted data --]'; $mutt_pgpoutstart = '[-- PGP output follows (current time:'; $mutt_pgpoutend = '[-- End of PGP output --]'; # set the defaults to the C locale $gpg_WARNING = 'WARNING: '; # (yes, the translations in gnupg's po files *are* braindamaged): $gpg_Warning = 'WARNING: '; $gpg_Cantcheck = 'Can\'t check signature: '; $gpg_aka = ' aka '; $gpg_bad = 'BAD signature from '; $gpg_expired = 'Note: This key has expired!'; $gpg_good = 'Good signature from'; # (actually, this bugs me quite often since upgrading gpg from v1.0.7): $gpg_bug = '... this is a bug ('; # help(): print help text and exit with appropriate exit code sub help { print "Usage: $0 [options] -A=DIRECTORY ad footer directory, treat ad footers as signature -a remove ad footers; requires -A --bigq[=n[,x]] remove all but x lines of quotes with more than n lines; default is n=30 and x=10 --body input has no headers; does not work with --pgp-short; multipart messages will not be detected -c[=n] merge multiple blank lines to n lines (default is 2) --check[=FLAGS] check various criteria, print error message and quit; see man page for details -d, --debug print notice to syslog when bouncing; requires -p --diff tolerate diffs -e force ellipsis for excessive punctuation --fixind fix quotes to adhere to RFC 3676 --ftr-ad enable aggressive ad footer matching; requires -A --ftr-ml enable aggressive mailing list footer matching; req. -L --groupwise delete Novell Groupwise style TOFU -h, --help show this short help and exit -i=INFILE file to be read; '-' for STDIN (default) -k try to fix \"Kammquotes\" --kdiff=n max. length difference between wrapped lines; req. -k --kmaxl=n max. line length for wrapped line; requires -k --kminl=n min. line length for wrapped line; requires -k -L=DIRECTORY mailing list footer directory, treat mailing list footers as signature -l delete mailing list footer; requires -L --lax-security use unsafe writing method; USE ON YOUR OWN RISK! --locale=LOCALE internationalization; currently only used with -Mmutt -M, --mua=MUA turn on special treatment for some mail user agents -m delete MS style TOFU; careful: might be too aggressive --max-lines=x maximum number of message lines --ms-smart try to be smart with MS style TOFU; req. -Mmutt and -m -o=OUTFILE file to be written to; '-' for STDOUT (default) -P=MESSAGE user defined bounce message; requires -p -p[=ADDRESS] redirect to ADDRESS if no TOFU was found --pgp-move move pgp verification output to bottom; requires -Mmutt --pgp-move-vrf move pgp output if verified and good; requires -Mmutt --pgp-short hide non-relevant pgp key uids; requires -Mmutt -r delete mail header lines --reply squeeze multiple reply prefixes in subject line -S[=n] suppress signatures with more than n lines (default $maxsig) -s delete signature --sani sanitize some header fields --sigsmax[=n] max number of sigs tolerated, no value for unlimited --spass enable SpamAssassin workaround -t delete traditional style TOFU -v, --version show version string and exit -w delete trailing whitespaces\n"; exit(EX_USAGE); } # version(): print version info and exit with appropriate exit code sub version { print "$0 v".VER.REV." (Rev. ".REL."), Jochen Striepe Get the latest version at \n"; exit(EX_OK); } # sigint_handler(): what to do if we receive a single SIGINT sub sigint_handler { $sigint = 1; } sub sanitize_hdr { # Undoes MIME quoted-printable word encoding. sub qp_decode { my $word = shift; $word =~ tr/_/\x20/; $word =~ s/=DF/ss/og; $word =~ s/=C4/Ae/og; $word =~ s/=D6/Oe/og; $word =~ s/=DC/Ue/og; $word =~ s/=E4/ae/og; $word =~ s/=F6/oe/og; $word =~ s/=FC/ue/og; $word =~ s/=([0-9A-F]{2})/chr(hex $1)/ioge; $word; } sub umlauts { my $word = shift; $word =~ s/ä/ae/og; $word =~ s/Ä/Ae/og; $word =~ s/ö/oe/og; $word =~ s/Ö/Oe/og; $word =~ s/ü/ue/og; $word =~ s/Ü/Ue/og; $word =~ s/ß/ss/og; $word; } my $H = shift; # array of header lines my $i; for ($i=0; $i<$#$H; $i++) { if ($$H[$i] =~ /^subject: /io) { if ($sani) { $$H[$i] =~ s/=\?iso-8859-15?\?q\?([^?]*)\?=/qp_decode($1)/ioge; $$H[$i] =~ s/^subject: *(.*)/"Subject: " . umlauts($1)/ioe; } if ($reply) { $$H[$i] =~ s/^subject: *(?:(?:Re|Antw(?:ort)?|AW|WG): *)+/Subject: Re: /io; } $i++; while ($i<$#$H && $$H[$i] =~ /^\s/) { if ($sani) { $$H[$i] =~ s/=\?iso-8859-15?\?q\?([^?]*)\?=/qp_decode($1)/ioge; $$H[$i] =~ s/^\s+(\S.*)/" " . umlauts($1)/ioe; } if ($reply) { $$H[$i] =~ s/^\s+(?:(?:Re|Antw(?:ort)?|AW|WG): *)+/ /io; } $i++; } } elsif ($sani && $$H[$i] =~ /^(?:from|to): /io) { $$H[$i] =~ s/=\?iso-8859-15?\?q\?([^?]*)\?=/qp_decode($1)/ioge; $i++; while ($i<$#$H && $$H[$i] =~ /^\s/) { $$H[$i] =~ s/=\?iso-8859-15?\?q\?([^?]*)\?=/qp_decode($1)/ioge; $i++; } } } } # remove_footers(): remove any trailing appearance of footers contained # in the given directory. sub remove_footers { my $L = shift; # array of message lines my $S = shift; # array to store removed lines in my $F = shift; # footers dir name my $O = shift; # remove only one footer? my $V = shift; # allow footers match before end of message my $off; if (!defined $V) { for ($off = 0; $#$L>=$off && $$L[$#$L-$off] =~ /^\s*$/; $off++) {;}; } if ($F && scalar(@$L)) { if (!opendir(DIR, $F)) { print STDERR "Could not open $F: $!\n"; exit(EX_IOERR); } my @feet = grep { /^[^.]/ && -f "$F/$_" } readdir DIR; closedir DIR; foreach my $f (@feet) { if (!open(IN, "$F/$f")) { print STDERR "Could not open $F/$f: $!\n"; exit(EX_IOERR); } my @l = ; close IN; if (!scalar(@l)) { next; } for (my $z=0; $z<=$#l; $z++) { chomp($l[$z]); } if (defined $V) { WIPE: for (my $z=scalar(@$L)-scalar(@l); $z>=0; $z--) { if (scalar(@l)+$z<=scalar(@$L)) { my $y = 0; for(my $x=1; $x<=scalar(@l); $x++) { if (index($$L[scalar(@$L)-$x-$z], $l[scalar(@l)-$x])!=0) { $y = 1; } } if (!$y) { unshift(@$S, @$L[$#$L-$#l-$z..$#$L]); splice(@$L, $#$L-$#l-$z); while (scalar(@$L) && $$L[$#$L] =~ /^\s*$/) { unshift(@$S, pop(@$L)); } if ($O) { last; } else { goto WIPE; } } } } } else { while (scalar(@l)<=scalar(@$L)) { for(my $x=1; $x<=scalar(@l); $x++) { if (index($$L[scalar(@$L)-$x-$off], $l[scalar(@l)-$x])!=0) { goto FINISH; } } unshift(@$S, @$L[$#$L-$off-$#l..$#$L]); splice(@$L, $#$L-$off-$#l); while (scalar(@$L) && $$L[$#$L] =~ /^\s*$/) { unshift(@$S, pop(@$L)); } if ($O) { last; } } FINISH: } } } } # decomb(): Try to detect and fix zig-zag shaped quoting (a.k.a. German # "Kammquoting"). sub decomb { my $L = shift; # array of message lines my $V = shift; # array with verbatim list my $max = 0; # plausible wraparound pos # We scan the whole message first for a plausible common maximum line # length where longer lines would be wrapped. for (my $x=0; $x<$#$L; $x++) { if ($$V[$x]!=1 && $max$max || (index($$L[$x+1], ' ')<0 && length($$L[$x])+length($$L[$x+1])>$max)) && (length($$L[$x])+length($$L[$x+1])<$kmaxl) && (length($$L[$x])+length($$L[$x+1])>$kminl) && (length($$L[$x])-length($$L[$x+1])>$kdiff) && ($$L[$x+2] !~ /^\s*$/)) { $$L[$x] =~ s/\s*$/' ' . $$L[$x+1]/e; splice(@$L, $x+1, 1); splice(@$V, $x+1, 1); } } } # debigq(): Finds big quotes (more than $n lines quoted) and deletes all # but the last $x lines of them. sub debigq { my $L = shift; # array of message lines my $V = shift; # array with verbatim list my $k = 0; for (my $i=0; $i<=$#$L; $i++) { if ($$V[$i]) { $k = 0; next; } if (index($$L[$i], $indent)==0) { $k++; } else { if ($k>$bigqn) { my $x = $k-$bigqx; $i -= $k; $$L[$i] = "[---=| Quote block shrunk by $0: " . "$x lines snipped |=---]\n"; $i++; splice(@$L, $i, $x-1); splice(@$V, $i, $x-1); $i++; } $k = 0; } } } # pgp(): treat mutt(1)'s pgp/gpg output contained in signed or encrypted # messages sub pgp { sub verified { my $L = shift; # message body my $X = shift; # start line my $Z = shift; # end line my $ok = 0; while ($X<$Z) { 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 (index($$L[$X], "gpg: $gpg_good")==0) { $ok = 1; } $X++; } return $ok; } my $L = shift; # message body my $V = shift; # verbatim list my $H = shift; # headers my @tmp = (); my $tmp = 0; for (my $x=0; $x1 && index($$L[$i], $from)<0) { splice(@$L, $i, 1); splice(@$V, $i, 1); $i--; } } elsif ($$L[$i]=~/^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutend\E)/o) { if ($pgpmove || ($pgpmovevrf && (!$sigint) && verified($L, $x+1, $i))) { push(@{$tmp[++$tmp]}, "\n", @$L[$x..($i+1)]); splice(@$L, $x, $i-$x+2); splice(@$V, $x, $i-$x+2); $i -= $#{$tmp[$tmp]}-2; } $x = $i; last; } } } elsif ($tmp && $$L[$x] =~ /^ (?:\e[^\a]+\a)? (?:\Q$mutt_pgpencrypted\E | \Q$mutt_pgpcryptend\E| \Q$mutt_pgpclearsigned\E| \Q$mutt_pgpsigned\E) /ox) { splice(@$L, $x+1, 0, @{$tmp[$tmp]}); for (my $i=$x; $i0) { push(@$L, @{$tmp[$tmp--]}); pop(@tmp); for (my $i=$#$V; $i<$#$L; $i++) { push(@$V, 0); } } } # write_msg(): output sub write_msg { my $O = shift; my $l; if ((!$lax) && ($O =~ /^>(.*)/) && ($1 ne '-') && ($1 ne '/dev/null')) { if (!sysopen(OUT, $1, O_EXCL|O_CREAT|O_WRONLY)) { print STDERR "Could not open $1: $!\n"; exit(EX_IOERR); } } elsif (!open(OUT, $O)) { print STDERR "Could not open $O: $!\n"; exit(EX_IOERR); } while (scalar(@_)) { $l = shift; if (defined $l) { $^W = 0; print OUT @$l; $^W = 1; } } close OUT; } # process_msg(): This one proc does *everything* what has to be done with # the lines of the message sub process_msg { my $lines = shift; my ($j, $x, $verb) = (0, 0, 0); my (@ads, @hdr, @bo1, @bo2, @ftr, @sig, @vrb, @att) = ((), (), (), (), (), (), (), (), ()); # Remove and store lines we might need later... # Remove headers: if (!$nohdr) { for ($x=0; $x<$#$lines; $x++) { if (@$lines[$x] =~ /^$/) { last; }; } @hdr = @$lines[0..$x]; splice(@$lines, 0, $x+1); } # remember the original body lines count my $linecount = scalar(@$lines); # Sanitize header fields: if ($reply || $sani) { sanitize_hdr(\@hdr); } # Remove ML footers: remove_footers($lines, \@ftr, $footers, undef, $ftr_ml); # Remove ad footers: remove_footers($lines, \@ads, $ads, undef, $ftr_ad); # See if we have a multipart content type. If yes, see if it is already # ripped (e.g. by you MUA, assuming it does not get special treatment with # --mua=foo), otherwise only leave the first part if it is plain text (if # not, we are done - non-text messages are not our business). if ($mua ne 'mutt') { for ($x=0; $x=scalar(@$lines)) { exit(EX_DATAERR); } if ($bar =~ m!^text/plain!) { my $z; for ($z=1; $x+$z<@$lines; $z++) { if (index($$lines[$x+$z], '--'.$foo)==0) { last; } } if ($x+$z>=scalar(@$lines)) { exit(EX_DATAERR); } @bo2 = @$lines[$x+$z..$#$lines]; splice(@$lines, $x+$z); if ($$lines[$#$lines] =~ /^\s*$/) { unshift(@bo2, pop @$lines); } @bo1 = @$lines[0..$x]; splice(@$lines, 0, $x+1); # remove mailing list and ad footers within this # attachment: remove_footers($lines, \@ftr, $footers, undef, $ftr_ml); remove_footers($lines, \@ads, $ads, undef, $ftr_ad); last; } else { write_msg(($mda?'|'.SENDMAIL." $mda":">$ofile"), ($hdrs?undef:\@hdr), $lines); exit; } } } } last; } } } # Protect verbatims: $verb = 0; for ($x=0; $x$2 || $x+$2-$1+1>$#$lines) { next; } $vrb[$x] = 1; for (my $i=0; $i<$2-$1+1; $i++) { $vrb[++$x] = 1; } } elsif ($diff && $$lines[$x] =~ /^([0-9]+),([0-9]+)c([0-9]+),([0-9]+)$/) { if ($1!=$3 || $1>$2 || $3>$4 || $x+$2-$1+$4-$3+3>$#$lines) { next; } $vrb[$x] = 1; for (my $i=0; $i<$2-$1+$4-$3+3; $i++) { $vrb[++$x] = 1; } } else { $vrb[$x] = $verb; } } # Calculate quoting ratio (with respect to verbatims): if ($check && scalar(@$lines)) { my ($y, $z) = (0, 0); for ($x=0; $x=$check_ratio) { print $msg_ratio; exit EX_UNAVAILABLE; } } if ($mua eq 'mutt') { # See if we find pgp output generated by mutt before we scramble # the thing. If yes, see if we can beautify it. if ($pgpshort || $pgpmove || $pgpmovevrf) { pgp($lines, \@vrb, \@hdr); } # Remove all but the first attachment (if this is text/plain) # mutt did introduce (bah!). Remember, all this ugliness could # be replaced with a proper and clean edit_filter patch in # mutt(1) itself... for ($x=$#$lines; $x>=0; $x--) { 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]+\a)?\Q$mutt_attachment\E(\d+)/o && (($1 ne '1') || ($x<$#$lines && $$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_pgpcryptend\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]+\a)?\s*$/) { unshift(@att, pop(@$lines)); } # Remove ML and ad footers within attachments: my @tmp; if ($ml) { remove_footers($lines, \@tmp, $footers, undef); } if ($ad) { remove_footers($lines, \@tmp, $ads, undef); } $x = scalar(@$lines); } } # care about the rest if (scalar(@att)) { for ($x=0; $x<$#att; $x++) { if ($vrb[scalar(@$lines)+$x]) { next; } # Pipe message/rfc822 parts to another instance of # process_msg() for further processing. # Please note that we cannot see what a hierarchy the # original message had -- if there were message/rfc822 # parts within other message/rfc822 parts constellations # can occur which we cannot resolve. Therefore we simply # do not even try to be smart. This should work for most # situations. # The following regexp is quite ugly because for most # users the line is coloured using termcap... (bah!) 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|multipart/alternative) !ox) { $x += 2; while ($att[$x] !~ /^\s*$/) { $x++; } $x++; my @tmp = @att[$x..$#att]; process_msg(\@tmp); splice(@att, $x, scalar(@att)-$x, @tmp); $x += scalar(@tmp); } } } } # Remove signature: if (scalar(@$lines)) { my $sn = 0; my $chk_empty = 1; my $empty = 0; for ($x = $#$lines; $x>=0; $x--) { if (!$vrb[$x]) { if ($$lines[$x] =~ /^-- $/) { if ($diff) { for (my $i=1; $x+$i+1$lsig))) { if ($lsig && !$sig) { unshift(@sig, "[---=| Overlong signature removed by $0: " . (scalar(@$lines)-$x) . " lines snipped |=---]\n"); } splice(@$lines, $x); } else { unshift(@sig, @$lines[$x..$#$lines]); splice(@$lines, $x); } if (defined($sign) && ++$sn==$sign) { last; } else { next; } } # any trailing newlines? elsif ($chk_empty && $$lines[$x] =~ /^\s*$/) { $empty++; } elsif ($chk_empty) { $chk_empty = 0; } } } } # Fix quote markers to adhere to RFC 3676, this changes "> >" to ">> " (if # the default $indent is used). The space after ">" is not mandatory by RFC # but makes the result more readable. if ($fixind) { for ($x=0; $x schrieb:'); my $k = 0; # any text above? my $tmp = 0; # flagged if inside PGP output DONE: for ($x=0; $x>>[^\<]+<[^\>]+> \d\d?\/\d\d?\/\d\d? \d\d?:\d\d [AP]M >>>/ || $$lines[$x] =~ /^>>> On [A-Z][a-z][a-z]?, [A-Z][a-z][a-z]? \d\d?, \d\d\d\d at [ \d]\d:\d\d [AP]M, in message/))) { $x++; $trad = 0; $bigqn = 0; last DONE; } } 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] !~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_contenttype\E)/o)) && ((!$spass) || index($$lines[$x], $spass_prefix)!=0)) { if ($mua eq 'mutt' && (!$tmp) && $$lines[$x] =~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpoutstart\E)/o) { $tmp = 1; } elsif ($mua eq 'mutt' && $tmp && ($$lines[$x] =~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_beginsigned\E)/o || $$lines[$x] =~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpcryptstart\E)/o || $$lines[$x] =~ /^(?:\e[^\a]+\a)?(?:\Q$mutt_pgpclearsigstart\E)/o)) { $tmp = 0; } elsif (!$tmp) { $k = 1; } } } } # try to avoid false positives and only delete m$ style tofu if # there is text above if ($k) { if (!$ms_smart) { goto CLEAN; } # first, see if there is pgp stuff inside the tofu: my $p = 0; # levels of pgp signed parts for (my $i=$x+1; $i=0; $i--) { if ($vrb[$i]) { last; } if (index($$lines[$i], $indent)==0) { $j++; $k = $i; } elsif ($$lines[$i] !~ /^\s*$/) { last; } } if ($j) { # if there is no text above, we will assume the message is meant # as forwarding and therefore OK for (my $i=$k-1; $i>=0; $i--) { if ($$lines[$i] !~ /^\s*$/o) { $x = 0; last; } } if ($x) { $j = 0; } else { splice(@$lines, $k); } } } # OK, if we found TOFU, we will leave a message that we were here... if ($j) { # make sendmail bounce if we shall be picky # and indeed found something: if ($mda) { if ($mda ne '1') { print STDERR $boun; if ($sysl) { eval { require Sys::Syslog; }; if ($@) { warn $@; } else { Sys::Syslog::setlogsock('unix'); Sys::Syslog::openlog("$0[$$]", 'pid', 'mail'); Sys::Syslog::syslog('debug', 'bounced message %s', $hdr[0]); Sys::Syslog::closelog(); } } } exit EX_BOUNCE; } # if we were invoked just for checking and indeed found something, # print out the error message and quit: if ($check) { print $msg_quote; exit EX_UNAVAILABLE; } push(@$lines, "[---=| TOFU protection by $0: " . "$j lines snipped |=---]\n"); } elsif ($mda eq '1') { exit EX_OK; } # Care for huge blocks of quoted original message: if ($bigqn) { debigq($lines, \@vrb); } # Care for trailing whitespaces: if ($trsp) { for ($x=0; $x=0; $x--) { if ((!$vrb[$x]) && (($mua eq 'mutt' && $$lines[$x] =~ /^\e[^\a]+\a\s*$/o) || $$lines[$x] =~ /^\s*$/o)) { if ($t<$cr) { $t++; } else { splice(@$lines, $x, 1); } } else { $t = 0; } } } # Everything changing the body is done now. Time to fix the line count # header so naive clients do not get confused. Just to be sure, append # the old line count to X-headers. my $l = scalar(@bo1) + scalar(@$lines) + scalar(@att) + scalar(@bo2) + (!$sig?scalar(@sig):0) + (!$ml?scalar(@ftr):0) + (!$ad?scalar(@ads):0); if ($linecount-$l!=0) { for ($x=0; $x \$ad, 'A=s' => \$ads, 'bigq:s' => \$_t_bigq, 'body' => \$_t_nohdr, 'c:i' => \$_t_cr, 'check:s' => \$_t_check, 'debug|d' => \$sysl, 'diff' => \$diff, 'e' => \$elli, 'fixind' => \$fixind, 'ftr-ad' => \$ftr_ad, 'ftr-ml' => \$ftr_ml, 'groupwise' => \$gw, 'help|h' => \$_t_help, 'i=s' => \$ifile, 'k' => \$kamm, 'kminl=i' => \$_t_kminl, 'kmaxl=i' => \$_t_kmaxl, 'kdiff=i' => \$_t_kdiff, 'L=s' => \$footers, 'l' => \$ml, 'lax-security' => \$lax, 'locale=s' => \$locale, 'max-lines:i' => \$maxlines, 'ms-smart' => \$ms_smart, 'mua|M=s' => \$_t_mua, 'm' => \$ms, 'o=s' => \$ofile, 'P=s' => \$boun, 'p:s' => \$_t_redir, 'pgp-short' => \$pgpshort, 'pgp-move' => \$pgpmove, 'pgp-move-vrf' => \$pgpmovevrf, 'r' => \$hdrs, 'reply' => \$reply, 'S:i' => \$_t_maxsig, 's' => \$sig, 'sani' => \$sani, 'sigsmax:i' => \$_t_sigsmax, 'spass' => \$spass, 't' => \$trad, 'version|v' => \$_t_ver, 'w' => \$trsp )) { help(); } # clean up temp vals: if (defined $_t_bigq) { if ($_t_bigq !~ /^(?:(\d+)(?:,(\d+))?)?$/) { help(); } $bigqn = $1?$1:30; $bigqx = $2?$2:10; if ($bigqn<=0 || $bigqx<=0 || $bigqn<=$bigqx) { help(); } } if (defined $_t_help) { help(); } if (defined $_t_kminl) { $kminl = $_t_kminl; $kamm = 1; } if (defined $_t_kmaxl) { $kmaxl = $_t_kmaxl; $kamm = 1; } if (defined $_t_kdiff) { $kdiff = $_t_kdiff; $kamm = 1; } if (defined $_t_maxsig) { $lsig = $_t_maxsig ? $_t_maxsig : $maxsig; } if (defined $_t_mua) { $mua = lc($_t_mua); # mutt still displays the message when ^C'ing pgp verification: if ($mua eq 'mutt') { $SIG{'INT'} = 'sigint_handler'; } } if (defined $_t_redir) { $mda = $_t_redir ? $_t_redir : '1'; } if (defined $_t_check) { $check = 1; while ($_t_check && $_t_check =~ /^([^,\s]+)(?:,(\S+))?$/) { my $foo = $1; $_t_check = $2; if ($foo =~ /^ratio(?:=(0?\.\d+))?$/) { $check_ratio = $1?$1:0.75; } } } if (defined $_t_sigsmax) { $sign = $_t_sigsmax ? $_t_sigsmax : undef; } if (defined $_t_ver) { version(); } if (defined $_t_nohdr) { $nohdr=1; $hdrs=1; } if (defined $_t_cr) { $cr = $_t_cr ? $_t_cr : $crshrink; } if ($ms_smart) { $ms = 1; } if ($mua eq 'mutt') { if (defined $locale && $locale ne '' && $locale ne 'C' && $locale ne 'POSIX') { eval { require Locale::gettext; }; if ($@) { warn $@; exit(EX_SOFTWARE); } else { Locale::gettext::textdomain('mutt'); ($mutt_attachment) = Locale::gettext::gettext("[-- Attachment #%d") =~ m/^([^%]*)/; ($mutt_contenttype) = Locale::gettext::gettext("[-- Type: %s/%s, Encoding: %s, Size: %s --]\n") =~ m/^([^%]*)/; ($mutt_pgpsigned) = Locale::gettext::gettext("[-- End of signed data --]\n") =~ m/^(.*)\n/m; ($mutt_beginsigned) = Locale::gettext::gettext("[-- The following data is signed --]\n\n") =~ m/^(.*)\n/m; ($mutt_pgpclearsigned) = Locale::gettext::gettext("[-- END PGP SIGNED MESSAGE --]\n") =~ m/^(.*)\n/m; ($mutt_pgpclearsigstart) = Locale::gettext::gettext("[-- BEGIN PGP SIGNED MESSAGE --]\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/^([^%]*)/; ($mutt_pgpoutend) = Locale::gettext::gettext("[-- End of PGP output --]\n") =~ m/^(.*)\n/m; Locale::gettext::textdomain('gnupg'); ($gpg_WARNING) = Locale::gettext::gettext("WARNING: using insecure random number generator!!\n") =~ m/^([^:]*: )/; ($gpg_Warning) = Locale::gettext::gettext("WARNING: message was encrypted with a weak key in the symmetric cipher.\n") =~ m/^([^:]*: )/; ($gpg_Cantcheck) = Locale::gettext::gettext("Can't check signature: %s\n") =~ m/^([^%]*)/; ($gpg_aka) = Locale::gettext::gettext((' 'x16).'aka "%s"') =~ m/^([^"«%]*)["«%]/; ($gpg_bad) = Locale::gettext::gettext('BAD signature from "%s"') =~ m/^([^"«%]*)["«%]/; ($gpg_expired) = Locale::gettext::gettext("Note: This key has expired!\n") =~ m/^(.*)\n/m; ($gpg_good) = Locale::gettext::gettext('Good signature from "%s"') =~ m/^(([^"«%]*))["«%]/; ($gpg_bug) = Locale::gettext::gettext("... this is a bug (%s:%d:%s)\n") =~ m/^([^%]*)/; } } } 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 (($nohdr||$hdrs) && ($sani||$reply))|| # no sanitizing without headers :) ($ifile eq '')|| # no empty -i ($ofile eq '')) # no empty -o { help(); } # Read message: if (!open(IN, $ifile)) { print STDERR "Could not open $ifile: $!\n"; exit(EX_IOERR); } my @message = ; close IN; # First, check msg length and stop processing if msg is too long: if ((defined $maxlines) && (@message > $maxlines)) { 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); } # this should be self-explanatory: process_msg(\@message); # Finally, print clean lines: write_msg(($mda?'|'.SENDMAIL." $mda":">$ofile"), \@message); # vim600:set foldmethod=marker: # eof t-prot-2.101/t-prot.10000644000175000001440000005722511463250307013452 0ustar jochenusers.\" $Id: t-prot.1,v 1.185 2010/07/02 15:48:33 jochen Exp $ .\" .TH T-PROT "1" "July 2010" "T-PROT" .SH NAME t-prot \- TOFU Protection - Display Filter for RFC 5322 messages .SH SYNOPSIS .BI "t\-prot [" OPTIONS "]..." .SH DESCRIPTION .PP This program is a filter to improve the readability of internet messages (emails and usenet posts) 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. The program also detects TOFU or a high quoting ratio in a message (so you may take appropriate action, e.g. when submitting messages to a mailing list or a news server). .br The filter is written in Perl and relies on input to be a single message conforming to RFC 822 or its successors, RFC 2822 and RFC 5322. In messages conforming to MIME (RFCs 2045-2049) t\-prot handles text/plain parts, others are not touched. .PP Already reformatted messages are handled well: the script was initially designed to cope with the output of the MUA mutt (which is the reason for not using standard CPAN modules for handling messages). .PP T\-prot offers example configuration files for mutt, Heirloom mailx and metamail. Also coming with the t-prot package is the example S-Lang macro t\-prot.sl for using t-prot from within slrn. There is a proof\-of\-concept filter for INN2, which you will have to adapt to the needs of the news site you host. For use with sendmail's alias(5) file, please see below (the option .BR "\-p" " provides an example line)." .SH OPTIONS .PP If you do not specify any options, t\-prot does ... nothing. Every feature you want must be turned on explicitly. Admittedly, we have quite a number of options for t\-prot. To limit confusion they are grouped into five sections: Input/Output Options, Advertisement And Mailing List Footers, Filtering Options, Detection Options, and Other Options. While the others should be quite clear, filtering and detection might deserve a word (or two). .PP If you want to tune the appearance of your mail from within your MUA (or news messages from within your NUA), then go for the Filtering Options section. .PP If you want to use t\-prot to check on mails before they are submitted to mailing lists, fed to your news server, or delivered by your MDA, then have a peek at the Detection Options section. You may accept or reject/bounce messages depending on t\-prot's result. .SH INPUT/OUTPUT OPTIONS .TP .BR "\-i" "=FILE" Defines an input file; default is '\-' i.e. STDIN. .TP .BR "\-o" "=FILE" Defines the output file; default is STDOUT. .TP .B "\-\-body" Input consists just of the message's body. There are no RFC 5322 header lines. .IP .IR NOTE : This does not work with \-\-pgp\-short, and multipart messages will not be detected due to missing headers. .TP .B "\-\-lax\-security" Allow insecure writing method. DO NOT USE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING. (This ugly workaround is needed for some early mutt versions and should NEVER be used as a default, otherwise it will probably turn into a security issue.) .sp You can use this option safely to enable .B "\-o" /dev/null (or other files which cannot be changed with the user's privileges). .TP .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 except when called with \-Mmutt. .SH ADVERTISEMENT AND MAILING LIST FOOTERS .TP .B "\-a" "commercial signature": Hides "footers" (signatures) from commercial email providers. .br This option compares the last lines of the message body with any footer file found in the directory specified with .BR "\-A" " DIRECTORY" (which is mandatory for this option). The comparison is done by perl's .B index() function (please try .I perldoc \-f index for details). .sp .IR NOTE : This option is not needed if .B \-\-ftr\-ad is specified. .TP .B "\-\-ftr\-ad" "enable aggressive ad footer matching": 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 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! ;) .br With this option even GMX ads should be easy to hide -- you buy this with a slight performance hit (which is the reason this option is disabled by default), and with the possibility that sometimes the algorithm is just a little *too* greedy. .sp .IR NOTE : This requires a directory with footer files to be given with option .BR "\-A" "=DIRECTORY". .TP .BR "\-A" "=DIRECTORY" "ad footer directory": Defines the directory which contains the advertisement list footers (one footer per file) which are to be tested when removing them with options .B \-a or .BR \-\-ftr\-ad . .br This option is also needed if you do not want signature lengths to be counted wrong or fullquotes get undetected when an ad footer is appended at the bottom of the message (especially when using .B "\-S" or .BR "\-t" ). .TP .B "\-l" "list signature": Hides "footers" (signatures) from mailing lists. Footer detection works like the .B "\-a" option. .sp .IR NOTE : This requires a directory with footer files to be given with option .BR "\-L" "=DIRECTORY". .B \-l is not needed if .B \-\-ftr\-ml is specified. .TP .B "\-\-ftr\-ml" "enable aggressive mailing list footer matching": With this option enabled t-prot makes footer detection really greedy: Should be helpful with broken list servers, or even if your email provider munges the bodies of your messages. .br Works similar to \-\-ftr\-ad, just that it is intended for mailing list footers. .sp .IR NOTE : This requires a directory with footer files to be given with option .BR "\-L" "=DIRECTORY". .TP .BR "\-L" "=DIRECTORY" "list footer directory": Defines the directory which contains the mailing list footers (one footer per file) which are to be tested when removing them with the options .B \-l or .BR \-\-ftr\-ml . .br This option is also needed if you do not want signature lengths to be counted wrong or fullquotes get undetected when a mailing list footer is appended at the bottom of the message (especially when using .B "\-S" or .BR "\-t" ). .SH FILTER OPTIONS .TP .BR "\-\-bigq" [=n[,x]] "shrink big quotes": Blocks of quotes with more than n lines will be shrunk to x lines. Defaults are 30 for n and 10 for x. .TP .BR "\-c" "[=n]" "compress": Squeezes a sequence of blank lines to just n blank lines. n defaults to 2. .TP .B "\-\-diff" Tolerate unified diff (see .BR diff (1) and .BR patch (1)) appended after the signature (which usually makes the signature too long to be valid). .sp Also, protect diff standard output from hiding (which would otherwise be easy prey for .BR "\-t" ). .TP .B "\-e" "ellipsis": Squeezes a sequence of four or more dots, exclamation marks, or question marks to only three dots or marks, respectively. .TP .BR "\-\-fixind" Fix broken quotes to adhere to RFC 3676 by removing spaces between quote characters and adding a space after them. .br .IR NOTE : This may produce false positives if spaces in between quote characters are intended (thus changing the quoting level, see RFC 3676 for details). .TP .B "\-\-groupwise" Hides TOFU as produced by Novell Groupwise. .TP .B "\-k" "anti Kammquote": 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 and REPORTING BUGS section of this man page, that is). .IP Please also note that enabling this option is quite a performance hit. .TP .BR "\-\-kdiff" =n Minimum length difference between two lines 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 20. .sp Requires .BR "\-k" . .TP .BR "\-\-kmaxl" =n 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. .sp Requires .BR "\-k" . .TP .BR "\-\-kminl" =n 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. .sp Requires .BR "\-k" . .TP .BR "\-\-locale" =LOCALE Specify which locale to use for correct parsing of your MUA's formatting of the displayed message (usually it is the locale your MUA uses). Right now this option is only used when .I "\-Mmutt" is specified, but this may change in future. You need the Perl module .I "Locale::gettext" for this feature. .sp .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. 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" : You also have to make sure you are running t-prot with matching .B gnupg and .B mutt versions. T-prot detects .B gnupg and .B mutt locales of the recent stable versions of those programs, earlier versions might not work well with a recent version of t-prot. There are patches available to make t-prot fit into environments with some other .B mutt and .B gnupg versions. .TP .BR "\-M, \-\-mua" =MUA "mail user agent": Turn on special treatment for some mail user agents. (Right now only .BR mutt (1) is supported, but more might be added in future.) .IR Caveat : If your MUA is supported by this feature you must ensure t-prot makes use of it when called from within your MUA to work as desired. .TP .B "\-m" "Microsoft TOFU": Hides TOFU as given by some Microsoft mailers. (You all surely know these fullquotes beginning with .br "\-\-\-\-\- Original Message \-\-\-\-\-" .br and some header lines...) .TP .B "\-\-ms\-smart" Burn CPU cycles trying to be smart with MS style TOFU: If there are PGP signed parts inside the TOFU, the text still might conceal other message parts and therefore should not be deleted. .sp Please note that this is probably just a waste of time because most MS Outlook users who do produce this kind of TOFU won't care about making their messages the least bit readable or even predictable. So this option will probably just be interesting for mutt message hooks (to activate it on demand when you .BR know " the sender tries to write legible messages)." .sp Requires .BR "\-Mmutt" " and" .BR "\-m" . .TP .B \-\-pgp\-move Move PGP verification output to bottom; requires .BR "\-Mmutt" . .TP .B \-\-pgp\-move\-vrf Move PGP verification output to bottom only if verification shows a good signature and the signature could be verified as authentic (using a trust path). If there is any problem with the signature, the PGP output should not be moved so the user is more likely to notice. Requires .BR "\-Mmutt" . .sp .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 to be smart, there will be false positives. .TP .B \-\-pgp\-short Hide non-relevant PGP key uids; requires .BR "\-Mmutt" . .TP .B "\-r" "rip header off": Hides all mail header lines. .TP .B "\-\-reply" Subject lines with multiple reply prefixes (Re: and translations into other languages) get squeezed to only one prefix. .TP .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 .B truely nice line. .br 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 : 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 "\-s" "signature deletion": Hides signatures, i.e. all lines after a "signature dashes" line, i.e. a line with three characters: dash-dash-space (no more, no less). .TP .B "\-\-sani" Sanitize headers "To:", "From:" and "Subject:": Quoted-printable gets fixed to the corresponding chars. German Umlauts are translated to their "ae", "oe", "ue" pendants. .br Useful e.g. for searching by subject within MUAs like Berkeley mailx. .TP .BR "\-\-sigsmax" [=n] "maximum number of tolerated signatures": Here you can define how many signatures you accept to be treated as such. (Most significant behaviour is when microsoft style quotes are removed. Experts please see the code for the more subtle implications of this option.) .br Leave empty or specify zero to have an unlimited number of sigs. Default is 1. .TP .B "\-\-spass" "SpamAssassin workaround": SpamAssassin (available at .IR http://spamassassin.org/ ") often is configured that it adds some" lines to the message body containing information about the spam criteria which were found matching for the message. This option enables an extra test to avoid false positives for Microsoft style TOFU on such messages. .TP .B "\-t" "TOFU deletion": Hides "traditional style" TOFU, where each line begins with the indent string ">". .TP .B "\-w" "whitespace deletion": Hides trailing whitespace (sequences of space and tab). CAVEAT: This may lead to interesting effects with crossposts between mailing lists or with undetected signature attempts. .SH DETECTION OPTIONS .TP .BR "\-P" "=MESSAGE" "user defined bounce message for picky delivery": You may specify your own bounce message to be returned when we try to deliver an email and bounce it because there is TOFU inside. See .BR "\-p" . .TP .BR "\-p" "[=ADDRESS]" "picky delivery": If we really find some TOFU, abort with exit code .IR EX_UNAVAILABLE . Otherwise redirect the message to ADDRESS if given. .sp Intended for use from within mail delivery agents (MDAs) or mail transport agents (MTAs), or even from within INN, so the message bounces if TOFU is detected, and does not get on *your* nerves. :) .sp As an example for usage with .BR sendmail , put this line into your alias file and invoke .BR newaliases : .sp notofu: |"/usr/local/bin/t\-prot \-mt \-p=user@mydomain" .sp This will bounce messages for if any TOFU is detected inside the message, and deliver it to otherwise. .I Note that TOFU is only detected if you specify .B "\-t" respectively .BR "\-m" . .sp .B PLEASE be careful not to bounce messages to mailing lists! .TP .BR "\-\-check" [=FLAGS] Run checks. If successful, print an error message and quit with an appropriate exit code. Useful e.g. for rejecting messages from within INN2. .IP Flags are separated by commas (no whitespaces), and can be the following (right now just one flag): .IP .IR ratio [=n] .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., 75% of the message lines are quotes). .TP .B "\-d, \-\-debug" Print envelope info to syslog when bouncing TOFU contaminated email. Default syslog facility is mail.debug. Requires .BR \-p . .SH OTHER OPTIONS .TP .B "\-h, \-\-help" Displays a short help text with a summary on all options, and exits. .TP .B "\-v, \-\-version" Prints the current version number and exits. .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 EXIT STATUS On program exit, t-prot uses exit codes from .I /usr/include/sysexits.h and thus behaves in a manner that sendmail and others understand when calling t-prot. .sp Currently, the codes used are .RS 20 .PD 0 .TP EX_OK .TP EX_USAGE .TP EX_DATAERR .TP EX_UNAVAILABLE .TP EX_SOFTWARE .TP EX_IOERR .PD .RE .sp If, however, perl fails to compile and execute t-prot, perl's normal exit codes will be returned. .SH TOFU? TOFU is an abbreviation which mixes German and English words; it expands to "text oben, full-quote unten" which means "text above - full quote below" and describes the style of so many users who let their mailer or newsreader quote everything of the previous message and just add some 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 .I http://www.river.com/users/share/etiquette/edit.html - thank you! .SH PERFORMANCE There are several ways to fine-tune t-prot's performance: .PP Some command line options are quite grave a performance hit -- do not use \-k and especially \-\-ms\-smart if you are content without them. .PP Checking for special footers is very costly as well. Put as few footer files as absolutely needed in any footer directory. .PP All PGP related options are eating up lots of CPU time. Try to avoid them on unsigned and unencrypted messages. .PP When calling t-prot from within mutt, you might use mutt's folder-hook and message-hook facilities to turn options on only when needed, e.g. to set up a different footer directory for each mailing list folder. .SH TROUBLESHOOTING .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? .TP .IR A : Nope, regexp's do not work here. The comparison is made by the perl builtin .IR index () function (see .B perldoc for more detailed info), so you must exactly match the beginning of the line. The longer the line you specify, the more precise the match; if your line is empty you match unconditionally. .PP .TP .IR Q : I use the options \-l and \-L to supress mailing list footers when displaying messages in .BR mutt (1). This does work sometimes, but sometimes it does not: the footer is not detected, and therefore full quotes are not deleted and signatures are detected as too long (which they aren't). .TP .IR A : This might occur if the message is badly encoded, so mutt cannot resolve all encoded characters, e.g. if you have an encoded message on a mailing list, and majordomo appends a mailing list footer in a different encoding (or even plain us-ascii). "\-\- " simply does not match "\-\-=20". .br Another problem are non-us-ascii characters. Just avoid them, and everything should work fine. .br See the preceding Q+A for a solution. .PP .TP .IR Q : I want to write a message which contains parts that should *not* be deleted even when filtered with t-prot. Is this possible? .TP .IR A : Yes, but please do not spread word of it. Make unobstrusive use of the .I verbatim instruction: .sp #v+ .br This line is protected from being filtered by t\-prot !!!!!!! .br #v\- .br Text coming now is not. .SH AUTHOR Written by Jochen Striepe . .SH COPYRIGHT All of the documentation and software included in the t-prot releases is copyrighted by Jochen Striepe (except when explicitly stated otherwise). .PP Copyright \(co 2001-2010 Jochen Striepe. All rights reserved. .PP Redistribution and use, with or without modification, are permitted provided that the following conditions are met: .PP 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 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 entire inspiration for this hack came from the "TOFU protection" line of his script on many usenet postings. .SH AVAILABILITY You can get the latest version from .IR http://www.escape.de/users/tolot/mutt/ . .SH BUGS There is a problem when mutt gives a PGP verified or even a multipart message to t-prot: The information where the PGP encrypted/signed data or even attachments begin and end is plainly embedded in the text, not really cleanly recognizable for t-prot. The problem should be worked around by now, please send a bug report if it does not work for you. .SH "REPORTING BUGS" Please note that t-prot development happens on .BR "current stable perl versions only" . If you do run t-prot on earlier (or unstable) perl versions, you might encounter perl compiler bugs (or funny t-prot behaviour). One solution is to upgrade your perl, another is simply to write a bug report. If you do not run a current perl version, please include this information in your bug report. .PP 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 " .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 . 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), .sp RFCs 2045-2049, 3676 and 5322, .sp .I http://freshmeat.net/articles/t\-prot/ (a nice, solid introduction), .br .I http://got.to/quote/ (German language), .br .I http://www.river.com/users/share/etiquette/edit.html (the Learn To Edit Messages HowTo has found a new home). t-prot-2.101/ChangeLog0000644000175000001440000015740111463250307013712 0ustar jochenusers2010-10-31 11:18 Jochen Striepe * t-prot: Release as v2.101. 2010-10-31 10:13 Jochen Striepe * t-prot: Add just another of mutt's decryption messages to the list. This seems not to be translated yet, so no gettext() is inserted this time. 2010-07-10 19:14 Jochen Striepe * t-prot: Release as v2.100. 2010-07-10 12:59 Jochen Striepe * t-prot: Add line to make -m filter Lotus Domino Webserver produced TOFU. 2010-07-02 15:52 Jochen Striepe * t-prot: Use uniform syntax notation for parameters in command line options. 2010-07-02 15:48 Jochen Striepe * t-prot.1: Use uniform syntax notation for parameters in command line options. 2010-07-01 16:02 Jochen Striepe * t-prot: Release as v2.99. 2010-07-01 15:58 Jochen Striepe * t-prot, t-prot.1: New command line option --fixind to fix broken quoting (regarding to RFC 3676). Perhaps this should not be default, as there might be false positives if the message is already quoted correctly. Quotes with this particular brokenness are quite common, though. Patch by Simon Ruderich, many thanks. 2010-06-09 19:32 Jochen Striepe * t-prot: Use index() instead of regex for $indent. Patch by Simon Ruderich. 2010-04-20 09:40 Jochen Striepe * t-prot: Revert new handling of empty lines at the beginning of the body, as it removes lines where it should not. 2010-04-20 08:58 Jochen Striepe * t-prot: Another bug with -c: Empty lines before the signature were not handled properly. Patch by Simon Ruderich. 2010-04-20 08:57 Jochen Striepe * t-prot: This causes -c1 to not create an empty line at the beginning of the message if there were empty lines at the start of the body. Patch by Simon Ruderich. 2010-04-20 08:55 Jochen Striepe * t-prot, t-prot.1: Typos and documentation fixes regarding $indent. Many thanks to Simon Ruderich. 2010-04-09 06:47 Jochen Striepe * t-prot: Release as v2.98. 2010-04-09 06:45 Jochen Striepe * t-prot.1: Clarify --lax-security description. 2010-04-09 06:36 Jochen Striepe * t-prot: Use descriptive temp variable names when parsing command line. 2010-03-06 12:26 Jochen Striepe * t-prot.1: Mention configuration files for Heirloom mailx and metamail. Avoid false impression with --lax-security. 2010-03-06 10:51 Jochen Striepe * t-prot.1: Another Typo. 2010-03-06 09:19 Jochen Striepe * t-prot.1: Fix spelling error. Thanks to Gerfried Fuchs! 2010-03-06 01:32 Jochen Striepe * t-prot: Release as v2.97. 2010-03-06 01:31 Jochen Striepe * t-prot, t-prot.1: Standard diff(1) output now is protected by --diff, too. Many thanks to Martin Neitzel and Matthias Kilian. 2010-03-04 22:01 Jochen Striepe * t-prot: Release as v2.96. 2010-03-04 21:48 Jochen Striepe * t-prot: Allow -o /dev/null without bitching around. 2010-03-04 21:40 Jochen Striepe * t-prot.1: Give some emergency help how to write to /dev/null. You never know. 2010-03-04 21:19 Jochen Striepe * t-prot.1: Remove repetition. 2010-03-04 21:12 Jochen Striepe * t-prot: More syntax help fixes. 2010-03-04 21:09 Jochen Striepe * t-prot.1: Update date string. 2010-03-04 21:09 Jochen Striepe * t-prot.1: Fix --version description. 2010-03-04 21:07 Jochen Striepe * t-prot.1: More syntax fixes. 2010-03-04 21:02 Jochen Striepe * t-prot.1: Change option order for footer options. 2010-03-04 20:48 Jochen Striepe * t-prot.1: More grouping: Footers. 2010-03-04 20:34 Jochen Striepe * t-prot.1: Fix typo. 2010-03-04 20:32 Jochen Striepe * t-prot, t-prot.1: Special output to "NONE" is not required. You can use /dev/null. 2010-03-04 20:24 Jochen Striepe * t-prot.1: Improve word flow. 2010-03-04 20:22 Jochen Striepe * t-prot.1: Fix -i and -o syntax. 2010-03-04 20:21 Jochen Striepe * t-prot.1: Improve MIME handling description. 2010-03-04 20:19 Jochen Striepe * t-prot.1: Explain grouping of options and what happens if none are specified. Be specific how MIME is handled. 2010-03-04 18:45 Jochen Striepe * contrib/: mailcap.t-prot, nailrc.t-prot: New files: configuration samples for metamail and Heirloom mailx (a.k.a. nail). Many thanks to Martin Neitzel! 2010-03-04 17:26 Jochen Striepe * t-prot.1: Fix -S syntax. 2010-03-04 17:25 Jochen Striepe * t-prot: Fix -S syntax help. 2010-03-04 17:24 Jochen Striepe * t-prot.1: Group options by meaning, rather than alphabetically. Thanks to Martin Neitzel for suggesting. 2010-03-04 16:53 Jochen Striepe * t-prot: Fix --help output order. 2010-03-04 16:52 Jochen Striepe * t-prot: Fix -c syntax in --help, too. 2010-03-03 22:39 Jochen Striepe * t-prot.1: Precisify wording for --ms-smart. 2010-03-03 22:36 Jochen Striepe * t-prot.1: Be a little more specific as to what --ms-smart really does. 2010-03-03 22:30 Jochen Striepe * t-prot.1: Specify more clearly what locale to specify with --locale. Thanks to Martin Neitzel for suggesting. 2010-03-03 22:24 Jochen Striepe * t-prot.1: Fix -c syntax help. 2010-03-03 20:09 Jochen Striepe * t-prot: Fix bad typo. Thanks to Martin Neitzel. 2010-03-03 16:50 Jochen Striepe * t-prot: Big changes, we step a great deal towards the next major version number. Release as v2.95. 2010-03-03 16:27 Jochen Striepe * t-prot: Since Getopt::Mixed would break existing configurations with the new -c command line switch behaviour, the migration to Getopt::Long has been finished by now: This commit merges the big bad Getopt::Long patch. Hope the performance issue does not turn out to be too grave. Thanks to everyone for testing and providing feedback. 2010-02-19 16:20 Jochen Striepe * t-prot, t-prot.1, contrib/muttrc.t-prot, contrib/t-prot.sl: The command line option -c now accepts an optional parameter specifying the number of empty lines to remain. Thanks to Simon Ruderich. 2010-02-15 20:13 Jochen Striepe * t-prot: Release as v2.15. 2010-02-15 20:08 Jochen Striepe * t-prot.1: Describe --sani more precisely. 2010-02-15 19:21 Jochen Striepe * t-prot: Fine-tune some regex. 2010-02-15 19:20 Jochen Striepe * t-prot: Fix merging of multiple blank lines within pgp output using -Mmutt. 2010-02-15 19:02 Jochen Striepe * t-prot: Simplify expression. 2010-02-15 18:34 Jochen Striepe * t-prot, t-prot.1: Add --reply and --sani for fixing annoying headers. Add documentation for both. Many thanks to Matthias Kilian and Martin Neitzel for suggesting and providing some script invoked by procmail rules. 2010-02-14 12:03 Jochen Striepe * t-prot.1: Suggest reading about -p when using -P. 2010-02-14 12:00 Jochen Striepe * t-prot.1: Sort options in a consistent, alphabetical way. 2010-02-11 20:59 Jochen Striepe * t-prot.1: Fix hyphenation. Thanks to Gerfried Fuchs for noticing! 2010-02-11 12:55 Jochen Striepe * t-prot.1: Jeff Covey's article should not be missing under SEE ALSO. 2010-02-11 11:10 Jochen Striepe * t-prot: Release as v2.14. 2010-02-11 11:09 Jochen Striepe * t-prot: Code cleanup for --pgp-short. Should get better performance now. 2010-02-07 22:41 Jochen Striepe * t-prot: Tighten --help output. 2010-02-07 22:10 Jochen Striepe * t-prot.1: Add fields of usage and mention the INN2 filter file. 2010-02-07 21:56 Jochen Striepe * t-prot.1: Improve word flow. 2010-02-07 16:16 Jochen Striepe * t-prot.1: Another occurence of RFC 2822, update to RFC 5322. 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. 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. 2010-01-05 12:01 Jochen Striepe * contrib/filter_innd.pl: Command line default has changed, check flags must be set now. 2010-01-05 11:46 Jochen Striepe * t-prot.1: Better explain ratio check value. 2010-01-05 11:43 Jochen Striepe * t-prot.1: Update copyright time stamp. 2010-01-05 11:42 Jochen Striepe * t-prot, t-prot.1: Fix initialization and command line parsing for --check (this should work as advertised now). Make the ratio check code a little easier to read. Add the default value for the ratio check to the man page. 2010-01-04 11:07 Jochen Striepe * t-prot.1: Remove URLs to example scripts and configs. The files are provided with the package. 2009-12-30 21:34 Jochen Striepe * t-prot, t-prot.1: Fix last commit, release as t-prot v2.10. Update man page. 2009-12-30 21:28 Jochen Striepe * t-prot: Release as t-prot v2.9. 2009-12-30 21:27 Jochen Striepe * t-prot: Do not check for message length in attachments (we checked already for the entire message). Do exit with proper exit code if message is longer than set in --max-lines (so scripts can see if we gave up processing). 2009-12-30 09:07 Jochen Striepe * t-prot.1: Fix speling. 2009-12-25 17:40 Jochen Striepe * t-prot.1: Fix time stamp. 2009-12-20 21:38 Jochen Striepe * t-prot.1: Fix rendering for anyone out there using UTF-8. Many thanks (and a very merry Christmas) to Alfie. 2009-12-19 22:18 Jochen Striepe * t-prot: Release as v2.8. 2009-12-18 21:53 Jochen Striepe * t-prot, t-prot.1: Update documentation to reflect last change. Avoid being tripped by endless (or non-existant) headers. 2009-12-18 13:25 Jochen Striepe * t-prot: Change check order and remove duplicated code for --max-lines. 2009-08-24 20:32 Jochen Striepe * t-prot: Release as t-prot v2.7. 2009-08-24 17:20 Jochen Striepe * t-prot: Cosmetics. 2009-08-24 17:17 Jochen Striepe * t-prot: Cosmetics. 2009-08-24 12:15 Jochen Striepe * t-prot: Andreas Kneib had problems with some Microsoft Outlook gargabe and submitted a one-liner. Thanks! 2009-08-24 02:07 Jochen Striepe * t-prot: Release as t-prot v2.6. 2009-08-24 01:44 Jochen Striepe * t-prot.1: Update dates. 2009-08-24 01:43 Jochen Striepe * t-prot.1: Fix a typo, thanks to Gerfried Fuchs. 2009-08-24 01:42 Jochen Striepe * t-prot: Fix a typo, thanks to Michael Hunger. Tweak the MS-TOFU pattern, thanks to Simon Ruderich. 2007-09-19 11:32 Jochen Striepe * t-prot, t-prot.1: Updated time stamps, released as v2.5. 2007-09-19 11:31 Jochen Striepe * t-prot, t-prot.1: New feature, new command line switch: Hide TOFU produced by Novell Groupwise. Many thanks to Philipp Thomas for testing and suggesting. 2007-05-24 08:22 Jochen Striepe * t-prot.1: Update copyright date. 2007-03-09 15:06 Jochen Striepe * t-prot: Release as v2.4. 2007-03-09 15:05 Jochen Striepe * t-prot, t-prot.1: Add feature to skip processing very large messages. Many thanks to Gerfried Fuchs and Scorpi for testing and suggesting. 2007-03-09 14:33 Jochen Striepe * t-prot: Fix formatting for better reading. 2006-12-19 13:13 Jochen Striepe * t-prot: Release as v2.3. 2006-12-19 12:30 Jochen Striepe * t-prot.1: Fix grammar, update time stamp. 2006-12-19 12:04 Jochen Striepe * t-prot: Sync the order of options in the man page and "t-prot -h". 2006-11-30 14:06 Jochen Striepe * t-prot: Release as v2.2. 2006-11-30 13:02 Jochen Striepe * t-prot: Add string to detect gmx.de's M$ style TOFU. 2006-09-25 14:42 Jochen Striepe * t-prot.1: Make sure we can ship files not copyrighted by the author of the package. 2006-07-16 08:50 Jochen Striepe * t-prot.1: There are no patches for locales of old mutt versions. 2006-07-11 14:05 Jochen Striepe * t-prot.1: Updated time stamp. 2006-07-10 10:01 Jochen Striepe * t-prot.1: Fix spelling and grammar. 2006-06-23 17:28 Jochen Striepe * t-prot.1: Fix capitalization of "pgp". 2006-06-23 17:25 Jochen Striepe * t-prot.1: Add section about performance issues. 2006-06-17 22:45 Jochen Striepe * t-prot: Release as v2.1. 2006-06-17 22:45 Jochen Striepe * t-prot: Frank Terbeck suggested a more tolerant handling of signatures -- trailing newlines are no longer counted as signature lines, thus fixing some mailing list software behaviour. 2006-06-17 12:34 Jochen Striepe * t-prot.1: Update time stamp. 2006-06-17 12:34 Jochen Striepe * t-prot.1: Section "BUGS" is for known bugs in t-prot, not for learning how to report them. 2006-05-16 12:07 Jochen Striepe * t-prot: Klaus Ethgen reported some undetected MS TOFU hidden in MIME attachments. Many thanks! 2006-05-16 12:07 Jochen Striepe * t-prot.1: There is no BUGS file any longer. 2006-05-16 11:34 Jochen Striepe * t-prot.1: Time stamp and copyright updated. 2006-05-16 11:33 Jochen Striepe * contrib/t-prot.sl: Clarify comments reg. S-Lang v2. 2005-06-29 12:45 Jochen Striepe * t-prot.1: Better formatting for "see also". 2005-06-29 12:36 Jochen Striepe * t-prot.1: Add section about exit status. Update date string. 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. 2005-04-25 15:49 Jochen Striepe * t-prot: We must not forget to remove ad and mailing list footers within the first MIME/Multipart attachment when processing raw messages (lacking -M). 2005-04-25 15:29 Jochen Striepe * t-prot: Fix a comment. 2005-04-25 15:28 Jochen Striepe * t-prot: Mailing list footers (and probably ad footers) were not detected when processing raw MIME/Multipart messages: We have to look at the very end of the message, not only at the end of the first attachment. Fix this by calling remove_footers() before dealing with raw multipart attachments. 2005-04-15 14:08 Jochen Striepe * t-prot: Release as v1.100. 2005-04-15 14:07 Jochen Striepe * contrib/filter_innd.pl: We don't submit any headers, so use --body. Use unlink() instead of system(). Mention the temp file problem. 2005-04-15 14:03 Jochen Striepe * t-prot, t-prot.1: Add --body to make sure we are not looking for any headers when there are none in the input. 2005-04-15 13:42 Jochen Striepe * t-prot.1: Add some clarifications and missing details. 2005-03-31 19:39 Jochen Striepe * contrib/t-prot.sl: Use S-Lang calls popen(), fputs(), and remove() instead of system() and pipe_article() to reduce flickering (and for cleaner code). Patch by Gregor Herrman, many thanks! 2005-03-31 19:20 Jochen Striepe * contrib/t-prot.sl: Mention mimedecode as filter for Quoted Printable. Thanks to Gregor Herrmann. 2005-03-31 19:17 Jochen Striepe * contrib/t-prot.sl: Change key bindings: ESC-0 and ESC-1 are prefixes for other commands, so we should not overwrite those. Patch by Gregor Herrmann, many thanks! 2005-03-24 22:24 Jochen Striepe * t-prot: Release as v1.99. 2005-03-22 16:10 Jochen Striepe * t-prot: Fix false positive for kammquote condition. 2005-03-21 19:30 Jochen Striepe * t-prot: Fix missing range check when From: is the last header. Thanks to Norbert Tretkowski for reporting. 2005-03-01 15:20 Jochen Striepe * t-prot: Release as v1.98. 2005-03-01 15:20 Jochen Striepe * t-prot: Gerfried Fuchs pointed out that some locale maintainers might avoid quote signs, so we check for "%" too when extracting some locale strings. This still is not *really* bullet-proof, because e.g. the percent sign might be protected by an escape. This possibility should be quite unlikely, though, so we stick with it for now. 2005-02-24 23:34 Jochen Striepe * t-prot.1: Fix broken URL -- the Learn To Edit Messages Howto is no longer available at Sven Gucke's old site. 2005-02-24 22:45 Jochen Striepe * t-prot: Make esc() superfluous, use \Q and \E instead. Thanks to Gerfried Fuchs. 2005-02-23 13:07 Jochen Striepe * t-prot.1: Remove misleading information about locale names. 2005-02-23 12:39 Jochen Striepe * t-prot: Release as v1.97. 2005-02-23 12:38 Jochen Striepe * t-prot: Fix French (and probably many other) locales extraction. Many thanks to Philippe Berini and Gerfried Fuchs who helped a great deal with the bug hunt. 2005-02-14 15:02 Jochen Striepe * t-prot.1: Remove unnecessary lines. 2005-02-14 15:01 Jochen Striepe * t-prot.1: Fix copyright time stamp. 2005-02-14 14:19 Jochen Striepe * t-prot: Release as v1.96. 2005-02-14 14:18 Jochen Striepe * t-prot: GnuPG locale strings were for v1.2.6, update them to v1.4.0. 2005-02-14 13:29 Jochen Striepe * t-prot: Release as v1.95. The use of Locale::gettext is quite a big change, so we consider this a v2.0 pre-release. Please send any feature requests and bugreports NOW, so we can work on them before the release of v2.0. 2005-02-14 13:26 Jochen Striepe * t-prot.1: Mention the need for Locale::gettext when using --locale. Update date string. 2005-02-14 13:23 Jochen Striepe * t-prot: Following a suggestion by Gerfried Fuchs, make Locale::gettext fetch the locale strings for us. Big change, please report any funny behaviour -- thanks! 2005-02-02 13:46 Jochen Striepe * t-prot: Release as v1.49. 2005-02-02 12:22 Jochen Striepe * t-prot: Torsten Veller spotted a violation of RFC 2822 in the pgp() code when dealing with multi-line From: headers. Many thanks for reporting! 2005-02-01 15:38 Jochen Striepe * t-prot: Fix missing Locale value. 2005-02-01 14:15 Jochen Striepe * t-prot: Fix another regex. 2005-02-01 13:50 Jochen Striepe * t-prot: Fix regexes. 2005-01-08 11:05 Jochen Striepe * t-prot.1: Fix broken link. 2005-01-07 18:15 Jochen Striepe * contrib/t-prot.sl: Now that line breaks by the encoding are better detected, we will turn on signature checking once again. 2005-01-07 18:14 Jochen Striepe * contrib/t-prot.sl: Gregor Herrmann found some problems with S-Lang variables and provided documentation improvements. 2005-01-01 13:17 Jochen Striepe * t-prot.1: Fix typo. 2005-01-01 13:14 Jochen Striepe * t-prot.1: T-prot's name does not have to be highlighted each time it occurs. 2005-01-01 13:12 Jochen Striepe * t-prot.1: Add note about t-prot fitting to recent mutt and gnupg versions. 2004-12-31 13:45 Jochen Striepe * t-prot: Release as v1.48. 2004-12-31 13:39 Jochen Striepe * t-prot: Fix off-by-one error in TOFU code. 2004-12-31 13:33 Jochen Striepe * t-prot: Gnupg-1.4.0 again changes the locales. Sigh. 2004-10-25 22:50 Jochen Striepe * t-prot: Fix false positive reported by Gerfried Fuchs. Many thanks! 2004-10-21 16:16 Jochen Striepe * t-prot: Release as v1.47. 2004-10-21 16:16 Jochen Striepe * t-prot: Fix --ftr-ad and --ftr-ml command line parsing and initialisation. --ftr-ad implicitely sets -a, --ftr-ml implicitely sets -l. Many thanks to Andre Berger. 2004-10-21 15:13 Jochen Striepe * t-prot.1: Make the documentation for -a, -A, and --ftr-ad (resp. -l, -L, and --ftr-ml) more elaborate. Many thanks to Andre Berger. 2004-10-21 12:26 Jochen Striepe * t-prot.1: Try to explain -a and -l in more detail (without confusing everyone). 2004-10-21 12:13 Jochen Striepe * t-prot: Release as v1.46. 2004-10-10 21:10 Jochen Striepe * contrib/t-prot.sl: Remove -S command line option as line counts get wrong with quoted-printable (which gets more and more widely used). 2004-10-10 20:47 Jochen Striepe * t-prot, t-prot.1: Remove the groups flag within --check: This is done easier inside filter_innd.pl (where it is actually implemented already). 2004-10-10 20:43 Jochen Striepe * t-prot: Realign global vars into three categories: command-line switches, mutt locales, gnupg locales. This should be much more readable. 2004-10-10 20:27 Jochen Striepe * t-prot.1: Fix typo. Update date string. 2004-10-10 20:26 Jochen Striepe * contrib/filter_innd.pl: Reject full quotes as well. 2004-10-10 19:50 Jochen Striepe * t-prot: Performance fix. 2004-10-10 19:47 Jochen Striepe * contrib/filter_innd.pl: Update comment. 2004-10-10 19:28 Jochen Striepe * t-prot: Fix --check flags parsing to be stricter. 2004-10-10 19:22 Jochen Striepe * t-prot: Fix --check flags parsing. 2004-10-09 10:17 Jochen Striepe * t-prot: Release as v1.45. 2004-10-09 10:08 Jochen Striepe * t-prot: Check for empty footer files before processing them. Many thanks to Markus Hubig. 2004-09-28 11:19 Jochen Striepe * t-prot: Release as v1.44. 2004-09-28 11:19 Jochen Striepe * t-prot: Fix detection of MS-style TOFU within PGP signed messages. Many thanks to Gerfried Fuchs for reporting. 2004-09-27 17:45 Jochen Striepe * t-prot.1: Update time stamp. 2004-09-27 17:40 Jochen Striepe * t-prot.1, contrib/filter_innd.pl: Add credits to Martin Dietze. 2004-09-27 17:23 Jochen Striepe * t-prot: Release as v1.43. 2004-09-27 17:22 Jochen Striepe * t-prot: Fix MS-style TOFU removal for attachments when invoked from mutt. Many thanks to Gerfried Fuchs. 2004-09-27 17:05 Jochen Striepe * t-prot: Fix typo, small performance enhancement. 2004-09-27 15:27 Jochen Striepe * t-prot: Minor cleanup. 2004-09-20 17:02 Jochen Striepe * contrib/filter_innd.pl: New file. 2004-09-20 17:01 Jochen Striepe * t-prot, t-prot.1: Add INN2 filtering aids. New command line switch --check. Release as v1.42. 2004-09-20 14:13 Jochen Striepe * t-prot: Website http://learn.to/edit_messages/ is no longer available. 2004-08-28 11:50 Jochen Striepe * t-prot: Release as v1.41. 2004-08-28 11:42 Jochen Striepe * t-prot, t-prot.1: Make t-prot use gnupg's locales as in gpg-1.2.6. 2004-08-07 16:57 Jochen Striepe * t-prot.1: Update Copyright date. 2004-08-07 16:34 Jochen Striepe * t-prot: Fix last changes so attachments are separated by at least one empty line (as done in the pgp code as well). 2004-08-07 15:52 Jochen Striepe * t-prot: Release as v1.40. 2004-08-07 15:51 Jochen Striepe * t-prot, t-prot.1: Add new option --ms-smart. Right now only special pgp treatment is included (this fixes the behaviour when there is a clear text pgp signed message embedded in some MS style TOFU). This should work fine, but you never know what crap Outlook users will send. So please give feedback if the results are not as they should be. 2004-08-07 13:37 Jochen Striepe * t-prot.1: Remove "require" line note. Update date string. 2004-08-07 13:20 Jochen Striepe * t-prot: More checks on command line correctness. 2004-08-07 12:58 Jochen Striepe * t-prot: Fix typo introduced with last update. 2004-08-07 12:48 Jochen Striepe * t-prot: Fix "require" statement to match the code. 2004-07-31 11:41 Jochen Striepe * t-prot: Release as v1.39. 2004-07-31 11:10 Jochen Striepe * t-prot.1: Reflect locale changes in gnupg-1.2.5, update date string. 2004-07-31 10:41 Jochen Striepe * t-prot: Fix "be" gnupg locales. Update locales to newly released gnupg-1.2.5 (and be incompatible to gnupg-1.2.4 and earlier once again, *sigh* -- however, that's the price for not simply setting the LC vars to "C"...). 2004-07-17 13:28 Jochen Striepe * t-prot, t-prot.1: Add option to have no output file. 2004-04-25 01:51 Jochen Striepe * t-prot.1: Add warning regarding --pgp-move-vrfy and signals to gpg. 2004-03-02 16:57 Jochen Striepe * t-prot: Comment updated: Reflect the fact that no locales have changed in mutt-1.4.2.1. 2004-03-02 15:54 Jochen Striepe * muttrc.t-prot, t-prot.sl: Moved to contrib/. 2004-02-11 16:05 Jochen Striepe * t-prot: Comment updated: Reflect the fact that no locales have changed in mutt-1.4.2. 2004-01-31 02:06 Jochen Striepe * t-prot.1: Fix copyright date. 2004-01-30 15:20 Jochen Striepe * t-prot.1: Change --ftr to --ftr-ad, add --ftr-ml. 2004-01-30 15:08 Jochen Striepe * t-prot: Release as v1.38. 2004-01-30 14:38 Jochen Striepe * t-prot: Change --ftr option to --ftr-ad. Add --ftr-ml option. Many thanks to Christian Wach for pointing at the problem. 2004-01-30 14:31 Jochen Striepe * t-prot: Small performance fix in footer treatment. 2004-01-21 13:46 Jochen Striepe * t-prot: Release as v1.37. 2004-01-21 13:45 Jochen Striepe * t-prot: Fix processing if first attachment is of type application/pgp. 2004-01-21 13:39 Jochen Striepe * t-prot: Small performance fix. 2003-12-29 17:06 Jochen Striepe * t-prot: Release as 1.36. 2003-12-29 17:06 Jochen Striepe * t-prot: Fix Kammquote behaviour for words divided by a hyphen. 2003-12-29 15:33 Jochen Striepe * t-prot.1: Update date string. 2003-12-29 15:09 Jochen Striepe * t-prot, t-prot.1: Update locales for gnupg-1.2.4. 2003-12-29 12:59 Jochen Striepe * t-prot: Mutt-1.4.1 has no support for SSL, so we may drop it altogether. Mutt developer versions are handled in patches. 2003-11-22 02:35 Jochen Striepe * t-prot: Fix comments for gpg and mutt locales. 2003-11-20 14:51 Jochen Striepe * t-prot: Fixed --pgp-move-vrf: Obviously, gpg output should not be interpreted as successful if a bug showed up (boy, I never saw this with good old gnupg-1.0.7). Released as v1.35. 2003-11-19 21:05 Jochen Striepe * t-prot: Release as v1.34. 2003-11-19 20:58 Jochen Striepe * t-prot: Cosmetics. 2003-11-19 20:45 Jochen Striepe * t-prot.1: Cosmetics. 2003-11-19 20:43 Jochen Striepe * t-prot.1: Change time stamp. 2003-11-19 20:43 Jochen Striepe * t-prot.1: Update man page to reflect last changes. 2003-11-19 20:41 Jochen Striepe * t-prot: Update gpg's locales to gpg-1.2.3. Support for gpg-1.0.7's locales is available as a patch. 2003-11-19 20:11 Jochen Striepe * t-prot.1: Update man page to reflect last changes. 2003-11-19 20:10 Jochen Striepe * t-prot: Removed option --mutt-ver for sanity reasons. Special adapations for mutt developer versions will be available as a patch. 2003-09-10 11:32 Jochen Striepe * t-prot.1: Make clear t-prot.sl is just an example implementation. Update date string. 2003-09-10 11:30 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Additional comments. 2003-08-11 14:35 Jochen Striepe * t-prot: Release as v1.33. 2003-08-11 14:35 Jochen Striepe * t-prot.1: Improve description for --mutt-ver. 2003-08-11 14:33 Jochen Striepe * t-prot.1: Update date string. 2003-08-11 14:32 Jochen Striepe * t-prot: Clean up locales stuff. 2003-08-11 14:19 Jochen Striepe * t-prot: Fix parsing order with --mutt-ver and --locale. 2003-08-11 14:05 Jochen Striepe * t-prot.1: Add description for --mutt-ver. 2003-08-11 14:00 Jochen Striepe * t-prot: Add some locale that changed in mutt-1.5.4 (and made pgp block detection fail). New parameter --mutt-ver. Many thanks to Gerfried Fuchs. Release as v1.32. 2003-08-11 13:41 Jochen Striepe * t-prot: Simplify regex introduced in last update. 2003-08-09 22:22 Jochen Striepe * t-prot: Fix some cases where SIGINT was not detected for pgp verification from within mutt. Release as v1.31. 2003-07-21 13:12 Jochen Striepe * t-prot: Release as v1.30. 2003-07-21 13:12 Jochen Striepe * t-prot: Recognize LC_MESSAGES for locales. Thanks to Gerfried Fuchs. 2003-07-15 13:39 Jochen Striepe * t-prot: Release as v1.29. 2003-07-15 13:38 Jochen Striepe * t-prot: Fix email adress verification inside pgp(). Fix locale detection. 2003-07-09 21:11 Jochen Striepe * t-prot: Use the environment variable LC_ALL (and if this fails, LANG) to determine a reasonable locale default. Suggested by Michael Olbrich. Release as v1.28. 2003-06-24 23:52 Jochen Striepe * t-prot: Release as v1.27. 2003-06-24 23:52 Jochen Striepe * t-prot: Getting some rare multipart message from mutt, t-prot got locked into a probably endless 100% CPU consuming loop (see msgid <20030624071950.GA24479@sil.at>). This was a DoS and therefore a security problem if you use t-prot in some automated setup. This bug was only triggered when used with -Mmutt. BTW, fixing this should also increase performance when processing multipart messages with -Mmutt. Many many thanks to Gerfried Fuchs for alerting us and pointing out the DoS character of the bug (though most people might not use mutt to do fully automated email processing). 2003-06-24 22:44 Jochen Striepe * t-prot: Fix treatment of forwarded messages by Opera7. 2003-06-23 14:10 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Quoted-printable treatment (hopefully this will be obsolet with S-Lang-2.0) and some minor fixes. 2003-06-23 13:20 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Add missing semicolon. 2003-06-23 12:58 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Fix error treatment. 2003-06-22 23:47 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Make the tmp dir configurable, correct some plain wrong comments, and add some more comments. 2003-06-22 22:57 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Make the S-Lang example macro more configurable (thanks to Gerfried Fuchs for some suggestions) and provide a possibility to toggle filtering on/off from within slrn (thanks to Michael Prokop for feedback). 2003-06-15 22:53 Jochen Striepe * t-prot.1, t-prot.sl, contrib/t-prot.sl: Add some comments to t-prot.sl and update the man page to mention the S-Lang example macro. 2003-06-15 22:33 Jochen Striepe * t-prot.sl, contrib/t-prot.sl: Added S-Lang macro to use t-prot from within slrn(1). 2003-05-04 12:40 Jochen Striepe * t-prot: Fix handling of empty lines in traditional TOFU code: TOFU broken into parts by empty lines will be detected correctly now, empty lines will not be deleted if there is no TOFU at all. Release as v1.26. 2003-04-23 14:50 Jochen Striepe * t-prot: Finally fix thrown away verbatim information with --pgp-move-vrf and -k (hope you had a happy Easter too). Many thanks to Gerfried Fuchs. Release as v1.25. 2003-04-03 13:26 Jochen Striepe * t-prot: Regex performance fixes. 2003-03-20 02:09 Jochen Striepe * t-prot, t-prot.1: New locale in mutt-1.4.1: bg. Release as v1.24. 2003-03-18 16:08 Jochen Striepe * t-prot: Clean up $0 usage. 2003-03-08 17:05 Jochen Striepe * t-prot: Pure cosmetics. 2003-03-08 16:48 Jochen Striepe * t-prot: Release as v1.23. 2003-03-08 16:43 Jochen Striepe * t-prot: Fix another typo. 2003-03-08 16:40 Jochen Striepe * t-prot: Fix typo in last commit. 2003-03-08 16:37 Jochen Striepe * t-prot: Add a handler for SIGINT -- pgp() has to know if we got an interrupt. Many thanks to Gerfried Fuchs. 2003-03-08 02:24 Jochen Striepe * t-prot, t-prot.1: Add a workaround for old mutt versions using the pagerfilter patch. Do not activate --lax-security unless you really know what you are doing. 2003-03-07 14:19 Jochen Striepe * t-prot: Ignore SIGINTs when called from within mutt. You probably want the chance to stop PGP verification and still have the message displayed. Idea by Peter Palfrader, suggested for t-prot by Gerfried Fuchs. Thanks, great idea! Release as v1.22. 2003-03-05 17:26 Jochen Striepe * t-prot: Release as v1.21. 2003-03-05 17:15 Jochen Striepe * t-prot: Various performance fixes. 2003-03-05 17:02 Jochen Striepe * t-prot: Another performance fix. 2003-03-05 16:59 Jochen Striepe * t-prot: Fix multipart boundary detection. 2003-03-05 16:53 Jochen Striepe * t-prot: Another performance fix in pgp(). 2003-03-05 16:51 Jochen Striepe * t-prot: Fix bad typo. 2003-03-05 16:35 Jochen Striepe * t-prot: Performance improvements in pgp(). 2003-03-05 16:14 Jochen Striepe * t-prot: Make kammquote code more efficient. 2003-03-05 16:09 Jochen Striepe * t-prot: Fix kammquote condition. 2003-03-05 15:54 Jochen Striepe * t-prot: Some cosmetics, no code changes. 2003-03-01 17:49 Jochen Striepe * t-prot: Formatting: Replace tabs with spaces. 2003-03-01 17:46 Jochen Striepe * t-prot: Add some comments. 2003-02-26 22:56 Jochen Striepe * t-prot.1: Reflect the fact that world has not stopped spinning after RFC 822 (so far, at least). Mention RFCs 2045, 2046, 2049, and 2822. Thanks to Thomas Bliesener for noticing. 2003-02-26 22:32 Jochen Striepe * t-prot.1: Add an example for bouncing TOFU'ed messages using sendmail(8). Add a note that -m/-t is needed for successful use of -p. Thanks to Thomas Bliesener. 2003-02-19 22:05 Jochen Striepe * t-prot: Release as v1.20. 2003-02-19 21:53 Jochen Striepe * t-prot: Fix missing verbatim vals when moving gpg output. 2003-02-17 15:00 Jochen Striepe * t-prot.1: Update Copyright date. 2003-02-17 13:53 Jochen Striepe * t-prot: Fix moving gpg output for signatures by expired keys. Release v1.19. 2003-02-17 13:35 Jochen Striepe * t-prot: Fix sender address for --pgp-short. 2003-02-17 13:02 Jochen Striepe * t-prot: Remove unnecessary variable in write_msg(). 2003-02-17 12:59 Jochen Striepe * t-prot: Regex performance improvements. 2003-02-17 01:59 Jochen Striepe * t-prot: Fix mutt-pgp code: if we have nested signed/encrypted mime parts, we must take care that all gpg output is printed. Release v1.18. 2003-02-17 00:08 Jochen Striepe * t-prot: Make t-prot compile again on perl-5.6.1 (many thanks to Brian Medley). Release v1.17. 2003-02-14 14:50 Jochen Striepe * t-prot: Fix missing check. 2003-02-14 14:42 Jochen Striepe * t-prot: Fix really annoying footer unflexibility. Now empty lines on the bottom of a message are ignored. Release v1.16. 2003-02-11 21:06 Jochen Striepe * t-prot: Fix --bigq for big quotes that go down to one of the two last lines. Release v1.15. 2003-02-11 13:49 Jochen Striepe * t-prot: Fix ad footers within pgp signed stuff. 2003-02-11 13:42 Jochen Striepe * t-prot: Fix trailing empty lines ("match anything") in ad footer files. Release v1.14. 2003-02-09 20:34 Jochen Striepe * t-prot: Add support for mutt-1.5.x's OpenSSL output for S/MIME. Thanks to Michael Loeffler. Clean up some regexps for mutt's separators (should give better performance now). Release v1.13. 2003-02-08 18:19 Jochen Striepe * t-prot, t-prot.1: Integrate the footers patch to allow aggressive ad footer matching. Release v1.12. 2003-02-08 17:44 Jochen Striepe * t-prot: Use constants where possible. 2003-02-07 19:16 Jochen Striepe * t-prot: Fix two bugs in the Big Kammquote Condition. Using -k should work again. Release v1.11. 2003-02-07 18:26 Jochen Striepe * t-prot: Fix another terminal color sequence. 2003-02-07 16:29 Jochen Striepe * t-prot.1: List contributors in alphabetical order. 2003-02-07 16:00 Jochen Striepe * t-prot.1: Update date string. 2003-02-07 15:55 Jochen Striepe * t-prot.1: Add a note to the BUGS section about possible perl compiler errors with not-up-to-date perl installations. 2003-02-07 11:51 Jochen Striepe * t-prot: Make --pgp-move-vrf work for BAD signatures too (many thanks to Gerfried Fuchs). Release v1.10. 2003-02-06 16:11 Jochen Striepe * t-prot: Last change broke attachment detection for -Mmutt. 2003-02-06 15:37 Jochen Striepe * t-prot: Fix mutt terminal color sequences. Fix false positive for overlong signatures with mutt-1.5.3 (MANY MANY thanks to Gerfried Fuchs for reporting the bug and providing vital data!). Release v1.9. 2003-01-29 03:24 Jochen Striepe * t-prot.1: Update date string. 2003-01-29 03:23 Jochen Striepe * t-prot.1: Fix spellling error. 2003-01-28 12:00 Jochen Striepe * t-prot: Make -h work again. Version bump to 1.8. 2002-12-29 03:52 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Enable spamassassin workaround. Update man page and sample config file accordingly. Correct some speling errors in the man page. Bump to v1.7. 2002-12-11 18:53 Jochen Striepe * t-prot: Mutt content type fix. Version bump to 1.6. 2002-12-11 01:46 Jochen Striepe * t-prot: Improve M$ style TOFU heuristics. Bump to v1.5. 2002-12-08 22:45 Jochen Striepe * t-prot: Remove unused else. 2002-12-06 16:21 Jochen Striepe * t-prot: Fix treatment of pgp uids without email adress for --pgp-move. Many thanks to Gerfried Fuchs for noticing. Small performance fix for --pgp-move-vrf. Bump to v1.4. 2002-12-04 20:45 Jochen Striepe * t-prot: Fix --pgp-short to be overzealous with gpg encryption output. Version bump to 1.3. 2002-12-04 09:06 Jochen Striepe * t-prot.1: Another --locale fix. 2002-12-04 09:01 Jochen Striepe * t-prot.1: Update --locale description. 2002-12-03 18:20 Jochen Striepe * t-prot: Add internationalization for --pgp-move-vrf from gnupg-1.0.7's po files. Should work with gnupg-1.2.x as well. Bump to v1.2. 2002-12-02 21:04 Jochen Striepe * t-prot.1: Update man page date string. 2002-12-02 21:03 Jochen Striepe * t-prot.1: Make last man page update more complete. 2002-12-02 21:00 Jochen Striepe * t-prot, t-prot.1: Add an option to move only positive pgp verification output (this works for English gpg-1.0.7 right now -- no internationalization, no pgp.com support). Thanks to Markus Hubig for suggesting. 2002-11-11 02:59 Jochen Striepe * t-prot: Version 1.0. 2002-11-09 02:22 Jochen Striepe * t-prot.1: Man page update. 2002-11-09 01:53 Jochen Striepe * t-prot: Adding comment for pgp(). 2002-11-05 13:29 Jochen Striepe * t-prot: Fix a race condition introduced in 0.70. Many many thanks to Wichert Akkerman and Gerfried Fuchs. Bump to v0.94. 2002-11-04 19:01 Jochen Striepe * t-prot: Fix typo from last submission. Bump to v0.93. 2002-11-04 18:49 Jochen Striepe * t-prot: Markus Hubig noticed a bug in the kammquote condition that ate the first (empty) line of pgp signed data when using t-prot within mutt. Many thanks! Version bump to 0.92. 2002-11-02 16:35 Jochen Striepe * t-prot: Replace all die()s with exit()s and appropriate exit codes for better interaction with MTAs. Bump to v0.91. 2002-11-02 16:08 Jochen Striepe * t-prot: Minor changes. 2002-11-02 01:05 Jochen Striepe * t-prot.1: Update man page modification stamp. 2002-11-01 18:30 Jochen Striepe * t-prot, t-prot.1: Merge the pgp hack after solving the last pending bug report (thanks to Markus Hubig). Update the man page to represent changes. Huge version jump to v0.90: this is a release candidate for v1.0, every main feature should work fine by now. Please tell me *now* if something does not work for you (or if you have a major feature request that should be considered before v1.0). 2002-10-31 18:29 Jochen Striepe * t-prot: Eye candy: People using vim with a tabwidth!=4 should see the source with proper alignment now. 2002-10-31 14:17 Jochen Striepe * t-prot: T-prot would cheerfully create an output file without checking to see if it was about to write to a symlink or a named pipe. If a user used t-prot to write data into open shared directories, such as /tmp, this vulnerability could be used by a local attacker to overwrite files or lead to privilege escalation. Bump to v0.70. 2002-10-22 16:42 Jochen Striepe * t-prot: Add French M$ tofu detection (many thanks to Mikael Berthe for suggesting). 2002-10-19 17:22 Jochen Striepe * t-prot: Using any of --kminl, --kmaxl, or --kdiff implicitely activates -k. Specifying an empty string for -i or -o is no longer tolerated. Version bump to 0.69. 2002-10-19 16:15 Jochen Striepe * t-prot: Support for Dutch(?) M$-style TOFU markers. 2002-09-14 05:24 Jochen Striepe * t-prot: Fixed thinko in M$ TOFU/Forwarding treatment. 2002-09-14 05:10 Jochen Striepe * t-prot: Johan Almqvist found another bug, this time false positives with some M$ MUA's forwarded messages. 2002-09-12 12:59 Jochen Striepe * t-prot: Add swedish M$ TOFU detection. Thanks to Johan Almqvist for noticing. Bumped to v0.68. 2002-07-26 14:03 Jochen Striepe * t-prot: Eye candy: add vim-6.x compliant folding comments. 2002-07-09 14:07 Jochen Striepe * t-prot: Try better heuristics for M$ style TOFU. Gerfried Fuchs had some very reasonable ideas (<20020705143319.GH11482@asgard.pte.at>, 2002-07-05). We now tolerate MS style TOFU if there is no text above. Version bump to v0.67. 2002-06-27 21:37 Jochen Striepe * t-prot: Fix unbelievable stupid typo introduced in the last commit. Bump to v0.66. 2002-06-27 19:54 Jochen Striepe * t-prot: Fix detection of mailing list footers in attachments within attachments. Bump to v0.65. 2002-06-27 18:16 Jochen Striepe * t-prot, t-prot.1: Fix thinko where to search for mailing list footers, bug reported by Gerfried Fuchs (many thanks!). Update manpage to make clear -Mmutt is *required* when t-prot is called from within mutt. Bump to v0.64. 2002-06-18 01:45 Jochen Striepe * t-prot: Another tweak on the kammquote condition. 2002-06-16 12:32 Jochen Striepe * t-prot: Fixed the line count header with -Mmutt and attachments, pgp signatures and encryption. 2002-06-15 17:18 Jochen Striepe * t-prot: Another tweak on the kammquote condition. 2002-06-08 19:50 Jochen Striepe * muttrc.t-prot, contrib/muttrc.t-prot: Add warning comment about required mutt version. 2002-06-02 07:51 Jochen Striepe * t-prot: Fixed some typos. 2002-06-02 07:12 Jochen Striepe * t-prot.1: Updated manpage. The Kammquote problem should be mostly solved by now. 2002-06-02 02:12 Jochen Striepe * t-prot, t-prot.1: New option --sigsmax for fine-tuning the tolerated number of signatures. Manpage updated. Version bump to v0.61. 2002-05-30 11:24 Jochen Striepe * t-prot: Update help to reflect -p changes. 2002-05-30 11:16 Jochen Striepe * t-prot: Bump to v0.60. 2002-05-30 10:45 Jochen Striepe * t-prot.1: Update manpage for new behaviour of -p. 2002-05-10 02:18 Jochen Striepe * t-prot: Add some quick hack to make t-prot an easy drop-in for spamassassin: the parameter for -p is optionally right now. If there is none supplied, there is no mail sent, of course. 2002-05-03 02:02 Jochen Striepe * t-prot.1: Fix typo. 2002-05-03 01:56 Jochen Striepe * t-prot.1: Update man page date. 2002-05-03 01:55 Jochen Striepe * t-prot.1: Man page fixes and updates. 2002-04-30 17:23 Jochen Striepe * t-prot: Improve the comment on the Kammquote condition. 2002-04-30 17:16 Jochen Striepe * t-prot: Further tweak on the Kammquote condition. Should really do The Right Thing by now. 2002-04-24 14:08 Jochen Striepe * t-prot: Performance tweak in debigq(). 2002-04-24 13:33 Jochen Striepe * t-prot, t-prot.1: Added an option to remove the bigger part of huge blocks of quoted lines (--bigq). Updated the man page accordingly. Updated the man page's contributors text. Bump to v0.58. 2002-04-20 21:32 Jochen Striepe * t-prot: Just insert one space when joining lines in decomb(). 2002-04-20 15:37 Jochen Striepe * t-prot.1: Update man page to reflect upon new options --kminl, --kmaxl, and --kdiff. 2002-04-20 15:18 Jochen Striepe * t-prot: Some more tweaks to the Kammquote condition. Add some command line switches to make behaviour a little more flexible. Bump to v0.57. 2002-04-20 11:10 Jochen Striepe * t-prot: Another small tweak in the Kammquoting condition. 2002-04-20 11:03 Jochen Striepe * t-prot: Another small tweak in the Kammquote condition. 2002-04-20 10:58 Jochen Striepe * t-prot: Make the Kammquote condition a little pickier. 2002-04-20 02:48 Jochen Striepe * t-prot.1: Add description of the anti Kammquoting option. 2002-04-20 02:28 Jochen Striepe * t-prot: Added an option to fix those zig-zag shaped quotings, well-known to German users as "Kammquoting". Lines with verbatim statements (#v+/-) itselves are now verbatim by definition, so they won't be cleaned away. Bumped to v0.56. 2002-04-18 22:51 Jochen Striepe * t-prot: Clean up revision number a bit. 2002-04-11 05:14 Jochen Striepe * t-prot: Just catch the last signature if there are more. 2002-04-11 04:46 Jochen Striepe * t-prot: Hugo Haas reported that t-prot did not detect TOFU if there is an overlong signature and no -S on the command line. Though this was intended behaviour, this is changed: by now signatures are always interpreted as such, so the text before can be parsed properly. 2002-03-29 01:46 Jochen Striepe * t-prot.1: Add description for --locale=LOCALE. 2002-03-29 01:15 Jochen Striepe * t-prot: Add option to treat mutt(1)'s locales correctly. Bump to v0.55. 2002-03-23 10:47 Jochen Striepe * t-prot: Fix typo. 2002-03-22 11:38 Jochen Striepe * t-prot.1: Add ghw to the IDEAS AND INSPIRATION section. 2002-03-21 22:26 Jochen Striepe * t-prot: Bump to 0.54. 2002-03-21 13:16 Jochen Striepe * t-prot: More cleanups in the multipart code. 2002-03-21 12:53 Jochen Striepe * t-prot: Fix comment in the mutt specific multipart code. 2002-03-21 12:27 Jochen Striepe * t-prot: Fixed assumption in the mutt-specific code that the first attachment always would be text/plain containing the actual message text. 2002-03-20 22:58 Jochen Striepe * t-prot: Fix some false positives in footers and multipart code. 2002-03-20 17:02 Jochen Striepe * t-prot: More cleanups and performance improvements. Fixed tofu deletion when diff appended to signature. Fixed broken detection of mutt(1)'s mime/pgp output. Bumped to 0.53. 2002-03-20 15:12 Jochen Striepe * t-prot: Make mime/multipart parts with type=message/rfc822 being processed if the message has been processed by mutt(1) before. 2002-03-20 13:16 Jochen Striepe * t-prot: Another HUGE cleanup. 2002-03-20 01:56 Jochen Striepe * t-prot: Major cleanup. Bump to 0.52. 2002-03-19 14:16 Jochen Striepe * t-prot: Fixed some bugs in the multipart code. Bumped version to 0.51. 2002-03-19 12:42 Jochen Striepe * t-prot.1: Add note describing the complicated and confusing line count thingie when deleting an overlong signature. 2002-03-19 12:38 Jochen Striepe * t-prot: Correct line count in snipped-overlong-sig message. 2002-03-18 19:19 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Add new options (-a and -A=dir) to get rid of those annoying hotmail advertisements appended to messages from people using gratis email providers. Update manpage and muttrc sample. Add non-usascii-problem to TROUBLESHOOTING section of the man page. Bump to v0.50. 2002-03-18 15:49 Jochen Striepe * t-prot: Fix the line count header. Bump to v0.49. 2002-03-16 00:01 Jochen Striepe * t-prot.1: Minor fix. 2002-03-15 23:58 Jochen Striepe * t-prot.1: Minor cleanup. 2002-03-15 01:48 Jochen Striepe * t-prot: Fix variables initialisation. 2002-03-14 22:21 Jochen Striepe * t-prot: Fix a bug in the multipart code. Bump to v0.48. 2002-03-13 08:07 Jochen Striepe * t-prot.1: Add some explanation for the verbatim instruction to the troubleshooting section. 2002-03-13 07:52 Jochen Striepe * t-prot: Make verbatim instructions work for everything except mailing list footers. Bump to v0.47. 2002-03-13 01:19 Jochen Striepe * t-prot.1: Fixed typo. 2002-03-12 17:16 Jochen Striepe * t-prot.1: Add TROUBLESHOOTING section. 2002-03-12 16:44 Jochen Striepe * t-prot.1: Changed one makro which was overseen last commit. 2002-03-12 16:24 Jochen Striepe * t-prot.1: Big man page cleanup. 2002-03-12 15:41 Jochen Striepe * t-prot.1: Further improvement of the -L man page text. 2002-03-12 15:39 Jochen Striepe * t-prot.1: Improved man page text for -L. 2002-03-12 15:37 Jochen Striepe * t-prot.1: Clarify the man page text for -l and -L. 2002-03-12 02:47 Jochen Striepe * t-prot, t-prot.1: Add the "tolerate diff" option. Bump to v0.46. 2002-03-09 17:18 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Add option -M/--mua and try to detect attachments only when necessary. Updated man page and muttrc sample. Version bump to 0.45. 2002-03-08 20:29 Jochen Striepe * t-prot: Fix an off-by-one error when removing mutt(1)'s attachments. Credits to Gerfried Fuchs for reporting and locating the bug. 2002-03-02 02:26 Jochen Striepe * t-prot: Some minor cleanups. 2002-03-02 02:18 Jochen Striepe * t-prot: Some minor cleanups. 2002-03-01 10:10 Jochen Striepe * t-prot: Fixed a missing range check reported by Gerfried Fuchs with messages only containing the mailing list footer. 2002-02-26 12:20 Jochen Striepe * t-prot: Add infrastructure for better debugging. 2002-02-26 11:11 Jochen Striepe * muttrc.t-prot, contrib/muttrc.t-prot: Make the muttrc example a little shorter, and add colors. 2002-02-26 03:05 Jochen Striepe * t-prot: Improve empty line handling between body and signature. 2002-02-26 02:50 Jochen Striepe * t-prot: Fixed thinko in signature handling. Be more tolerant with empty lines around signatures and mailing list footers. Version bump to 0.42. 2002-02-25 19:20 Jochen Striepe * t-prot: Widened the rexexp for mutt(1)'s attachments a little - some cases were not caught before. 2002-02-25 18:48 Jochen Striepe * t-prot: Gerfried Fuchs found a bug in the signature code (many thanks!). It was ugly anyway, so that part got a clean rewrite. Bumped version to 0.41. 2002-02-22 15:55 Jochen Striepe * t-prot: Another slight performance hit with multipart messages. 2002-02-22 15:36 Jochen Striepe * t-prot: Leave only the body of the first multipart message part for processing, not the headers. 2002-02-21 23:27 Jochen Striepe * t-prot.1: Updated the manpage to reflect the fix of the multipart bug. 2002-02-21 23:24 Jochen Striepe * t-prot: Fix no TOFU is detected in multipart messages without signature and without previous preparation by mutt(1). Now multipart messages as described in RFC 1341 are detected properly. Only the first part is processed, and only if it has the content type "text/plain" or none specified as described in RFC 1341. 2002-02-20 16:51 Jochen Striepe * t-prot: Bump version to 0.39. 2002-02-20 16:50 Jochen Striepe * t-prot.1: Updated manpage for long options. 2002-02-18 19:44 Jochen Striepe * t-prot.1: Updated credits in manpage. 2002-02-16 00:06 Jochen Striepe * muttrc.t-prot, t-prot, contrib/muttrc.t-prot, t-prot.1: Switched command line system to Getopt::Mixed as recommended by Gerfried Fuchs. One of the reasons is that now the parameter of the option '-S' is optionally, what was not cleanly realizeable before. The opportunity has been used to do a cleanup on some things, too ... Please note that Getopt::Mixed now is mandatory to run t-prot - you can get it at CPAN. The trade-off seems worthy IMHO - please drop an email to if you do not think so, so the matter can be discussed. :) Updated manpage. 2002-02-15 03:49 Jochen Striepe * t-prot.1: Beautify the manpage, and add some more info about bugs and todos. 2002-02-15 03:30 Jochen Striepe * t-prot: Beautify help text. 2002-02-14 16:32 Jochen Striepe * t-prot, t-prot.1: Bjoern Buerger requested an option to make t-prot write a syslog entry for each message bounced when invoked with -p. So -d is new. Will only write syslog entries if Sys::Syslog is available but will not crash if not. 2002-02-14 13:26 Jochen Striepe * t-prot: Minor cleanup. 2002-02-14 11:04 Jochen Striepe * t-prot: Fix unbelieveable stupid bug in attachment fix. Bump to v0.36. 2002-02-13 01:08 Jochen Striepe * t-prot: Version bump to 0.35. 2002-02-12 13:57 Jochen Striepe * t-prot, t-prot.1: Added Option -P=MESSAGE. Updated manpage. 2002-02-12 12:47 Jochen Striepe * t-prot.1: Update manpage for -S=n. 2002-02-12 12:45 Jochen Striepe * muttrc.t-prot, contrib/muttrc.t-prot, t-prot: Improve bounce message. Change option -S to accept an integer denoting the maximum allowed lines for a valid signature. 2002-02-12 04:44 Jochen Striepe * t-prot, t-prot.1: New option -p=ADDRESS added: Finally you may use t-prot in your MTA's aliases file to bounce TOFUed emails. Manpage updated. 2002-02-12 01:03 Jochen Striepe * t-prot: Corrected help when called with -h. Small indent cleanup. 2002-02-11 20:40 Jochen Striepe * t-prot.1: Updated manpage date. 2002-02-11 20:33 Jochen Striepe * t-prot, t-prot.1: Gerfried Fuchs reported that t-prot eats up attachments when hiding lines, that flaw should be fixed right now. Manpage has been updated to reflect upon that fact. 2002-02-11 19:13 Jochen Striepe * t-prot: Corrected line count for overlong signatures. Problem reported by Gerfried Fuchs (thanks, Alfie!). 2002-01-29 14:57 Jochen Striepe * t-prot: Remove goto. Patch by Gerfried Fuchs. 2002-01-28 20:34 Jochen Striepe * t-prot: Bump version to 0.32. 2002-01-28 16:53 Jochen Striepe * t-prot: Just again a version fix. Should be done now... 2002-01-28 16:52 Jochen Striepe * t-prot: Sigh. Another version fix. 2002-01-28 16:50 Jochen Striepe * t-prot.1: Fix manpage version. 2002-01-28 16:48 Jochen Striepe * t-prot, t-prot.1: Fix version strings. 2002-01-28 16:46 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Version cleanup. 2002-01-28 16:39 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Initial version. 2002-01-28 16:39 Jochen Striepe * muttrc.t-prot, t-prot, t-prot.1, contrib/muttrc.t-prot: Initial revision t-prot-2.101/README0000644000175000001440000000430411463250307013011 0ustar jochenusersT-PROT -- TOFU protection ========================= 1. What the hell is TOFU? As the man page says: TOFU is an abbreviation which mixes German and English words; it expands to "text oben, full-quote unten" which means "text above - full quote below" and describes the style of so many users who let their mailer or newsreader quote everything of the previous message and just add some 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://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 rfc5322 messages: TOFU, huge quoted blocks, signatures (especially when they are too long), excessive punctuation, blocks of empty lines, trailing spaces and tabs. For use inside of MTAs or MDAs it exits with appropriate libc exit codes, so annoying messages may be bounced easily. 3. For what can I use it? There are several possibilities. One is to filter your email or news messages when displaying them in your User Agent. Another is blocking annoying messages entirely from your system - using the script in some sendmail (see the man page for an example) or procmail rule, or even inside innd. 4. Give me some example! What about an example configuration for the MUA mutt(1), or the NUA slrn(1)? An example is included in the distribution. Please see the man page for further details on the activated features. 5. And what about other User Agents? I just use mutt and slrn, so I do not know how to filter messages in other User Agents. If you know how to incorporate t-prot e.g. in Gnus, please just drop me a note. ;) 6. Where did the idea come from? 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 entire inspiration for this hack came from the "TOFU protection" line of his script on many usenet postings. t-prot-2.101/TODO0000644000175000001440000000457011463250307012626 0ustar jochenusers TODO LIST FOR T-PROT ==================== For more issues and/or some details, please see the BUGS section of the man page. To report bugs, please first see the REPORTING BUGS section of the man page. To make suggestions or tell about features you miss, please drop an email to . Known Bugs (more severe ones come first) ---------------------------------------- (none) Wishlist -------- * Support for gpg2. Please send an email to if you want this feature in vanilla t-prot. * Now Quoted-printable and the lot in Subject, To and From header fields is done by --sani, but UTF-8 is still out there. Rejected issues --------------- * Improving heuristics for M$ style TOFU is way tricky. In the end, it's just plain guessing what is newly added text and what is quoted, in particular with most "modern" MUAs disgustingly trying to invent some new way of (not machine-parseable, of course) quoting that makes guessing even harder. * Block-align lines of text. Same problem as above: It's really hard guesswork to figure out what is intentional formatting and what is just user laziness. Patches solving this issue are greatly welcome, of course. * If you set mutt's display_filter to "tee foo" when viewing a pgp signed message and attach the resulting file to a pgp signed message, the result is confusion when displaying this new message with t-prot. This sounds much like "garbage in, garbage out", so just keep in mind that the whole idea behind t-prot using the display_filter thing is that you can turn it off with just one key stroke. It is definitely not t-prot's responsibility to make *everything* look good and readable. TODO LIST FOR T-PROT.SL ======================= Wishlist -------- Known problems: * t-prot.sl interacts badly with some other macros using the read_article_hook. We should at least document the What and Why. Anyone with some more S-Lang experience volunteering for this? ;) * ESC-6/ESC-7 as described in t-prot.sl does not take effect on the article currently displayed (just on those processed later on). It would be nice to have an alternative taking effect immediately. Please keep in mind that t-prot.sl is an *example* script (for you to get an idea on how to integrate t-prot into other software), so these are really low priority. However, patches in unified diff format are always welcome.