]> git.deb.at Git - pkg/t-prot.git/blob - t-prot.1
Imported Upstream version 1.98
[pkg/t-prot.git] / t-prot.1
1 .\" $Id: t-prot.1,v 1.97 2005/02/24 23:34:29 jochen Exp $
2 .\"
3 .TH T-PROT "1" "Feb 2005" "T-PROT"
4 .SH NAME
5 t-prot \- TOFU Protection - Display Filter for RFC 822 messages
6 .SH SYNOPSIS
7 .BI "t-prot [" OPTIONS "]..."
8 .SH DESCRIPTION
9 .PP
10 This program is a filter which shall improve the readability
11 for messages (emails and posts) by *hiding* some annoying parts,
12 e.g. mailing list footers, signatures, and TOFU (see definition below),
13 as well as squeezing sequences of blank lines or punctuation.
14 .br
15 The filter is written in Perl and relies on input to be a single
16 message conforming to RFC 822 or it's successor, RFC 2822. Messages
17 conforming to RFCs 2045, 2046 and 2049 should be treated reasonably
18 correct.
19 .PP
20 For easy usage, you can download a file to be included in your ~/.muttrc:
21 .I http://www.escape.de/users/tolot/mutt/t-prot/muttrc.t-prot
22 .br
23 And here is an example S-Lang macro to use t-prot from within slrn:
24 .I http://www.escape.de/users/tolot/mutt/t-prot/t-prot.sl
25 .SH OPTIONS
26 .TP
27 .BR "\-A" =DIRECTORY
28 "ad footer directory":
29 Defines the directory which contains the advertisement list footers (one
30 footer per file) which are to be tested when removing them with options
31 .B -a
32 or
33 .BR --ftr-ad .
34 .br
35 This option is also needed if you do not want signature lengths to be
36 counted wrong or fullquotes get undetected when an ad footer is
37 appended at the bottom of the message (especially when using 
38 .B "\-S"
39 or
40 .BR "\-t" ).
41 .TP
42 .B "\-a"
43 "commercial signature":
44 Hides "footers" (signatures) from commercial email providers.
45 .br
46 This option compares the last lines of the message body with any
47 footer file found in the directory specified with
48 .BR "\-A" =DIRECTORY
49 (which is mandatory for this option). The comparison is done by perl's
50 .B index()
51 function (please try
52 .I perldoc -f index
53 for details).
54 .sp
55 .IR NOTE :
56 This option is not needed if
57 .B --ftr-ad
58 is specified.
59 .TP
60 .BR "\-\-bigq" [=n[,x]]
61 "shrink big quotes":
62 Blocks of quotes with more than n lines will be shrinked to x lines.
63 Defaults are 30 for n and 10 for x.
64 .TP
65 .B "\-c"
66 "compress":
67 Squeezes a sequence of blank lines to two blank lines at maximum.
68 .TP
69 .BR "\-\-check" [=FLAGS]
70 Run checks. If successful, print an error message and quit with
71 an appropriate exit code. Useful e.g. for rejecting messages from
72 within INN2.
73 .IP
74 Flags are separated by commas (no whitespaces), and can be the
75 following (right now just one flag):
76 .IP
77 .IR ratio [=n]
78 .br
79 If the quoting ratio is n or more, the message is rejected. Must be
80 between 0 and 1, or else it is entirely disabled.
81 .TP
82 .B "\-d, \-\-debug"
83 "debug":
84 Print envelope info to syslog when bouncing TOFU contaminated email.
85 Default syslog facility is mail.debug. Requires
86 .BR \-p .
87 .TP
88 .B "\-\-diff"
89 "tolerate diff":
90 Tolerate unified diff (see 
91 .BR diff (1)
92 and
93 .BR patch (1))
94 appended *after* the signature (which usually makes the signature too long
95 to be valid). Not entirely consequent but sometimes useful, e.g. at the
96 Linux kernel mailing list.
97 .TP
98 .B "\-e"
99 "ellipsis":
100 Squeezes a sequence of four or more dots, exclamation marks, or question marks
101 to only three dots or marks, respectively.
102 .TP
103 .B "\-\-ftr\-ad"
104 "enable aggressive ad footer matching":
105 With this option enabled t-prot makes footer detection really greedy: We
106 assume that commercial email providers aren't even frightened to append
107 changing texts *under* their ads which are appended to the message body.
108 Because these texts even have changing *lengths* we simply detect the
109 lines of the footer *anywhere* in the body of the message and assume that
110 everything below belongs to the footer. (Man, if life where always that
111 easy! ;)
112 .br
113 With this option even GMX ads should be easy to hide -- you buy this with
114 a slight performance hit (which is the reason this option is disabled by
115 default), and with the possibility that sometimes the algorithm is just a
116 little *too* greedy.
117 .sp
118 .IR NOTE :
119 This requires a directory with footer files to be given with option
120 .BR "\-A" =DIRECTORY.
121 .TP
122 .B "\-\-ftr\-ml"
123 "enable aggressive mailing list footer matching":
124 With this option enabled t-prot makes footer detection really greedy: Should
125 be helpful with broken list servers, or even if your email provider munges
126 the bodies of your messages.
127 .br
128 Works similar to --ftr-ad, just that it is intended for mailing list footers.
129 .sp
130 .IR NOTE :
131 This requires a directory with footer files to be given with option
132 .BR "\-L" =DIRECTORY.
133 .TP
134 .B "\-h, \-\-help"
135 "help":
136 Displays a short help text with a summary on all options, and exits.
137 .TP
138 .BR "\-i" =FILE
139 "input file":
140 Defines a file for input; the default input is from '-' i.e. STDIN.
141 .TP
142 .B "\-k"
143 "anti Kammquote":
144 Tries to fix those broken zig-zag-shaped lines wrapped around by some MUAs
145 which are known as "Kammquoting" in German.
146 .sp
147 Note: This option is considered stable by now. However, sometimes Kammquotes
148 should have been removed but weren't. Please send a bug report if this happens
149 to you (after carefully reading the BUGS file, that is).
150 .TP
151 .BR "\-\-kminl" =n
152 Minimum line length for wrapped line detection on Kammquotes. Umm, don't
153 know how to explain this well without describing the complete algorithm
154 used. Please see the code.
155 .br
156 Anyway, lower values make the algorithm more aggressive, higher values
157 make Kammquotes harder to detect. Default is 65.
158 .sp
159 Requires
160 .BR "\-k" .
161 .TP
162 .BR "\-\-kmaxl" =n
163 Maximum line length for wrapped line detection on Kammquotes. Umm, don't
164 know how to explain this well without describing the complete algorithm
165 used. Please see the code.
166 .br
167 Anyway, higher values make the algorithm more aggressive, lower values
168 make Kammquotes harder to detect. Default is 80.
169 .sp
170 Requires
171 .BR "\-k" .
172 .TP
173 .BR "\-\-kdiff" =n
174 Minimum length difference between two lines for wrapped line detection on
175 Kammquotes. Umm, don't know how to explain this well without describing
176 the complete algorithm used. Please see the code.
177 .br
178 Anyway, lower values make the algorithm more aggressive, higher values
179 make Kammquotes harder to detect. Default is 20.
180 .sp
181 Requires
182 .BR "\-k" .
183 .TP
184 .BR "\-L" =DIRECTORY
185 "list footer directory":
186 Defines the directory which contains the mailing list footers (one footer
187 per file) which are to be tested when removing them with the options
188 .B \-l
189 or
190 .BR \-\-ftr\-ml .
191 .br
192 This option is also needed if you do not want signature lengths to be
193 counted wrong or fullquotes get undetected when a mailing list footer is
194 appended at the bottom of the message (especially when using 
195 .B "\-S"
196 or
197 .BR "\-t" ).
198 .TP
199 .B "\-l"
200 "list signature":
201 Hides "footers" (signatures) from mailing lists. Footer detection works like the 
202 .B "\-a"
203 option.
204 .sp
205 .IR NOTE :
206 This requires a directory with footer files to be given with option
207 .BR "\-L" =DIRECTORY.
208 .B \-l
209 is not needed if
210 .B \-\-ftr\-ml
211 is specified.
212 .TP
213 .B "\-\-lax\-security"
214 Allow insecure writing method. DO NOT USE UNLESS YOU REALLY KNOW WHAT
215 YOU ARE DOING. (This ugly workaround is needed for some early mutt versions
216 and should NEVER be used as a default, otherwise it will probably turn into
217 a security issue.)
218 .TP
219 .BR "\-\-locale" =LOCALE
220 "locale to use":
221 Here you can specify which locale to use. Right now this option is only
222 used when
223 .I "\-Mmutt"
224 is specified, but this may change in future. You need the Perl module
225 .I "Locale::gettext"
226 for this feature.
227 .sp
228 .IR Note :
229 If you use
230 .B mutt
231 or
232 .B gnupg
233 with locales, t-prot will only work correctly if you specify the corresponding
234 locale string.
235 .sp
236 .IR "Note also" :
237 You also have to make sure you are running t-prot
238 with matching
239 .B gnupg
240 and 
241 .B mutt
242 versions. T-prot detects
243 .B gnupg
244 and
245 .B mutt
246 locales of the recent stable versions of those programs, earlier versions
247 might not work well with a recent version of t-prot. There are patches available
248 to make t-prot fit into environments with old
249 .B mutt
250 and
251 .B gnupg
252 versions.
253 .TP
254 .B "\-m"
255 "Microsoft TOFU":
256 Hides TOFU as given by some Microsoft mailers. (You all surely know these
257 fullquotes beginning with
258 .br
259 "----- Original Message -----"
260 .br
261 and some header lines...)
262 .TP
263 .B "\-\-ms\-smart"
264 Burn CPU cycles trying to be smart with MS style TOFU.
265 .sp
266 Please note that this is probably just a waste of time because most
267 MS Outlook users who do produce this kind of TOFU won't care about
268 making their messages the least bit readable or even predictable. So
269 this option will probably just be interesting for mutt message hooks
270 (to activate it on demand when you
271 .BR know " the sender tries to write legible messages)."
272 .sp
273 Requires
274 .BR "\-Mmutt" " and"
275 .BR "\-m" .
276 .TP
277 .BR "\-M, \-\-mua" =MUA
278 "mail user agent":
279 Turn on special treatment for some mail user agents. (Right now only 
280 .BR mutt (1)
281 is supported, but more might be added in future.)
282 .IR Caveat :
283 If your MUA is supported by this feature you must ensure t-prot makes
284 use of it when called from within your MUA to work as desired.
285 .TP
286 .BR "\-o" =FILE
287 "output file":
288 Define the file to be written *to*; the default output is to STDOUT.
289 .sp
290 If "NONE" is specified as file name, there will be no output at all (useful
291 if all you need is t-prot's exit code). Use something like "./NONE" if you
292 really want to write to a file of this name.
293 .TP
294 .BR "\-p" [=ADDRESS]
295 "picky delivery":
296 If we really find some TOFU, abort with exit code 
297 .IR EX_UNAVAILABLE .
298 Otherwise redirect the message to ADDRESS if given.
299 .sp
300 Intended for use from within mail delivery agents (MDAs) or mail transport 
301 agents (MTAs), so the message bounces if TOFU is detected, and does not get
302 on *your* nerves. :) 
303 .sp
304 As an example for usage with
305 .BR sendmail ,
306 put this line into your alias file and invoke
307 .BR newaliases :
308 .sp
309 notofu: |"/usr/local/bin/t-prot -mt -p=user@mydomain"
310 .sp
311 This will bounce messages for <notofu@domainname> if any TOFU is detected
312 inside the message, and deliver it to <user@mydomain> otherwise.
313 .I Note
314 that TOFU is only detected if you specify
315 .B "\-t"
316 respectively
317 .BR "\-m" .
318 .sp
319 .B PLEASE be careful not to bounce messages to mailing lists!
320 .TP
321 .BR "\-P" =MESSAGE
322 "user defined bounce message for picky delivery": 
323 You may specify your own bounce message to be returned when we try to deliver
324 an email and bounce it because there is TOFU inside.
325 .TP
326 .B \-\-pgp\-move
327 Move pgp verification output to bottom; requires
328 .BR "\-Mmutt" .
329 .TP
330 .B \-\-pgp\-move\-vrf
331 Move pgp verification outout to bottom only if verification shows a good signature
332 and the signature could be verified as authentic (using a trust path). If there is
333 any problem with the signature, the pgp output should not be moved so the user is
334 more likely to notice. Requires
335 .BR "\-Mmutt" .
336 .sp
337 .IR Note :
338 If gpg is terminated before finished (e.g. hitting Ctrl-C, or using
339 .IR kill (1)),
340 we cannot always detect if the check was interrupted. Though t-prot tries
341 to be smart, there will be false positives.
342 .TP
343 .B \-\-pgp\-short
344 Hide non-relevant pgp key uids; requires
345 .BR "\-Mmutt" .
346 .TP
347 .B "\-r"
348 "rip header off":
349 Hides all mail header lines.
350 .TP
351 .BR "\-S" [=n]
352 "supression of overlong signatures":
353 Signatures are to be n lines (not including the one containing dash-dash-space)
354 or less. If there are more, it is probably not that spirited after all. So
355 with this option you trade it for a
356 .B truely
357 nice line.
358 .br
359 If no n is given, default is 4. (\fINote\fR: We do not recommend using a 
360 value other than 4. Consider this old-fashioned, but we actually do *like*
361 RFC conformance.)
362 .sp
363 .IR Note :
364 The line containing "-- " ist not counted when testing for an overlong 
365 signature, but it is included when displaying how many lines were deleted.
366 .TP
367 .B "\-s"
368 "signature deletion":
369 Hides signatures, i.e. all lines after a "signature dashes" line,
370 i.e. a line with three characters: dash-dash-space (no more, no less).
371 .TP
372 .BR "\-\-sigsmax" [=n]
373 "maximum number of tolerated signatures":
374 Here you can define how many signatures you accept to be treated as such.
375 (Most significant behaviour is when microsoft style quotes are removed.
376 Experts please see the code for the more subtle implications of this
377 option.)
378 .br
379 Leave empty or specify zero to have an unlimited number of sigs. 
380 Default is 1.
381 .TP
382 .B "\-\-spass"
383 "SpamAssassin workaround":
384 SpamAssassin (available at
385 .IR http://spamassassin.org/ ") often is configured that it adds some"
386 lines to the message body containing information about the spam criteria
387 which were found matching for the message. This option enables an extra
388 test to avoid false positives for Microsoft style TOFU on such messages.
389 .TP
390 .B "\-t"
391 "TOFU deletion":
392 Hides "traditional style" TOFU, where each line begins with an
393 indent string like "> ".
394 .br
395 (You may edit the indent pattern in the script itself to suit your needs,
396 but it is surely
397 .I not
398 recommended at all.)
399 .TP
400 .B "\-w"
401 "whitespace deletion":
402 Hides trailing whitespace (sequences of space and tab).
403 CAVEAT: This may lead to interesting effects with crossposts
404 between mailing lists or with undetected signature attempts.
405 .TP
406 .B "\-v, \-\-version"
407 "version info":
408 Prints the current version number and release date, and exit.
409 .SH TOFU?
410 TOFU is an abbreviation which mixes German and English words;
411 it expands to "text oben, full-quote unten" which means
412 "text above - full quote below" and describes the style of so
413 many users who let their mailer or newsreader quote everything
414 of the previous message and just add some text at the top;
415 obviously they think that quoted text must not be changed at all.
416 This is quite annoying as it needlessly sends a lot of data
417 even when it is not required. Some editing of messages is desired.
418 Please point these people to the page 
419 .I http://www.river.com/users/share/etiquette/edit.html
420 - thank you!
421 .SH TROUBLESHOOTING
422 .TP
423 .IR Q :
424 I want to make my mailing list footer files match more different mailing
425 list footers. Can I use regular expressions, or how can I accomplish that?
426 .TP
427 .IR A :
428 Nope, regexp's do not work here. The comparison is made by the perl builtin
429 .IR index ()
430 function (see 
431 .B perldoc
432 for more detailed info), so you must exactly match the beginning of the
433 line. The longer the line you specify, the more precise the match; if
434 your line is empty you match unconditionally.
435 .PP
436 .TP
437 .IR Q :
438 I use the options -l and -L to supress mailing list footers when 
439 displaying messages in
440 .BR mutt (1).
441 This does work sometimes, but sometimes it does not: the footer is not
442 detected, and therefore full quotes are not deleted and signatures are
443 detected as too long (which they aren't).
444 .TP
445 .IR A :
446 This might occur if the message is badly encoded, so mutt cannot resolve
447 all encoded characters, e.g. if you have an encoded message on a mailing
448 list, and majordomo appends a mailing list footer in a different encoding
449 (or even plain us-ascii). "-- " simply does not match "--=20". 
450 .br
451 Another problem are non-us-ascii characters. Just avoid them, and 
452 everything should work fine.
453 .br
454 See the preceding Q+A for a solution.
455 .PP
456 .TP
457 .IR Q :
458 I want to write a message which contains parts that should *not* be 
459 deleted even when filtered with t-prot. Is this possible?
460 .TP
461 .IR A :
462 Yes, but please do not spread word of it. Make unobstrusive use of the
463 .I
464 verbatim
465 instruction:
466 .sp
467 #v+
468 .br
469 This line is protected from being filtered by t-prot !!!!!!!
470 .br
471 #v-
472 .br
473 Text coming now is not.
474 .SH AUTHOR AND COPYRIGHT
475 Written by Jochen Striepe <t-prot@tolot.escape.de>.
476 .br
477 Copyright \(co 2001-2005 Jochen Striepe.
478 .PP
479 This is free software; you may use the source to whatever you like.
480 Just keep in mind to mention the original source of the script and the manpage
481 when you give it away. There is NO warranty; not even for MERCHANTABILITY or 
482 FITNESS FOR A PARTICULAR PURPOSE.
483 .SH IDEAS AND INSPIRATION
484 Many good ideas, bug reports and support from (in alphabetical order) Bjoern
485 Buerger, Bjoern Laessig, Christian Borss, Gerfried Fuchs, Martin Neitzel, Martin
486 Dietze, Ralf Doeblitz, Sven Guckes and many more (see the ChangeLog for active
487 contributors). Many thanks to all of them!
488 .sp
489 Many thanks to Gerhard H. Wrodnigg who uses a TOFU protection script
490 in order to keep the responses to his cancel bot reasonably short.  The
491 entire inspiration for this hack came from the "TOFU protection" line of
492 his script on many usenet postings.
493 .SH AVAILIBILITY
494 You can get the latest version from
495 .IR http://www.escape.de/users/tolot/mutt/ .
496 .SH BUGS
497 Please note that t-prot development happens on
498 .BR "current stable perl versions only" . 
499 If you do run t-prot on earlier (or unstable) perl versions, you might
500 encounter perl compiler bugs (or funny t-prot behaviour). One solution
501 is to upgrade your perl, another is simply to write a bug report. If
502 you do not run a current perl version, please include this information
503 in your bug report. Thank you.
504 .PP
505 There is a problem when mutt gives a PGP verified or even a multipart
506 message to t-prot: The information where the PGP encrypted/signed data
507 or even attachments begin and end is plainly embedded in the text, not
508 really cleanly recognizeable for t-prot. The problem should be worked
509 around by now, please send a bug report if it does not work for you.
510 .PP
511 There probably are many more bugs in this piece of software. Feel free to
512 fix them - it's
513 .BR perl ,
514 so you have the sources. Ah, and while you're at it, please drop a note to
515 the author - thanks in advance! 
516 .SH "REPORTING BUGS"
517 Please send your bug report to <t-prot-bugs@tolot.escape.de>.
518 .SH TODO
519 Fix bugs (see the 
520 .I BUGS
521 section). Beside that, all main features should be implemented by now.
522 .SH "SEE ALSO"
523 .BR mutt (1),
524 .BR muttrc (5)
525 and the part about "display_filter", 
526 .BR perl (1),
527 .BR aliases (5),
528 RFCs 822, 2045, 2046, 2049, and 2822,
529 .I http://got.to/quote/
530 (German language), 
531 .I http://www.river.com/users/share/etiquette/edit.html
532 (the Learn To Edit Messages HowTo has found a new home).
533