1 .\" Copyright Jochen Striepe <t-prot@tolot.escape.de>, 2001-2004.
4 .\" $Id: t-prot.1,v 1.93 2005/02/14 13:26:36 jochen Exp $
6 .TH T-PROT "1" "Feb 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. You need the Perl module
231 Valid values for LOCALE are the locale names in the mutt(1) and gpg(1)
233 In mutt-1.3.28 (and newer) these are:
234 .I ca cs da de el eo es et fr gl hu id it ja ko lt nl pl pt_BR ru sk sv
235 .IR "tr uk zh_CN zh_TW" .
239 In gnupg-1.2.5 (and newer) these are:
240 .I be ca cs da de el eo es et fi fr gl hu id it ja nl pl pt pt_BR ro ru
241 .IR "sk sv tr zh_CN zh_TW" .
248 with locales, t-prot will only work correctly if you specify the corresponding
252 You also have to make sure you are running t-prot
257 versions. T-prot detects
261 locales of the recent stable versions of those programs, earlier versions
262 might not work well with a recent version of t-prot. There are patches available
263 to make t-prot fit into environments with old
271 Hides TOFU as given by some Microsoft mailers. (You all surely know these
272 fullquotes beginning with
274 "----- Original Message -----"
276 and some header lines...)
279 Burn CPU cycles trying to be smart with MS style TOFU.
281 Please note that this is probably just a waste of time because most
282 MS Outlook users who do produce this kind of TOFU won't care about
283 making their messages the least bit readable or even predictable. So
284 this option will probably just be interesting for mutt message hooks
285 (to activate it on demand when you
286 .BR know " the sender tries to write legible messages)."
292 .BR "\-M, \-\-mua" =MUA
294 Turn on special treatment for some mail user agents. (Right now only
296 is supported, but more might be added in future.)
298 If your MUA is supported by this feature you must ensure t-prot makes
299 use of it when called from within your MUA to work as desired.
303 Define the file to be written *to*; the default output is to STDOUT.
305 If "NONE" is specified as file name, there will be no output at all (useful
306 if all you need is t-prot's exit code). Use something like "./NONE" if you
307 really want to write to a file of this name.
311 If we really find some TOFU, abort with exit code
313 Otherwise redirect the message to ADDRESS if given.
315 Intended for use from within mail delivery agents (MDAs) or mail transport
316 agents (MTAs), so the message bounces if TOFU is detected, and does not get
319 As an example for usage with
321 put this line into your alias file and invoke
324 notofu: |"/usr/local/bin/t-prot -mt -p=user@mydomain"
326 This will bounce messages for <notofu@domainname> if any TOFU is detected
327 inside the message, and deliver it to <user@mydomain> otherwise.
329 that TOFU is only detected if you specify
334 .B PLEASE be careful not to bounce messages to mailing lists!
337 "user defined bounce message for picky delivery":
338 You may specify your own bounce message to be returned when we try to deliver
339 an email and bounce it because there is TOFU inside.
342 Move pgp verification output to bottom; requires
345 .B \-\-pgp\-move\-vrf
346 Move pgp verification outout to bottom only if verification shows a good signature
347 and the signature could be verified as authentic (using a trust path). If there is
348 any problem with the signature, the pgp output should not be moved so the user is
349 more likely to notice. Requires
353 If gpg is terminated before finished (e.g. hitting Ctrl-C, or using
355 we cannot always detect if the check was interrupted. Though t-prot tries
356 to be smart, there will be false positives.
359 Hide non-relevant pgp key uids; requires
364 Hides all mail header lines.
367 "supression of overlong signatures":
368 Signatures are to be n lines (not including the one containing dash-dash-space)
369 or less. If there are more, it is probably not that spirited after all. So
370 with this option you trade it for a
374 If no n is given, default is 4. (\fINote\fR: We do not recommend using a
375 value other than 4. Consider this old-fashioned, but we actually do *like*
379 The line containing "-- " ist not counted when testing for an overlong
380 signature, but it is included when displaying how many lines were deleted.
383 "signature deletion":
384 Hides signatures, i.e. all lines after a "signature dashes" line,
385 i.e. a line with three characters: dash-dash-space (no more, no less).
387 .BR "\-\-sigsmax" [=n]
388 "maximum number of tolerated signatures":
389 Here you can define how many signatures you accept to be treated as such.
390 (Most significant behaviour is when microsoft style quotes are removed.
391 Experts please see the code for the more subtle implications of this
394 Leave empty or specify zero to have an unlimited number of sigs.
398 "SpamAssassin workaround":
399 SpamAssassin (available at
400 .IR http://spamassassin.org/ ") often is configured that it adds some"
401 lines to the message body containing information about the spam criteria
402 which were found matching for the message. This option enables an extra
403 test to avoid false positives for Microsoft style TOFU on such messages.
407 Hides "traditional style" TOFU, where each line begins with an
408 indent string like "> ".
410 (You may edit the indent pattern in the script itself to suit your needs,
416 "whitespace deletion":
417 Hides trailing whitespace (sequences of space and tab).
418 CAVEAT: This may lead to interesting effects with crossposts
419 between mailing lists or with undetected signature attempts.
421 .B "\-v, \-\-version"
423 Prints the current version number and release date, and exit.
425 TOFU is an abbreviation which mixes German and English words;
426 it expands to "text oben, full-quote unten" which means
427 "text above - full quote below" and describes the style of so
428 many users who let their mailer or newsreader quote everything
429 of the previous message and just add some text at the top;
430 obviously they think that quoted text must not be changed at all.
431 This is quite annoying as it needlessly sends a lot of data
432 even when it is not required. Some editing of messages is desired.
433 Please point these people to the page
434 .I http://learn.to/edit_messages
439 I want to make my mailing list footer files match more different mailing
440 list footers. Can I use regular expressions, or how can I accomplish that?
443 Nope, regexp's do not work here. The comparison is made by the perl builtin
447 for more detailed info), so you must exactly match the beginning of the
448 line. The longer the line you specify, the more precise the match; if
449 your line is empty you match unconditionally.
453 I use the options -l and -L to supress mailing list footers when
454 displaying messages in
456 This does work sometimes, but sometimes it does not: the footer is not
457 detected, and therefore full quotes are not deleted and signatures are
458 detected as too long (which they aren't).
461 This might occur if the message is badly encoded, so mutt cannot resolve
462 all encoded characters, e.g. if you have an encoded message on a mailing
463 list, and majordomo appends a mailing list footer in a different encoding
464 (or even plain us-ascii). "-- " simply does not match "--=20".
466 Another problem are non-us-ascii characters. Just avoid them, and
467 everything should work fine.
469 See the preceding Q+A for a solution.
473 I want to write a message which contains parts that should *not* be
474 deleted even when filtered with t-prot. Is this possible?
477 Yes, but please do not spread word of it. Make unobstrusive use of the
484 This line is protected from being filtered by t-prot !!!!!!!
488 Text coming now is not.
489 .SH AUTHOR AND COPYRIGHT
490 Written by Jochen Striepe <t-prot@tolot.escape.de>.
492 Copyright \(co 2001, 2002, 2003, 2004 Jochen Striepe.
494 This is free software; you may use the source to whatever you like.
495 Just keep in mind to mention the original source of the script and the manpage
496 when you give it away. There is NO warranty; not even for MERCHANTABILITY or
497 FITNESS FOR A PARTICULAR PURPOSE.
498 .SH IDEAS AND INSPIRATION
499 Many good ideas, bug reports and support from (in alphabetical order) Bjoern
500 Buerger, Bjoern Laessig, Christian Borss, Gerfried Fuchs, Martin Neitzel, Martin
501 Dietze, Ralf Doeblitz, Sven Guckes and many more (see the ChangeLog for active
502 contributors). Many thanks to all of them!
504 Many thanks to Gerhard H. Wrodnigg who uses a TOFU protection script
505 in order to keep the responses to his cancel bot reasonably short. The
506 entire inspiration for this hack came from the "TOFU protection" line of
507 his script on many usenet postings.
509 You can get the latest version from
510 .IR http://www.escape.de/users/tolot/mutt/ .
512 Please note that t-prot development happens on
513 .BR "current stable perl versions only" .
514 If you do run t-prot on earlier (or unstable) perl versions, you might
515 encounter perl compiler bugs (or funny t-prot behaviour). One solution
516 is to upgrade your perl, another is simply to write a bug report. If
517 you do not run a current perl version, please include this information
518 in your bug report. Thank you.
520 There is a problem when mutt gives a PGP verified or even a multipart
521 message to t-prot: The information where the PGP encrypted/signed data
522 or even attachments begin and end is plainly embedded in the text, not
523 really cleanly recognizeable for t-prot. The problem should be worked
524 around by now, please send a bug report if it does not work for you.
526 There probably are many more bugs in this piece of software. Feel free to
529 so you have the sources. Ah, and while you're at it, please drop a note to
530 the author - thanks in advance!
532 Please send your bug report to <t-prot-bugs@tolot.escape.de>.
536 section). Beside that, all main features should be implemented by now.
540 and the part about "display_filter",
543 RFCs 822, 2045, 2046, 2049, and 2822,
544 .I http://got.to/quote/
546 .I http://www.river.com/users/share/etiquette/edit.html
547 (the Learn To Edit Messages HowTo has found a new home).