1 .\" Copyright Jochen Striepe <t-prot@tolot.escape.de>, 2001-2004.
4 .\" $Id: t-prot.1,v 1.92 2005/01/08 11:05:13 jochen Exp $
6 .TH T-PROT "1" "Jan 2005" "T-PROT"
8 t-prot \- TOFU Protection - Display Filter for RFC 822 messages
10 .BI "t-prot [" OPTIONS "]..."
13 This program is a filter which shall improve the readability
14 for messages (emails and posts) by *hiding* some annoying parts,
15 e.g. mailing list footers, signatures, and TOFU (see definition below),
16 as well as squeezing sequences of blank lines or punctuation.
18 The filter is written in Perl and relies on input to be a single
19 message conforming to RFC 822 or it's successor, RFC 2822. Messages
20 conforming to RFCs 2045, 2046 and 2049 should be treated reasonably
23 For easy usage, you can download a file to be included in your ~/.muttrc:
24 .I http://www.escape.de/users/tolot/mutt/t-prot/muttrc.t-prot
26 And here is an example S-Lang macro to use t-prot from within slrn:
27 .I http://www.escape.de/users/tolot/mutt/t-prot/t-prot.sl
31 "ad footer directory":
32 Defines the directory which contains the advertisement list footers (one
33 footer per file) which are to be tested when removing them with options
38 This option is also needed if you do not want signature lengths to be
39 counted wrong or fullquotes get undetected when an ad footer is
40 appended at the bottom of the message (especially when using
46 "commercial signature":
47 Hides "footers" (signatures) from commercial email providers.
49 This option compares the last lines of the message body with any
50 footer file found in the directory specified with
52 (which is mandatory for this option). The comparison is done by perl's
59 This option is not needed if
63 .BR "\-\-bigq" [=n[,x]]
65 Blocks of quotes with more than n lines will be shrinked to x lines.
66 Defaults are 30 for n and 10 for x.
70 Squeezes a sequence of blank lines to two blank lines at maximum.
72 .BR "\-\-check" [=FLAGS]
73 Run checks. If successful, print an error message and quit with
74 an appropriate exit code. Useful e.g. for rejecting messages from
77 Flags are separated by commas (no whitespaces), and can be the
78 following (right now just one flag):
82 If the quoting ratio is n or more, the message is rejected. Must be
83 between 0 and 1, or else it is entirely disabled.
87 Print envelope info to syslog when bouncing TOFU contaminated email.
88 Default syslog facility is mail.debug. Requires
93 Tolerate unified diff (see
97 appended *after* the signature (which usually makes the signature too long
98 to be valid). Not entirely consequent but sometimes useful, e.g. at the
99 Linux kernel mailing list.
103 Squeezes a sequence of four or more dots, exclamation marks, or question marks
104 to only three dots or marks, respectively.
107 "enable aggressive ad footer matching":
108 With this option enabled t-prot makes footer detection really greedy: We
109 assume that commercial email providers aren't even frightened to append
110 changing texts *under* their ads which are appended to the message body.
111 Because these texts even have changing *lengths* we simply detect the
112 lines of the footer *anywhere* in the body of the message and assume that
113 everything below belongs to the footer. (Man, if life where always that
116 With this option even GMX ads should be easy to hide -- you buy this with
117 a slight performance hit (which is the reason this option is disabled by
118 default), and with the possibility that sometimes the algorithm is just a
122 This requires a directory with footer files to be given with option
123 .BR "\-A" =DIRECTORY.
126 "enable aggressive mailing list footer matching":
127 With this option enabled t-prot makes footer detection really greedy: Should
128 be helpful with broken list servers, or even if your email provider munges
129 the bodies of your messages.
131 Works similar to --ftr-ad, just that it is intended for mailing list footers.
134 This requires a directory with footer files to be given with option
135 .BR "\-L" =DIRECTORY.
139 Displays a short help text with a summary on all options, and exits.
143 Defines a file for input; the default input is from '-' i.e. STDIN.
147 Tries to fix those broken zig-zag-shaped lines wrapped around by some MUAs
148 which are known as "Kammquoting" in German.
150 Note: This option is considered stable by now. However, sometimes Kammquotes
151 should have been removed but weren't. Please send a bug report if this happens
152 to you (after carefully reading the BUGS file, that is).
155 Minimum line length for wrapped line detection on Kammquotes. Umm, don't
156 know how to explain this well without describing the complete algorithm
157 used. Please see the code.
159 Anyway, lower values make the algorithm more aggressive, higher values
160 make Kammquotes harder to detect. Default is 65.
166 Maximum line length for wrapped line detection on Kammquotes. Umm, don't
167 know how to explain this well without describing the complete algorithm
168 used. Please see the code.
170 Anyway, higher values make the algorithm more aggressive, lower values
171 make Kammquotes harder to detect. Default is 80.
177 Minimum length difference between two lines for wrapped line detection on
178 Kammquotes. Umm, don't know how to explain this well without describing
179 the complete algorithm used. Please see the code.
181 Anyway, lower values make the algorithm more aggressive, higher values
182 make Kammquotes harder to detect. Default is 20.
188 "list footer directory":
189 Defines the directory which contains the mailing list footers (one footer
190 per file) which are to be tested when removing them with the options
195 This option is also needed if you do not want signature lengths to be
196 counted wrong or fullquotes get undetected when a mailing list footer is
197 appended at the bottom of the message (especially when using
204 Hides "footers" (signatures) from mailing lists. Footer detection works like the
209 This requires a directory with footer files to be given with option
210 .BR "\-L" =DIRECTORY.
216 .B "\-\-lax\-security"
217 Allow insecure writing method. DO NOT USE UNLESS YOU REALLY KNOW WHAT
218 YOU ARE DOING. (This ugly workaround is needed for some early mutt versions
219 and should NEVER be used as a default, otherwise it will probably turn into
222 .BR "\-\-locale" =LOCALE
224 Here you can specify which locale to use. Right now this option is only
227 is specified, but this may change in future.
229 Valid values for LOCALE are the locale names in the mutt(1) and gpg(1)
231 In mutt-1.3.28 (and newer) these are:
232 .I ca cs da de el eo es et fr gl hu id it ja ko lt nl pl pt_BR ru sk sv
233 .IR "tr uk zh_CN zh_TW" .
237 In gnupg-1.2.5 (and newer) these are:
238 .I be ca cs da de el eo es et fi fr gl hu id it ja nl pl pt pt_BR ro ru
239 .IR "sk sv tr zh_CN zh_TW" .
246 with locales, t-prot will only work correctly if you specify the corresponding
250 You also have to make sure you are running t-prot
255 versions. T-prot detects
259 locales of the recent stable versions of those programs, earlier versions
260 might not work well with a recent version of t-prot. There are patches available
261 to make t-prot fit into environments with old
269 Hides TOFU as given by some Microsoft mailers. (You all surely know these
270 fullquotes beginning with
272 "----- Original Message -----"
274 and some header lines...)
277 Burn CPU cycles trying to be smart with MS style TOFU.
279 Please note that this is probably just a waste of time because most
280 MS Outlook users who do produce this kind of TOFU won't care about
281 making their messages the least bit readable or even predictable. So
282 this option will probably just be interesting for mutt message hooks
283 (to activate it on demand when you
284 .BR know " the sender tries to write legible messages)."
290 .BR "\-M, \-\-mua" =MUA
292 Turn on special treatment for some mail user agents. (Right now only
294 is supported, but more might be added in future.)
296 If your MUA is supported by this feature you must ensure t-prot makes
297 use of it when called from within your MUA to work as desired.
301 Define the file to be written *to*; the default output is to STDOUT.
303 If "NONE" is specified as file name, there will be no output at all (useful
304 if all you need is t-prot's exit code). Use something like "./NONE" if you
305 really want to write to a file of this name.
309 If we really find some TOFU, abort with exit code
311 Otherwise redirect the message to ADDRESS if given.
313 Intended for use from within mail delivery agents (MDAs) or mail transport
314 agents (MTAs), so the message bounces if TOFU is detected, and does not get
317 As an example for usage with
319 put this line into your alias file and invoke
322 notofu: |"/usr/local/bin/t-prot -mt -p=user@mydomain"
324 This will bounce messages for <notofu@domainname> if any TOFU is detected
325 inside the message, and deliver it to <user@mydomain> otherwise.
327 that TOFU is only detected if you specify
332 .B PLEASE be careful not to bounce messages to mailing lists!
335 "user defined bounce message for picky delivery":
336 You may specify your own bounce message to be returned when we try to deliver
337 an email and bounce it because there is TOFU inside.
340 Move pgp verification output to bottom; requires
343 .B \-\-pgp\-move\-vrf
344 Move pgp verification outout to bottom only if verification shows a good signature
345 and the signature could be verified as authentic (using a trust path). If there is
346 any problem with the signature, the pgp output should not be moved so the user is
347 more likely to notice. Requires
351 If gpg is terminated before finished (e.g. hitting Ctrl-C, or using
353 we cannot always detect if the check was interrupted. Though t-prot tries
354 to be smart, there will be false positives.
357 Hide non-relevant pgp key uids; requires
362 Hides all mail header lines.
365 "supression of overlong signatures":
366 Signatures are to be n lines (not including the one containing dash-dash-space)
367 or less. If there are more, it is probably not that spirited after all. So
368 with this option you trade it for a
372 If no n is given, default is 4. (\fINote\fR: We do not recommend using a
373 value other than 4. Consider this old-fashioned, but we actually do *like*
377 The line containing "-- " ist not counted when testing for an overlong
378 signature, but it is included when displaying how many lines were deleted.
381 "signature deletion":
382 Hides signatures, i.e. all lines after a "signature dashes" line,
383 i.e. a line with three characters: dash-dash-space (no more, no less).
385 .BR "\-\-sigsmax" [=n]
386 "maximum number of tolerated signatures":
387 Here you can define how many signatures you accept to be treated as such.
388 (Most significant behaviour is when microsoft style quotes are removed.
389 Experts please see the code for the more subtle implications of this
392 Leave empty or specify zero to have an unlimited number of sigs.
396 "SpamAssassin workaround":
397 SpamAssassin (available at
398 .IR http://spamassassin.org/ ") often is configured that it adds some"
399 lines to the message body containing information about the spam criteria
400 which were found matching for the message. This option enables an extra
401 test to avoid false positives for Microsoft style TOFU on such messages.
405 Hides "traditional style" TOFU, where each line begins with an
406 indent string like "> ".
408 (You may edit the indent pattern in the script itself to suit your needs,
414 "whitespace deletion":
415 Hides trailing whitespace (sequences of space and tab).
416 CAVEAT: This may lead to interesting effects with crossposts
417 between mailing lists or with undetected signature attempts.
419 .B "\-v, \-\-version"
421 Prints the current version number and release date, and exit.
423 TOFU is an abbreviation which mixes German and English words;
424 it expands to "text oben, full-quote unten" which means
425 "text above - full quote below" and describes the style of so
426 many users who let their mailer or newsreader quote everything
427 of the previous message and just add some text at the top;
428 obviously they think that quoted text must not be changed at all.
429 This is quite annoying as it needlessly sends a lot of data
430 even when it is not required. Some editing of messages is desired.
431 Please point these people to the page
432 .I http://learn.to/edit_messages
437 I want to make my mailing list footer files match more different mailing
438 list footers. Can I use regular expressions, or how can I accomplish that?
441 Nope, regexp's do not work here. The comparison is made by the perl builtin
445 for more detailed info), so you must exactly match the beginning of the
446 line. The longer the line you specify, the more precise the match; if
447 your line is empty you match unconditionally.
451 I use the options -l and -L to supress mailing list footers when
452 displaying messages in
454 This does work sometimes, but sometimes it does not: the footer is not
455 detected, and therefore full quotes are not deleted and signatures are
456 detected as too long (which they aren't).
459 This might occur if the message is badly encoded, so mutt cannot resolve
460 all encoded characters, e.g. if you have an encoded message on a mailing
461 list, and majordomo appends a mailing list footer in a different encoding
462 (or even plain us-ascii). "-- " simply does not match "--=20".
464 Another problem are non-us-ascii characters. Just avoid them, and
465 everything should work fine.
467 See the preceding Q+A for a solution.
471 I want to write a message which contains parts that should *not* be
472 deleted even when filtered with t-prot. Is this possible?
475 Yes, but please do not spread word of it. Make unobstrusive use of the
482 This line is protected from being filtered by t-prot !!!!!!!
486 Text coming now is not.
487 .SH AUTHOR AND COPYRIGHT
488 Written by Jochen Striepe <t-prot@tolot.escape.de>.
490 Copyright \(co 2001, 2002, 2003, 2004 Jochen Striepe.
492 This is free software; you may use the source to whatever you like.
493 Just keep in mind to mention the original source of the script and the manpage
494 when you give it away. There is NO warranty; not even for MERCHANTABILITY or
495 FITNESS FOR A PARTICULAR PURPOSE.
496 .SH IDEAS AND INSPIRATION
497 Many good ideas, bug reports and support from (in alphabetical order) Bjoern
498 Buerger, Bjoern Laessig, Christian Borss, Gerfried Fuchs, Martin Neitzel, Martin
499 Dietze, Ralf Doeblitz, Sven Guckes and many more (see the ChangeLog for active
500 contributors). Many thanks to all of them!
502 Many thanks to Gerhard H. Wrodnigg who uses a TOFU protection script
503 in order to keep the responses to his cancel bot reasonably short. The
504 entire inspiration for this hack came from the "TOFU protection" line of
505 his script on many usenet postings.
507 You can get the latest version from
508 .IR http://www.escape.de/users/tolot/mutt/ .
510 Please note that t-prot development happens on
511 .BR "current stable perl versions only" .
512 If you do run t-prot on earlier (or unstable) perl versions, you might
513 encounter perl compiler bugs (or funny t-prot behaviour). One solution
514 is to upgrade your perl, another is simply to write a bug report. If
515 you do not run a current perl version, please include this information
516 in your bug report. Thank you.
518 There is a problem when mutt gives a PGP verified or even a multipart
519 message to t-prot: The information where the PGP encrypted/signed data
520 or even attachments begin and end is plainly embedded in the text, not
521 really cleanly recognizeable for t-prot. The problem should be worked
522 around by now, please send a bug report if it does not work for you.
524 There probably are many more bugs in this piece of software. Feel free to
527 so you have the sources. Ah, and while you're at it, please drop a note to
528 the author - thanks in advance!
530 Please send your bug report to <t-prot-bugs@tolot.escape.de>.
534 section). Beside that, all main features should be implemented by now.
538 and the part about "display_filter",
541 RFCs 822, 2045, 2046, 2049, and 2822,
542 .I http://got.to/quote/
544 .I http://www.river.com/users/share/etiquette/edit.html
545 (the Learn To Edit Messages HowTo has found a new home).