T-PROT(1) | General Commands Manual | T-PROT(1) |
t-prot - TOFU Protection - Display Filter for RFC 5322 messages
t-prot [OPTIONS]...
This program is a filter to improve the readability of internet
messages (emails and usenet 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. The program also
detects TOFU or a high quoting ratio in a message (so you may take
appropriate action, e.g. when submitting messages to a mailing list or a
news server).
The filter is written in Perl and relies on input to be a single message
conforming to RFC 822 or its successors, RFC 2822 and RFC 5322. In messages
conforming to MIME (RFCs 2045-2049) t-prot handles text/plain parts, others
are not touched.
Already reformatted messages are handled well: the script was initially designed to cope with the output of the MUA mutt (which is the reason for not using standard CPAN modules for handling messages).
T-prot offers example configuration files for mutt and its fork mutt-kz, Heirloom mailx and metamail. Also coming with the t-prot package is the example S-Lang macro t-prot.sl for using t-prot from within slrn. There is a proof-of-concept filter for INN2, which you will have to adapt to the needs of the news site you host. For use with sendmail's alias(5) file, please see below (the option -p provides an example line).
If you do not specify any options, t-prot does ... nothing. Every feature you want must be turned on explicitly. Admittedly, we have quite a number of options for t-prot. To limit confusion they are grouped into five sections: Input/Output Options, Advertisement And Mailing List Footers, Filtering Options, Detection Options, and Other Options. While the others should be quite clear, filtering and detection might deserve a word (or two).
If you want to tune the appearance of your mail from within your MUA (or news messages from within your NUA), then go for the Filtering Options section.
If you want to use t-prot to check on mails before they are submitted to mailing lists, fed to your news server, or delivered by your MDA, then have a peek at the Detection Options section. You may accept or reject/bounce messages depending on t-prot's result.
You can use this option safely to enable -o /dev/null (or other files which cannot be changed with the user's privileges).
NOTE: This option is not needed if --ftr-ad is specified.
NOTE: This requires a directory with footer files to be given with option -A DIRECTORY.
NOTE: This requires a directory with footer files to be given with option -L DIRECTORY. -l is not needed if --ftr-ml is specified.
NOTE: This requires a directory with footer files to be given with option -L DIRECTORY.
Also, protect diff standard output from hiding (which would otherwise be easy prey for -t).
Requires -k.
Requires -k.
Requires -k.
NOTE: If you use mutt, mutt-kz or gnupg with locales, t-prot will only work correctly if you specify the corresponding locale string. Alternatively, you can use the environment variables LC_ALL, LC_MESSAGES, or LANG to specify the locale string.
NOTE also: You also have to make sure you are running t-prot with matching gnupg and mutt / mutt-kz versions. T-prot detects gnupg and mutt / mutt-kz locales of the recent stable versions of those programs, earlier versions might not work well with a recent version of t-prot.
Please note that this is probably just a waste of time because most MS Outlook users who do produce this kind of TOFU won't care about making their messages the least bit readable or even predictable. So this option will probably just be interesting for mutt message hooks (to activate it on demand when you know the sender tries to write legible messages).
Requires -Mmutt / -Mmutt-kz and -m.
NOTE: If gpg is terminated before finished (e.g. hitting Ctrl-C, or using kill(1)), we cannot always detect if the check was interrupted. Though t-prot tries to be smart, there will be false positives.
NOTE: The line containing "-- " ist not counted when testing for an overlong signature, but it is included when displaying how many lines were deleted.
Intended for use from within mail delivery agents (MDAs) or mail transport agents (MTAs), or even from within INN, so the message bounces if TOFU is detected, and does not get on *your* nerves. :)
As an example for usage with sendmail, put this line into your alias file and invoke newaliases:
notofu: |"/usr/local/bin/t-prot -mt -p=user@mydomain"
This will bounce messages for <notofu@domainname> if any TOFU is detected inside the message, and deliver it to <user@mydomain> otherwise. Note that TOFU is only detected if you specify -t respectively -m.
PLEASE be careful not to bounce messages to mailing lists!
The environment variables LC_ALL, LC_MESSAGES, and LANG are read and respected when interpreting output by mutt / mutt-kz or gnupg (unless they are overruled by the --locale option). T-prot's own output is English regardless of any locale setting.
On program exit, t-prot uses exit codes from /usr/include/sysexits.h and thus behaves in a manner that sendmail and others understand when calling t-prot.
Currently, the codes used are
If, however, perl fails to compile and execute t-prot, perl's normal exit codes will be returned.
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 http://www.river.com/users/share/etiquette/edit.html - thank you!
There are several ways to fine-tune t-prot's performance:
Some command line options are quite grave a performance hit -- do not use -k and especially --ms-smart if you are content without them.
Checking for special footers is very costly as well. Put as few footer files as absolutely needed in any footer directory.
All PGP related options are eating up lots of CPU time. Try to avoid them on unsigned and unencrypted messages.
When calling t-prot from within mutt (or mutt-kz), you might use mutt's folder-hook and message-hook facilities to turn options on only when needed, e.g. to set up a different footer directory for each mailing list folder.
#v+
This line is protected from being filtered by t-prot !!!!!!!
#v-
Text coming now is not.
Written by Jochen Striepe <t-prot@tolot.escape.de>.
All of the documentation and software included in the t-prot releases is copyrighted by Jochen Striepe (except when explicitly stated otherwise).
Copyright © 2001-2015 Jochen Striepe. All rights reserved.
Redistribution and use, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. All advertising materials mentioning features or use of this software must display the following acknowledgement:
This product includes software developed by Jochen Striepe and others.
3. Neither the name of the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Many good ideas, bug reports and support from (in alphabetical order) Bjoern Buerger, Bjoern Laessig, Christian Borss, Gerfried Fuchs, Martin Neitzel, Martin Dietze, Matthias Kilian, Ralf Doeblitz, Sven Guckes and many more (see the ChangeLog for active contributors). Many thanks to all of them!
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.
You can get the latest version from http://www.escape.de/users/tolot/mutt/.
There is a problem when mutt gives a PGP verified or even a multipart message to 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 recognizable for t-prot. The problem should be worked around by now, please send a bug report if it does not work for you.
Please note that t-prot development happens on current stable perl versions only. If you do run t-prot on earlier (or unstable) perl versions, you might encounter perl compiler bugs (or funny t-prot behaviour). One solution is to upgrade your perl, another is simply to write a bug report. If you do not run a current perl version, please include this information in your bug report.
Please do not report a bug if
* you found it in the TODO file coming with the distribution. We do know
those and try to fix them as soon as possible.
* you have an old t-prot version. If you encounter a problem, first see if
there is a new t-prot version which fixes the issue. If you upgraded to the
latest version and it still occurs, a bug report is just great.
If you noticed a bug when processing a message and want to provide
the t-prot team with some useful info, please:
* if invoking t-prot by mutt's display_filter facility, just set
display_filter to something like
and include ~/foobar in the bug report -- this way we might
reproduce the bug much easier if you are using a different environment than
we do.
* provide information on what command line options you use t-prot with, what
perl version t-prot runs on your system, and what else might be important to
enable us reproducing the bug.
Send your bug report to <t-prot-bugs@tolot.escape.de>. Thank you.
Fix bugs (see the BUGS section). Beside that, all main features should be implemented by now. See the TODO file for more information.
mutt(1), mutt-kz(1), muttrc(5) and the part about "display_filter", perl(1), aliases(5),
RFCs 2045-2049, 3676 and 5322,
http://freshmeat.net/articles/t-prot/ (a nice, solid
introduction),
http://got.to/quote/ (German language),
http://www.river.com/users/share/etiquette/edit.html (the Learn To Edit
Messages HowTo has found a new home).
March 2015 | T-PROT |