# Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore) # # Permission to use, copy, modify, and distribute this material # for any purpose and without fee is hereby granted, provided # that the above copyright notice and this permission notice # appear in all copies, and that the name of Bellcore not be # used in advertising or publicity pertaining to this # material without the specific, prior written permission # of an authorized representative of Bellcore. BELLCORE # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY # OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. # # Prototype Mailcap file # Note that support for text & multipart are "built in" to metamail, # as are rudimentary support for message, and application. # However, any of these may be overridden in mailcap. # # Note that users may override or extend this with a .mailcap # file in their own directory. However, there is NO NEED # for them to copy entries from this file, as metamail will # pick up entries from both the system and personal mailcap files. # # NOTE: This file has been heavily modified for use as an example # configuration file for Lynx # In the samples given test=test -n "$DISPLAY" is used to # determine if the current session is X capible by checking # for the existance of a DISPLAY environment variable. # Lynx actually uses a getenv() call for DISPLAY (DECW$DISPLAY # on VMS) when it encounters test=test -n "$DISPLAY" or # test=test -z "$DISPLAY" in a viewer assignment, instead of # spawning to execute "test" via a system() call, i.e., those # two strings, respectively, are handled equivalently to the # :XWINDOWS and :NON_XWINDOWS flags for VIEWER: assignments # in lynx.cfg. Any system without the DISPLAY (or DECW$DISPLAY) # environment variable will be assumed to be Non-X. # You can append a ';' followed by "q=#.#", e.g., ; q=0.002 # to set the quality parameter for the Content-Type, which can be # included in the Accept: header Lynx sends to http servers (the # default quality value is 1.0, and Lynx appends the parameter # to the Content-Type only if the value is less than 1.0). # You can append a ';' followed by "mxb=#", e.g., ; mxb=1000000 # to set the maxbytes parameter for the Content-Type, which can be # included in the Accept: header Lynx sends to http servers (the # default maxbytes value is 0, meaning no maximum, and Lynx appends # the parameter to the Content-Type only if the value exceeds 0). # The following line is for sites where xv understands jpeg but xloadimage # is preferred. # # the test line specifies that this viewer should only be used if # the display variable is set. #image/jpeg; xv %s; test=test -n "$DISPLAY" # The following sends all other image subtypes to xloadimage #image/*; xloadimage %s; ; test=test -n "$DISPLAY" # The following sends all other image subtypes to xv #image/*; xv %s; ; test=test -n "$DISPLAY" # If you have an interactive Postscript interpreter, you should think carefully # before replacing lpr with it in the following line, because PostScript # can be an enormous security hole. It is RELATIVELY harmless # when sent to the printer... # This one is for NON-X #application/postscript; lpr %s \; echo SENT FILE TO PRINTER; ;test=test -z "$DISPLAY" # This one is for X. It's already the default via src/HTInit.c. #application/postscript; ghostview %s; ; test=test -n "$DISPLAY" # The following should be commented out if you do NOT have safe-tcl # and should be uncommented if you DO have safe-tcl #application/safe-tcl; swish -safe -messaging -f %s # A common problem with the mailcap mechanism is getting differential # behavior from different programs. This problem is compounded by the fact # that some programs, notably Mosaic, do not implement the "test" clause in # mailcap files. If you are using Lynx and X Mosaic together you should # place all X-centric entries before non-X entries. X Mosaic will use # whichever entry is defined first so further entries will be ignored. # # Lynx exports the environment variable LYNX_VERSION, so it can be tested # by scripts to determine if Lynx is running or not. However, the string # test=test -n "$LYNX_VERSION" # is handled simply as a flag which yields success when Lynx encounters it # in the mailcap file (i.e., Lynx does not bother to execute "test" via a # system() call to find out if it's running, because it obviously is). # Inclusion of the string for that test can be used to prevent other # software which reads the mailcap file from acting on assignments intended # only for Lynx. The string # test=test -z "$LYNX_VERSION" # similarly is treated by Lynx simply as a flag which yields failure. ############################################################################### # # The following entries were created by LeRoy N. Eide ; # many are stolen from Debian Linux's /etc/mailcap (or at least the ideas). # # Note: We use `less -+E -+e' rather than `more' as a general pager here # (for the desirablility of the -+[Ee] options, see less(1) manpage); # commands that pipe output to a pager should specify a %s filename # argument to avoid any STDIN (or TTY) input conflicts with the pager. # ############################################################################### #application/applefile; rcvAppleSingle %s; compose=sndAppleSingle %s; description=An Apple Macintosh file in AppleSingle format #application/applefile; echo "No viewer for type 'application/applefile'"; compose=sndAppleSingle %s; description=An Apple Macintosh file in AppleSingle format # #application/ghostview; gv %s; test=test -n "$DISPLAY"; description=GhostScript/PostScript application/ghostview; ghostview -safer %s; test=test -n "$DISPLAY"; description=GhostScript/PostScript # #application/mac-binhex40; cat; copiousoutput; description=BINHEX File application/mac-binhex40; less -+E -+e; needsterminal; description=BINHEX File # #application/mathematica; XMathReader %s; test=test -n "$DISPLAY"; description=Mathematica Notebook File; nametemplate=%s.ma # #application/octet-stream; od -c; copiousoutput; description=Binary Data application/octet-stream; od -c %s | less -+E -+e; needsterminal; description=Binary Data # application/pdf; acroread %s; test=test -n "$DISPLAY"; description=Adobe "Acrobat" File; nametemplate=%s.pdf #application/pdf; gv %s; test=test -n "$DISPLAY"; description=Adobe "Acrobat" File; nametemplate=%s.pdf #application/pdf; xpdf %s; test=test -n "$DISPLAY"; description=Adobe "Acrobat" File; nametemplate=%s.pdf # #application/pgp-signature; cat; copiousoutput; description=PGP File application/pgp-signature; less -+E -+e; needsterminal; description=PGP File # #application/postscript; gv %s; test=test -n "$DISPLAY"; description=PostScript File application/postscript; ghostview -safer %s; test=test -n "$DISPLAY"; description=PostScript File #application/postscript ; lpr %s && echo SENT FILE TO PRINTER ; description=Postscript File # #application/rtf; cat; copiousoutput; description=RTF File application/rtf; less -+E -+e; needsterminal; description=RTF File # #application/vis5d; vis5d %s -path directory_where_Vis5D_is; test=test -n "$DISPLAY"; description=V5D File; nametemplate=%s.v5d # #application/vnd.hp-HPGL; hpglview %s; test=test -n "$DISPLAY"; description=HPGL File; nametemplate=%s.hpgl #application/vnd.hp-HPGL; xhpgl %s; test=test -n "$DISPLAY"; description=HPGL File; nametemplate=%s.hpgl # #application/zip; unzip -lv %s; copiousoutput; description=ZIP File; nametemplate=%s.zip application/zip; unzip -lv %s | less -+E -+e; needsterminal; description=ZIP File; nametemplate=%s.zip # #application/x-compress; gunzip -cf; copiousoutput; description=Compressed File application/x-compress; gunzip -cf %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.gz #application/x-compress; uncompress -c; copiousoutput; description=Compressed File #application/x-compress; uncompress -c %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.Z # #application/x-csh; cat; copiousoutput; description=CSH Script application/x-csh; less -+E -+e; needsterminal; description=CSH Script # #application/x-debian-package; debian-view %s; needsterminal; description=Debian GNU/Linux Package; nametemplate=%s.deb # #application/x-dvi; xdvi %s; test=test -n "$DISPLAY"; description=TeX DVI File # #application/x-gtar; gunzip -cf | tar -tvf -; copiousoutput; description=Compressed TAR File application/x-gtar; gunzip -cf %s | tar -tvf - | less -+E -+e; needsterminal; description=Compressed TAR File; nametemplate=%s.gtz # #application/x-gzip; gunzip -cf; copiousoutput; description=Compressed File application/x-gzip; gunzip -cf %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.gz # #application/x-msdos-program; cat; copiousoutput; description=MSDOS Program application/x-msdos-program; less -+E -+e; needsterminal; description=MSDOS Program # #application/x-perl; cat; copiousoutput; description=PERL Script application/x-perl; less -+E -+e; needsterminal; description=PERL Script #application/x-rtf; cat; copiousoutput; description=RTF File application/x-rtf; less -+E -+e; needsterminal; description=RTF File # #application/x-sh; cat; copiousoutput; description=SH Script application/x-sh; less -+E -+e; needsterminal; description=SH Script # #application/x-shar; cat; copiousoutput; description=SHAR Script application/x-shar; less -+E -+e; needsterminal; description=SHAR Script # #application/x-tar; tar -tvf -; copiousoutput; description=TAR File application/x-tar; tar -tvf - | less -+E -+e; needsterminal; description=TAR File # Displaying audio only makes sense if either: # a) local DISPLAY (with audio capabilities); # b) remote AUDIOSERVER (which selected application supports). # Note that `auplay' (if available) supports a Network Audio Server (NAS). #audio/basic; auplay %s; test=test -n "$DISPLAY" -o -n "$AUDIOSERVER"; description=AU Audio Format; nametemplate=%s.au #audio/basic; audiotool -p %s; compose=audiotool %s; edit=audiotool %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=AU Audio Format; nametemplate=%s.au #audio/basic; xanim %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=AU Audio Format; nametemplate=%s.au #audio/basic; audioplay %s; description=AU Audio Format; nametemplate=%s.au # #audio/x-aiff; sfplay %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=AIFF Audio Format; nametemplate=%s.aif # #audio/x-mpeg; maplay %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=MPEG Audio Format; nametemplate=%s.mp2 #audio/x-mpeg; maplay-ulaw -s - | xplay -; stream-buffer-size=8000; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=MPEG Audio Format # #audio/x-pn-realaudio; raplay %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=RealAudio Forma; nametemplate=%s.rat # #audio/x-wav; auplay %s; test=test -n "$DISPLAY" -o -n "$AUDIOSERVER"; description=AU Audio Format; nametemplate=%s.wav #audio/x-wav; xanim %s; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0; description=WAV Audio Format; nametemplate=%s.wav # audio/*; xplay -forkoff -; stream-buffer-size=8000; test=test -n "$DISPLAY" && test `expr $DISPLAY : '[^:]*'` -eq 0 #default; sun-message %s %{encoding}; description=Sun Message #encoding/x-compress; gunzip -cf; copiousoutput; description=Compressed File encoding/x-compress; gunzip -cf %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.gz #encoding/x-compress; uncompress -c; copiousoutput; description=Compressed File #encoding/x-compress; uncompress -c %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.Z # #encoding/x-gzip; gunzip -cf; copiousoutput; description=Compressed File encoding/x-gzip; gunzip -cf %s | less -+E -+e; needsterminal; description=Compressed File; nametemplate=%s.gz # #encoding/*; gunzip -cf; copiousoutput encoding/*; gunzip -cf %s | less -+E -+e; needsterminal; nametemplate=%s.gz image/bmp; xv %s; test=test -n "$DISPLAY"; description=BMP Image; nametemplate=%s.bmp # #image/cgm; ralcgm -d xw %s; test=test -n "$DISPLAY"; description=CGM Image; nametemplate=%s.cgm # image/cmu-raster; xv %s; test=test -n "$DISPLAY"; description=CMU-Raster Image; nametemplate=%s.ras # image/fits; xv %s; test=test -n "$DISPLAY"; description=FITS Image; nametemplate=%s.fts # #image/g3fax; viewfax %s; test=test -n "$DISPLAY"; description=Group 3 FAX Image; nametemplate=%s.g3f # image/gif; xv %s; test=test -n "$DISPLAY"; description=GIF Image; nametemplate=%s.gif #image/gif; xanim %s; test=test -n "$DISPLAY"; description=GIF Image; nametemplate=%s.gif # image/jpeg; xv %s; test=test -n "$DISPLAY"; description=JPEG Image; nametemplate=%s.jpg #image/jpeg; xanim %s; test=test -n "$DISPLAY"; description=JPEG Image; nametemplate=%s.jpg # image/pm; xv %s; test=test -n "$DISPLAY"; description=PM Image; nametemplate=%s.pm # image/png; xv %s; test=test -n "$DISPLAY"; description=PNG Image; nametemplate=%s.png # image/postscript; xv %s; test=test -n "$DISPLAY"; description=PostScript Image; nametemplate=%s.ps # image/targa; xv %s; test=test -n "$DISPLAY"; description=TARGA Image; nametemplate=%s.tga # image/tiff; xv %s; test=test -n "$DISPLAY"; description=TIFF Image; nametemplate=%s.tif # image/xbm; xv %s; test=test -n "$DISPLAY"; description=XBM Image; nametemplate=%s.xbm # image/x-cmu-raster; xv %s; test=test -n "$DISPLAY"; description=CMU-Raster Image; nametemplate=%s.ras # image/x-portable-bitmap; xv %s; test=test -n "$DISPLAY"; description=PBM Image; nametemplate=%s.pbm # image/x-portable-graymap; xv %s; test=test -n "$DISPLAY"; description=PGM Image; nametemplate=%s.pgm # image/x-portable-pixmap; xv %s; test=test -n "$DISPLAY"; description=PPM Image; nametemplate=%s.ppm # image/x-rgb; xv %s; test=test -n "$DISPLAY"; description=RGB Image; nametemplate=%s.rgb # image/x-xbitmap; xv %s; test=test -n "$DISPLAY"; description=XBM Image; nametemplate=%s.xbm # image/x-xpixmap; xv %s; test=test -n "$DISPLAY"; description=XPM Image; nametemplate=%s.xpm # #image/*; xloadimage %s; test=test -n "$DISPLAY" image/*; xv %s; test=test -n "$DISPLAY" #mail-file; sun-message %s %{encoding}; description=Sun Message #message/external-body; showexternal %s %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal; description=A reference to data stored in an external location #message/external-body; echo "No viewer for type 'message/external-body'"; composetyped=extcompose %s; needsterminal; description=A reference to data stored in an external location #message/partial; showpartial %s %{id} %{number} %{total}; description=An incomplete message #sun-deskset-message; sun-message %s %{encoding}; description=Sun Message #text/enriched; shownonascii iso-8859-1 -e richtext -e -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-1 Enriched Text #text/enriched; shownonascii iso-8859-1 -e richtext -e -p %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; needsterminal; description=ISO-8859-1 Enriched Text #text/enriched; shownonascii iso-8859-8 -e richtext -e -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-8 Enriched Text #text/enriched; shownonascii iso-8859-8 -e richtext -e -p %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; needsterminal; description=ISO-8859-8 Enriched Text #text/enriched; richtext -e %s; copiousoutput; description=Enriched Text # # The following processes html; the choices are: # a) use `netscape' if not running `lnyx' but DISPLAY is defined; # b) use `lynx' if not already running `lynx'. #text/html; cp %s %s.html && netscape file:%s.html && rm %s.html; test=test -z "$LYNX_VERSION" -a -n "$DISPLAY"; description=HTML Text #text/html; lynx -force_html file:%s; needsterminal; test=test -z "$LYNX_VERSION" -a -z "$DISPLAY"; description=HTML Text; nametemplate=%s.html text/html; lynx -force_html file:%s; needsterminal; test=test -z "$LYNX_VERSION"; description=HTML Text; nametemplate=%s.html # #text/plain; shownonascii iso-8859-1 %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-1 Text #text/plain; shownonascii iso-8859-1 %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; needsterminal; description=ISO-8859-1 Text #text/plain; shownonascii iso-8859-8 %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-8 Text #text/plain; shownonascii iso-8859-8 %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; needsterminal; description=ISO-8859-8 Text #text/plain; kterm -geometry +0+0 -e less -+E -+e %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-2022-jp -a -n "$DISPLAY"; description=ISO-2022-jp Text # #text/richtext; shownonascii iso-8859-1 -e richtext -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-1 Rich Text #text/richtext; shownonascii iso-8859-1 -e richtext -p %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; needsterminal; description=ISO-8859-1 Rich Text #text/richtext; shownonascii iso-8859-8 -e richtext -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8 -a -n "$DISPLAY"; copiousoutput; description=ISO-8859-8 Rich Text #text/richtext; shownonascii iso-8859-8 -e richtext -p %s | less -+E -+e; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; needsterminal; description=ISO-8859-8 Rich Text #text/richtext; richtext %s; copiousoutput; description=Rich Text # text/sgml; cp %s %s.sgml && lynx file:%s.sgml && rm %s.sgml; needsterminal; test=test -z "$LYNX_VERSION"; description=SGML Text # #text/tab-separated-values; xmgr %s; test=test -n "$DISPLAY"; description=Tab Separated Values # #text/*; cat; copiousoutput text/*; less -+E -+e; needsterminal video/dl; xanim %s; test=test -n "$DISPLAY"; description=DL Video # video/fli; xanim %s; test=test -n "$DISPLAY"; description=FLI Video # #video/mpeg; mpeg_play -quiet %s; test=test -n "$DISPLAY"; description=MPEG Video; nametemplate=%s.mpg video/mpeg; xanim %s; test=test -n "$DISPLAY"; description=MPEG Video; nametemplate=%s.mpg # video/msvideo; xanim %s; test=test -n "$DISPLAY"; description=AVI Video; nametemplate=%s.avi # video/quicktime; xanim %s; test=test -n "$DISPLAY"; description=QuickTime Video; nametemplate=%s.mov # video/x-msvideo; xanim %s; test=test -n "$DISPLAY"; description=AVI Video; nametemplate=%s.avi # video/x-sgi-movie; xanim %s; test=test -n "$DISPLAY"; description=SGI Video # video/*; xanim %s; test=test -n "$DISPLAY" #x-sun-attachment; sun2mime %s; description=Sun Mailtool Message