PIne Web View Attachment
Current version:

Old releases:

Thomas Karlsson piwva at relea se
Here is the README file in the packet
# Copyright (C) 2003 Thomas Karlsson
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
# How to contact me. 	Mail: 

Piwva is short for PIne Web View Attachment and it simply extracts files from mailmessages,
copies them to a place where the webserver can reach it, calulates a link and presents it to the user.
Then its easy to copy and paste the link to a browser and view your attachment. The script also randomizes
a temporary username and password when viewing an attachment and when you're done the script removes the
attachment from the html directory and again changes username and password just to keep nosy ppl away :)

1.01	* Code clean up and other stuff before doing a debian package of it
	* Henrik Andréasson contributed a patch which extracts the configuration to an external file.
0.9	* Added libextractor support to guess extensions
0.8	* Added a wget line. This was a contribution from Henrik Andréasson
0.7	* Added script support for Microsoft TNEF files (Those winmail.dat files)
0.6	* Misspelled a variable, found by Thijs Kroesbergen,
0.5	* Piped stderr to /dev/null too.
	* Now uses "whoami" to get hold of the username
	These two bugs was found and fixed by Thijs Kroesbergen,
0.4	Initial release

1. Edit ~/.piwva.config and change necessary parameters
2. Copy to a suitable location and make sure it has the execute bit set (chmod 750 is fine)
3. Change all paths in mailcap to point to the piwva location. A suggestion is /usr/local/bin/
4. Copy mailcap to your homedirectory and change the filename to .mailcap
5. You have to enable enable-mailcap-param-substitution in Pine, because Piwva uses %{name} to get the correct filename from the attachement
5. And of course, add more entries in mailcap if you need to.
6. Restart Pine. Pine loads /etc/mailcap and ~/.mailcap at startup.


I have added support for suggesting extensions for the files by using the libextractor (
To install libextractor, just follow the installation instructions on their homepage. If you have Debian just execute
"apt-get install extract"

TNEF SUPPORT (Outlook express attachments)

I have added some support for reading attachments from those evil outlook users. The TNEF-decoder I am using
is the one found in debian (apt-get install tnef). I tried to find the homepage for this utility but failed.

If you use the "debian-tnef" this script will probably work out-of-the-box and you can stop reading this section
if you like. For those who use different TNEF-decoders I have added two variables in the script. They are


Type the command for your TNEF-decoder in this variable so that the variable contains one filename per row.
Use %%FILE%% to put the winfile.dat in your command.


Type the command for your TNEF.decoder in this variable to extract the files to the HTMLDIR-directory.
Use %%FILE%% to put the winfile.dat in your command.

Well, thats it.

	Henrik Andreasson named this project/script, creating debian packages of it and patches