]> git.deb.at Git - pkg/t-prot.git/blob - t-prot.1
Imported Upstream version 1.96
[pkg/t-prot.git] / t-prot.1
1 .\" Copyright Jochen Striepe <t-prot@tolot.escape.de>, 2001-2004.
2 .\" License see below.
3 .\" 
4 .\" $Id: t-prot.1,v 1.93 2005/02/14 13:26:36 jochen Exp $
5 .\"
6 .TH T-PROT "1" "Feb 2005" "T-PROT"
7 .SH NAME
8 t-prot \- TOFU Protection - Display Filter for RFC 822 messages
9 .SH SYNOPSIS
10 .BI "t-prot [" OPTIONS "]..."
11 .SH DESCRIPTION
12 .PP
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.
17 .br
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
21 correct.
22 .PP
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
25 .br
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
28 .SH OPTIONS
29 .TP
30 .BR "\-A" =DIRECTORY
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
34 .B -a
35 or
36 .BR --ftr-ad .
37 .br
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 
41 .B "\-S"
42 or
43 .BR "\-t" ).
44 .TP
45 .B "\-a"
46 "commercial signature":
47 Hides "footers" (signatures) from commercial email providers.
48 .br
49 This option compares the last lines of the message body with any
50 footer file found in the directory specified with
51 .BR "\-A" =DIRECTORY
52 (which is mandatory for this option). The comparison is done by perl's
53 .B index()
54 function (please try
55 .I perldoc -f index
56 for details).
57 .sp
58 .IR NOTE :
59 This option is not needed if
60 .B --ftr-ad
61 is specified.
62 .TP
63 .BR "\-\-bigq" [=n[,x]]
64 "shrink big quotes":
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.
67 .TP
68 .B "\-c"
69 "compress":
70 Squeezes a sequence of blank lines to two blank lines at maximum.
71 .TP
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
75 within INN2.
76 .IP
77 Flags are separated by commas (no whitespaces), and can be the
78 following (right now just one flag):
79 .IP
80 .IR ratio [=n]
81 .br
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.
84 .TP
85 .B "\-d, \-\-debug"
86 "debug":
87 Print envelope info to syslog when bouncing TOFU contaminated email.
88 Default syslog facility is mail.debug. Requires
89 .BR \-p .
90 .TP
91 .B "\-\-diff"
92 "tolerate diff":
93 Tolerate unified diff (see 
94 .BR diff (1)
95 and
96 .BR patch (1))
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.
100 .TP
101 .B "\-e"
102 "ellipsis":
103 Squeezes a sequence of four or more dots, exclamation marks, or question marks
104 to only three dots or marks, respectively.
105 .TP
106 .B "\-\-ftr\-ad"
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
114 easy! ;)
115 .br
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
119 little *too* greedy.
120 .sp
121 .IR NOTE :
122 This requires a directory with footer files to be given with option
123 .BR "\-A" =DIRECTORY.
124 .TP
125 .B "\-\-ftr\-ml"
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.
130 .br
131 Works similar to --ftr-ad, just that it is intended for mailing list footers.
132 .sp
133 .IR NOTE :
134 This requires a directory with footer files to be given with option
135 .BR "\-L" =DIRECTORY.
136 .TP
137 .B "\-h, \-\-help"
138 "help":
139 Displays a short help text with a summary on all options, and exits.
140 .TP
141 .BR "\-i" =FILE
142 "input file":
143 Defines a file for input; the default input is from '-' i.e. STDIN.
144 .TP
145 .B "\-k"
146 "anti Kammquote":
147 Tries to fix those broken zig-zag-shaped lines wrapped around by some MUAs
148 which are known as "Kammquoting" in German.
149 .sp
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).
153 .TP
154 .BR "\-\-kminl" =n
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.
158 .br
159 Anyway, lower values make the algorithm more aggressive, higher values
160 make Kammquotes harder to detect. Default is 65.
161 .sp
162 Requires
163 .BR "\-k" .
164 .TP
165 .BR "\-\-kmaxl" =n
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.
169 .br
170 Anyway, higher values make the algorithm more aggressive, lower values
171 make Kammquotes harder to detect. Default is 80.
172 .sp
173 Requires
174 .BR "\-k" .
175 .TP
176 .BR "\-\-kdiff" =n
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.
180 .br
181 Anyway, lower values make the algorithm more aggressive, higher values
182 make Kammquotes harder to detect. Default is 20.
183 .sp
184 Requires
185 .BR "\-k" .
186 .TP
187 .BR "\-L" =DIRECTORY
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
191 .B \-l
192 or
193 .BR \-\-ftr\-ml .
194 .br
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 
198 .B "\-S"
199 or
200 .BR "\-t" ).
201 .TP
202 .B "\-l"
203 "list signature":
204 Hides "footers" (signatures) from mailing lists. Footer detection works like the 
205 .B "\-a"
206 option.
207 .sp
208 .IR NOTE :
209 This requires a directory with footer files to be given with option
210 .BR "\-L" =DIRECTORY.
211 .B \-l
212 is not needed if
213 .B \-\-ftr\-ml
214 is specified.
215 .TP
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
220 a security issue.)
221 .TP
222 .BR "\-\-locale" =LOCALE
223 "locale to use":
224 Here you can specify which locale to use. Right now this option is only
225 used when
226 .I "\-Mmutt"
227 is specified, but this may change in future. You need the Perl module
228 .I "Locale::gettext"
229 for this feature.
230 .sp
231 Valid values for LOCALE are the locale names in the mutt(1) and gpg(1)
232 po file names.
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" .
236 In mutt-1.4.1
237 .I bg
238 was added.
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" .
242 .sp
243 .IR Note :
244 If you use
245 .B mutt
246 or
247 .B gnupg
248 with locales, t-prot will only work correctly if you specify the corresponding
249 locale string.
250 .sp
251 .IR "Note also" :
252 You also have to make sure you are running t-prot
253 with matching
254 .B gnupg
255 and 
256 .B mutt
257 versions. T-prot detects
258 .B gnupg
259 and
260 .B mutt
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
264 .B mutt
265 and
266 .B gnupg
267 versions.
268 .TP
269 .B "\-m"
270 "Microsoft TOFU":
271 Hides TOFU as given by some Microsoft mailers. (You all surely know these
272 fullquotes beginning with
273 .br
274 "----- Original Message -----"
275 .br
276 and some header lines...)
277 .TP
278 .B "\-\-ms\-smart"
279 Burn CPU cycles trying to be smart with MS style TOFU.
280 .sp
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)."
287 .sp
288 Requires
289 .BR "\-Mmutt" " and"
290 .BR "\-m" .
291 .TP
292 .BR "\-M, \-\-mua" =MUA
293 "mail user agent":
294 Turn on special treatment for some mail user agents. (Right now only 
295 .BR mutt (1)
296 is supported, but more might be added in future.)
297 .IR Caveat :
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.
300 .TP
301 .BR "\-o" =FILE
302 "output file":
303 Define the file to be written *to*; the default output is to STDOUT.
304 .sp
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.
308 .TP
309 .BR "\-p" [=ADDRESS]
310 "picky delivery":
311 If we really find some TOFU, abort with exit code 
312 .IR EX_UNAVAILABLE .
313 Otherwise redirect the message to ADDRESS if given.
314 .sp
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
317 on *your* nerves. :) 
318 .sp
319 As an example for usage with
320 .BR sendmail ,
321 put this line into your alias file and invoke
322 .BR newaliases :
323 .sp
324 notofu: |"/usr/local/bin/t-prot -mt -p=user@mydomain"
325 .sp
326 This will bounce messages for <notofu@domainname> if any TOFU is detected
327 inside the message, and deliver it to <user@mydomain> otherwise.
328 .I Note
329 that TOFU is only detected if you specify
330 .B "\-t"
331 respectively
332 .BR "\-m" .
333 .sp
334 .B PLEASE be careful not to bounce messages to mailing lists!
335 .TP
336 .BR "\-P" =MESSAGE
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.
340 .TP
341 .B \-\-pgp\-move
342 Move pgp verification output to bottom; requires
343 .BR "\-Mmutt" .
344 .TP
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
350 .BR "\-Mmutt" .
351 .sp
352 .IR Note :
353 If gpg is terminated before finished (e.g. hitting Ctrl-C, or using
354 .IR kill (1)),
355 we cannot always detect if the check was interrupted. Though t-prot tries
356 to be smart, there will be false positives.
357 .TP
358 .B \-\-pgp\-short
359 Hide non-relevant pgp key uids; requires
360 .BR "\-Mmutt" .
361 .TP
362 .B "\-r"
363 "rip header off":
364 Hides all mail header lines.
365 .TP
366 .BR "\-S" [=n]
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
371 .B truely
372 nice line.
373 .br
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*
376 RFC conformance.)
377 .sp
378 .IR Note :
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.
381 .TP
382 .B "\-s"
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).
386 .TP
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
392 option.)
393 .br
394 Leave empty or specify zero to have an unlimited number of sigs. 
395 Default is 1.
396 .TP
397 .B "\-\-spass"
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.
404 .TP
405 .B "\-t"
406 "TOFU deletion":
407 Hides "traditional style" TOFU, where each line begins with an
408 indent string like "> ".
409 .br
410 (You may edit the indent pattern in the script itself to suit your needs,
411 but it is surely
412 .I not
413 recommended at all.)
414 .TP
415 .B "\-w"
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.
420 .TP
421 .B "\-v, \-\-version"
422 "version info":
423 Prints the current version number and release date, and exit.
424 .SH TOFU?
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
435 - thank you!
436 .SH TROUBLESHOOTING
437 .TP
438 .IR Q :
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?
441 .TP
442 .IR A :
443 Nope, regexp's do not work here. The comparison is made by the perl builtin
444 .IR index ()
445 function (see 
446 .B perldoc
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.
450 .PP
451 .TP
452 .IR Q :
453 I use the options -l and -L to supress mailing list footers when 
454 displaying messages in
455 .BR mutt (1).
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).
459 .TP
460 .IR A :
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". 
465 .br
466 Another problem are non-us-ascii characters. Just avoid them, and 
467 everything should work fine.
468 .br
469 See the preceding Q+A for a solution.
470 .PP
471 .TP
472 .IR Q :
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?
475 .TP
476 .IR A :
477 Yes, but please do not spread word of it. Make unobstrusive use of the
478 .I
479 verbatim
480 instruction:
481 .sp
482 #v+
483 .br
484 This line is protected from being filtered by t-prot !!!!!!!
485 .br
486 #v-
487 .br
488 Text coming now is not.
489 .SH AUTHOR AND COPYRIGHT
490 Written by Jochen Striepe <t-prot@tolot.escape.de>.
491 .br
492 Copyright \(co 2001, 2002, 2003, 2004 Jochen Striepe.
493 .PP
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!
503 .sp
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.
508 .SH AVAILIBILITY
509 You can get the latest version from
510 .IR http://www.escape.de/users/tolot/mutt/ .
511 .SH BUGS
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.
519 .PP
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.
525 .PP
526 There probably are many more bugs in this piece of software. Feel free to
527 fix them - it's
528 .BR perl ,
529 so you have the sources. Ah, and while you're at it, please drop a note to
530 the author - thanks in advance! 
531 .SH "REPORTING BUGS"
532 Please send your bug report to <t-prot-bugs@tolot.escape.de>.
533 .SH TODO
534 Fix bugs (see the 
535 .I BUGS
536 section). Beside that, all main features should be implemented by now.
537 .SH "SEE ALSO"
538 .BR mutt (1),
539 .BR muttrc (5)
540 and the part about "display_filter", 
541 .BR perl (1),
542 .BR aliases (5),
543 RFCs 822, 2045, 2046, 2049, and 2822,
544 .I http://got.to/quote/
545 (German language), 
546 .I http://www.river.com/users/share/etiquette/edit.html
547 (the Learn To Edit Messages HowTo has found a new home).
548