.\" Copyright Jochen Striepe , 2001-2002. .\" License see below. .\" .\" $Id: t-prot.1,v 1.30 2002/03/22 11:38:35 jochen Exp $ .\" .TH T-PROT "1" "March 2002" "T-PROT" .SH NAME t-prot \- TOFU Protection - Display Filter for RFC822 messages .SH SYNOPSIS .BI "t-prot [" OPTIONS "]..." .SH DESCRIPTION .PP This program is a filter which shall improve the readability for messages (emails and posts) by *hiding* some annoying parts, e.g. mailing list footers, signatures, and TOFU (see definition below), as well as squeezing sequences of blank lines or punctuation. .br The filter is written in Perl and relies on input to be a single RFC822 conform message. .PP For easy usage, you can download a file to be included in your ~/.muttrc: .IR http://www.escape.de/users/tolot/mutt/t-prot/muttrc.t-prot . .SH OPTIONS .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 option .BR -a . .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 "\-a" "commercial signature": Hides "footers" (signatures) from commercial email providers. .br .IR NOTE : This requires a directory with footer files to be given with option .BR "\-A" =DIRECTORY. .TP .B "\-c" "compress": Squeezes a sequence of blank lines to just one blank line. .TP .B "\-d, \-\-debug" "debug": Print envelope info to syslog when bouncing TOFU contaminated email. Default syslog facility is mail.debug. Requires .BR \-p . .TP .B "\-\-diff" "tolerate 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 detected). Not entirely consequent but sometimes useful, e.g. at the linux kernel mailing list. .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 .B "\-h, \-\-help" "help": Displays a short help text with a summary on all options, and exits. .TP .BR "\-i" =FILE "input file": Defines a file for input; the default input is from '-' i.e. STDIN. .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 option .BR -l . .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" ). .TP .B "\-l" "list signature": Hides "footers" (signatures) from mailing lists. .br .IR NOTE : This requires a directory with footer files to be given with option .BR "\-L" =DIRECTORY. .TP .B "\-m" "microsoft TOFU": Hides TOFU as given by some microsoft mailers. (You all sure know these fullquotes beginning with .br "----- Original Message -----" .br and some header lines...) .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.) .TP .BR "\-o" =FILE "output file": Define the file to be written *to*; the default output is to STDOUT. .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. .sp Intended for use from within mail delivery agents (MDAs) or mail transport agents (MTAs), so the message bounces if TOFU is detected, and does not get on *your* nerves. :) .sp .B PLEASE be careful not to bounce messages to mailing lists! .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. .TP .B "\-r" "rip header off": Hides all mail header lines. .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. (\fINote\fR: 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 "\-t" "TOFU deletion": Hides "traditional style" TOFU, where each line begins with an indent string like "> ". .br (You may edit the indent pattern in the script itself to suit your needs, but it is surely .I not recommended at all.) .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. .TP .B "\-v, \-\-version" "version info": Prints the current version number and release date, and exit. .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://learn.to/edit_messages - thank you! .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 AND COPYRIGHT Written by Jochen Striepe . .br Copyright \(co 2001, 2002 Jochen Striepe. .PP This is free software; you may use the source to whatever you like. Just keep in mind to mention the original source of the script and the manpage when you give it away. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH IDEAS AND INSPIRATION Many good ideas, bug reports and support from Sven Guckes , Gerfried Fuchs, Christian Borss, Bjoern Buerger, Bjoern Laessig, Martin Neitzel and Ralf Doeblitz. 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 AVAILIBILITY 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 .BR 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 recognizeable for .BR t-prot . The problem should be worked around by now, please send a bug report if it does not work for you. .PP The script still does not solve the "Kammquoting" problem: Some bad MUAs wrap long lines, so a zig-zag shaped text block is the result. This is harder readable, and considered bad style. Your line length should not exceed 80 characters - better even stick to 72-75 chars, so some place is left for quoting. An anti "Kammquote" option is planned for one of the next .B t-prot releases. .PP There probably are many more bugs in this piece of software. Feel free to fix them - it's .BR perl , so you have the sources. Ah, and while you're at it, please drop a note to the author - thanks in advance! .SH "REPORTING BUGS" Please send your bug report to . .SH TODO Fix bugs (see the .I BUGS section). Beside that, all main features should be implemented by now. .SH "SEE ALSO" .BR mutt (1), .BR muttrc (5) and the part about "display_filter", .BR perl (1), RFC822, .I http://got.to/quote/ (German language), .I http://learn.to/edit_messages/