Pine and binaries
Pine is a nice email client for UNIX/Linux systems that can be configured to do amazing things! By default, handling of binary file attachments is a bit complicated. This tip shows how to enable Pine to show Word doc, RTF and Adobe PDF files as text.
Check program availability
First you need to check if your system has the programs that can convert the binary files (pdf, doc or rtf) to plain text. This can be done most easily with locate program
. The programs you can use may change over the years, but currently there are only few applications and they are:
- antiword for Word doc files
- rtf2text for RTF (the link points to an unofficial source, I was unable to find a proper source at the moment)
- xpdf for Adobe pdf files
Setup .mailcap
Mailcap is file format for controlling application behavior according to their MIME format (see http://archive.ncsa.uiuc.edu/SDG/Software/XMosaic/mailcap.html for details). In this case, you want to edit your personal mailcap file ~/.mailcap
, found in the root of your home directory, possibly empty at the moment. Load your favorite text editor and add the following lines:
#this is a mailcap comment line application/MSWORD; /usr/bin/antiword '%s' | less; needsterminal application/PDF; /usr/bin/pdftotext -nopgbrk '%s' - | less; needsterminal text/RTF; /usr/bin/rtf2text '%s' | less; needsterminal # the following setting may be commented out # I use it as MIME format do sometimes get messed up application/OCTET-STREAM; /usr/bin/antiword '%s' | less; needsterminal
The configuration file format is explained in the reference above. Basically the file just determines what applications take care of particular MIME formatted files and how they do it. For pdftotext I have overridden the default behavior not to printout page breaks, which mess up the less
display.
Use Pine to view docs, pdfs and rtfs
Now the configuration is fine. You must restart Pine if you're already running it. Open a message containing an attachment and select view. Standard behavior of Pine is to check if you want to view it or not. Select Yes and be surprised
Related content:
Lassi A. Liikkanen, Harri Kilpiö, Lauri Svan, and Miko Hiltunen (2014) Lean UX - The Next Generation of User-Centered Agile Development? In Proc. of NordiCHI 2014. Helsinki, Finland, 2014/10/21
Liikkanen (2014) Music Interaction Trends in Finland: YouTube and Spotify. Proceedings of Academic MindTrek'14. NOV 04-07, Tampere, Finland, 2014/10/07
A list of the most successful domestic artists in Finland 2008-2012 based on various criteria as described in the paper. In alphabetical order., 2014/09/29
No comments for this page
Add comment | Show all comments