# http://www.berklix.com/~jhs/dots/.mailcap By jhs_ERASE_@berklix.com # ~jhs/public_html/dots/.mailcap # See: man metamail ; man 4 mailcap # I should export this to /site/usr/local/etc/mailcap # Only read when EXMH starts, not when clicking on a mail. # openoffice often doesnt compile, & is horrendously big # so try to avoid it & libreoffice, & use lighter tools. # See also (unused) ~jhs/.mime.types # Content-Type in RFC 822 ; Command to display ; optional test etc # http://tools.ietf.org/html/rfc822 # Default rule: text/plain; cat %s # fails to work from EXMH, (as it needs to open a window in X ?). text/plain; xvile %s application/pdf; xpdf %s application/postscript; ghostview %s image/bmp; showpicture -viewer xv %s image/gif; showpicture -viewer xv %s image/jpeg; showpicture -viewer xv %s image/x-png; showpicture -viewer xv %s # From mk@work 31 Oct 2014 # Rule above does not work, but EXMH right click "Display in line" works. image/pjpeg; showpicture -viewer xv %s # pjpeg is a label Microsoft falsely generates in Internet Explorer. # Seen 2014_09_15. from mk@ uploaded to webmail.berklix.net, creating: # Content-Type: image/pjpeg; # name="IMG_0290.JPG" # Content-Disposition: attachment; filename="IMG_0290.JPG" # Content-Transfer-Encoding: base64 # It would not display from EXMH when clicked from mouse, # http://stackoverflow.com/questions/115705/why-does-ie7-specify-a-mime-type-of-image-pjpeg-rather-than-just-image-jpeg # Because M$ likes to violate standards. There's no such MIME # type as image/pjpeg. See for yourself: # http://www.iana.org/assignments/media-types/image/ # The correct MIME type for JPEG is image/jpeg, # progressive or not. # # https://en.wikipedia.org/wiki/JPEG # image/jpeg (defined in RFC 1341), except in Internet # Explorer, which provides a MIME type of image/pjpeg when # uploading JPEG images # # There is also an interlaced "Progressive JPEG" format, in # which data is compressed in multiple passes of progressively # higher detail. This is ideal for large images that will be # displayed while downloading over a slow connection, allowing # a reasonable preview after receiving only a portion of the # data. image/mp3; mpg123 %s image/png; showpicture -viewer xv %s image/pps; openoffice %s image/tiff; showpicture -viewer xv %s # image/pps; openoffice %s # image/*; showpicture -viewer xv %s application/excel; openoffice %s application/mplayer; mplayer %s application/msexcel; openoffice %s application/mspowerpoint; openoffice %s application/msword; openoffice %s application/powerpoint; openoffice %s video/x-ms-wmv; mplayer %s # application/octet-stream; openoffice %s # Melanie also sent me a .avi as an octet-stream, mplayer better for that. # wintervortrag@deutsches-museum.de send at 2011 his PDF as Content-Type: application/octet-stream # & xpdf much lighter weight than openoffice application/vnd.ms-excel; openoffice %s application/vnd.ms-powerpoint; openoffice %s application/vnd.stardivision.calc; openoffice %s application/vnd.stardivision.draw; openoffice %s application/vnd.stardivision.impress-packed; openoffice %s application/vnd.stardivision.impress; openoffice %s application/vnd.stardivision.math; openoffice %s application/vnd.stardivision.writer-global; openoffice %s application/vnd.stardivision.writer; openoffice %s application/vnd.sun.xml.calc.template; openoffice %s application/vnd.sun.xml.calc; openoffice %s application/vnd.sun.xml.draw.template; openoffice %s application/vnd.sun.xml.draw; openoffice %s application/vnd.sun.xml.impress.template; openoffice %s application/vnd.sun.xml.impress; openoffice %s application/vnd.sun.xml.math; openoffice %s application/vnd.sun.xml.writer.global; openoffice %s application/vnd.sun.xml.writer.template; openoffice %s application/vnd.sun.xml.writer; openoffice %s application/x-msexcel; openoffice %s application/x-mspowerpoint; openoffice %s application/x-starcalc; openoffice %s application/x-stardraw; openoffice %s application/x-starimpress; openoffice %s application/x-starmath; openoffice %s application/x-starwriter; openoffice %s # String audio/x-wav is what EXMH created when I included a .wav from Clipman. # Adding this line changed the default behavious from a hiss to usable, # when in EXMH scrolling to last "pass to metamail", # however as one loses control to stop, advance rewind I now use not # mplayer in background but gmplayer witha a control screen # mplayer is overkill for just sound but it does work, # so keep until I find something smaller. audio/x-wav; gmplayer %s # JJLATER Problem: # image/tiff; tiff2ps -a %s > %s.ps \; ghostview %s.ps \; rm %s.ps # the %s.ps get created & removed in ~/tmp/ # Pipe above: # on a tiff image I have cropped with xv, scaling goes awry, # image/tiff; showpicture -viewer xv %s # Xv above: # only shows first page of a tiff multi page scan # # 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 that the effect of the following is to send ALL audio subtypes to the # # showaudio program, but to compose audio (e.g. in the mailto program) # # using "audio/basic" as the type. # audio/*; showaudio %s # audio/basic; showaudio %s; compose=audiocompose %s; edit=audiocompose %s; description="An audio fragment" # # # The following line is for sites where xv understands jpeg but xloadimage is preferred. # image/jpeg; showpicture -viewer xv %s # # The following sends all other image subtypes to showpicture. # image/*; showpicture -viewer xv %s # # The following all appear AFTER the corresponding READING entries, and # # are for use in messages composition, e.g. in the "mailto" program # # In the following lines, the exit 0 junk is necessary because xwd # # doesn't always exit with a valid exit status! # # For sites with current (X11R5) pbm utilities # image/gif; showpicture -viewer xv %s; compose="xwd -frame | xwdtopnm | ppmtogif > %s\; exit 0"; description="An X11 window image dump in GIF format" # # The following line should be used instead of the previous by sites # # with old (X11R4) pbm utilities # #image/gif; showpicture %s; compose="xwd -frame | xwdtoppm | ppmtogif > %s\; exit 0"; description="An X11 window image dump in GIF format" # # For receiving X11 window image dumps from older versions of Andrew messages # image/x-xwd; showpicture %s; description="An X11 window image dump in X-XWD format" # # message/partial; showpartial %s %{id} %{number} %{total} # message/external-body; showexternal %s %{access-type} %{name} %{site} %{directory} %{mode} %{server}; \ # needsterminal; composetyped = extcompose %s; \ # description="A reference to data stored in an external location" # # # You can alter the above entry to only use certain access-types by # # adding a clause like the following before the "description=" line: # # test=test %{access-type} = mail-server; \ # # # # 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... # application/postscript ; lpr %s \; echo SENT FILE TO PRINTER ; description="A Postscript File";\ # compose="getfilename Postscript %s" # # # The following should be commented out if you do NOT have safe-tcl # # and should be uncommented if you DO have safe-tcl # #multipart/enabled-mail; show-enabled %F # #application/safe-tcl; swish -safe -messaging -f %s # # # The following should be commented out if you do NOT have atomicmail # # and should be uncommented if you DO have ATOMICMAIL # #application/atomicmail; atomicmail %s; compose=surveyor.am -p %s; description="An interactive ATOMICMAIL survey" # # The following should be used instead if you have atomicmail but not TK. # #application/atomicmail; atomicmail %s ; needsterminal # #application/atomicmail; atomicmail %s; compose=surveyor.am -p %s; description="An interactive ATOMICMAIL survey"; needsterminal # # # The following give rudimentary capabilities to read old andrew format # # even to non-Andrew sites, since "ezview" comes with metamail. # x-be2; ezview %s ; copiousoutput # application/andrew-inset; ezview %s ; copiousoutput; edit=ez -d %s; compose="ez -d %s"; description="An Andrew inset/document" # # # The following gives rudimentary capability for receiving # # text mail in the ISO-8859-1 character set, which covers many European # # languages, and the ISO-8859-8 character set, which includes Hebrew # # Note that the pipe to tr ensures that the "ISO" is case-insensitive. # text/richtext; shownonascii iso-8859-8 -e richtext -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; copiousoutput # text/richtext; shownonascii iso-8859-1 -e richtext -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; copiousoutput # text/plain; shownonascii iso-8859-8 %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; copiousoutput # text/plain; shownonascii iso-8859-1 %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; copiousoutput # text/enriched; shownonascii iso-8859-8 -e richtext -e -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-8; copiousoutput # text/enriched; shownonascii iso-8859-1 -e richtext -e -p %s; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-8859-1; copiousoutput # # # The following displays Japanese text at sites where the "kterm" program is installed: # text/plain; kterm -geometry +0+0 -e more %s /dev/null; test=test "`echo %{charset} | tr '[A-Z]' '[a-z]'`" = iso-2022-jp # # # text/richtext; richtext %s; copiousoutput # # If you have Andrew at your site, you MIGHT prefer to replace the # # above line with the following one, but probably won't because # # ez takes so long to start up. # # text/richtext; richtoatk < %s | ezview - ; copiousoutput # text/enriched; richtext -e %s; copiousoutput # # # The following is a VERY rough cut at showing mail from Sun's openwindows mailtool # # Old version # # x-sun-attachment; sun-to-mime %s # x-sun-attachment; sun2mime %s # audio-file; sun-audio-file %s # postscript-file; lpr %s \; echo SENT FILE TO PRINTER # default; sun-message.csh %s %{encoding}; needsterminal # mail-file; sun-message.csh %s %{encoding}; needsterminal # sun-deskset-message; sun-message.csh %s %{encoding}; needsterminal # # # The following is used for distributing metamail patches # # It should probably be used only by those administering metamail at a site. # # You will need to replace "source-tree-root" with the real root of your # # actual metamail source tree. # # You can also modify this line to get metamail patches from some trusted # # server other than thumper, if there is one -- man patch-metamail" for help. # application/x-metamail-patch; cat %s > /dev/null \; patch-metamail source-tree-root %{patchnumber}; needsterminal # # # The following is for support of MacMIME, especially those # # the Columbia AppleTalk package (CAP) installed. # # # # If you don't have CAP, and haven't changed rcvAppleSingle # # or sndAppleSingle, you should comment out this line. # application/applefile; rcvAppleSingle %s; compose="sndAppleSingle %s";description="An Apple Macintosh file in AppleSingle format" # # # # # The following is for interoperability with Z-Mail version 3.0 and beyond. # # To enable this compatibility, uncomment all of the following lines. # # # # # #application/x-movie; movieplayer %s; compose=moviemaker %s; \ # # description="Movie"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/movie.xbm" # #application/x-inventor; examine %s; description="Inventor file"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/inventor.xbm" # #application/x-zm-fax; zfax %s; description="Z-Fax document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/fax.xbm" # #application/x-showcase; showcase %s; compose=showcase %s; \ # # description="Showcase document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/showcase.xbm" # #application/x-jot; jot %s; compose=jot %s; description="Jot document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/jot.xbm" # #image/x-sgi; ipaste %s; compose=imgworks %s; description="SGI image"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/image.xbm" # #audio/x-aiff; playaiff %s; compose=recordaiff -t 60 %s; \ # # description="AIFF Audio"; x11-bitmap="/usr/lib/Zmail/bitmaps/sound.xbm" # #image/x-bitmap; bitmap %s; description="X11 bitmap"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/bitmap.xbm" # #image/x-xpm1; olpixmap %s; description="OL pixmap"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/bitmap.xbm" # #application/x-island-write; IslandWrite %s; compose=IslandWrite %s; \ # # description="IslandWrite document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/islwrite.xbm" # #application/x-island-draw; IslandDraw %s; compose=IslandDraw %s; \ # # description="IslandDraw document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/isldraw.xbm" # #application/x-island-paint; IslandPaint %s; compose=IslandPaint %s; \ # # description="IslandPaint document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/islpaint.xbm" # #application/x-framemaker; maker -f %s; compose=maker -f %s; \ # # description="FrameMaker document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/frame.xbm" # #application/x-wingz; Wingz %s; compose=Wingz %s; \ # # description="Wingz document"; \ # # x11-bitmap="/usr/lib/Zmail/bitmaps/wingz.xbm" # # Old Z-mail format # #x-zm-multipart: sun-to-mime %s # # #Another suggested way to use FrameMaker # # application/x-framemaker; clclient -f %s \; sleep 60 ; \ # # compose="getfilename FrameMaker %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. The following two mailcap entries should give you a model # # for a hack that will allow you to get differential behavior from Mosaic and # # metamail in spite of this fact. It exploits the fact that metamail always # # sets the MM_MAILER variable (if only to "unknown") while Mosaic does not. # # # # foo/bar; echo mosaic; test=test "$MM_MAILER" = "" # # foo/bar; echo not mosaic # # ------- End of Forwarded Message # application/ogg; /usr/local/lib/RealPlayer/realplay %s # application/sdp; /usr/local/lib/RealPlayer/realplay %s # application/smil; /usr/local/lib/RealPlayer/realplay %s # application/streamingmedia; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realaudio-secure; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realmedia-secure; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realmedia-vbr; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realmedia; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realsystem-rmj; /usr/local/lib/RealPlayer/realplay %s # application/vnd.rn-realsystem-rmx; /usr/local/lib/RealPlayer/realplay %s # application/x-ogg; /usr/local/lib/RealPlayer/realplay %s # application/x-sdp; /usr/local/lib/RealPlayer/realplay %s # audio/3gpp-encrypted; /usr/local/lib/RealPlayer/realplay %s # audio/3gpp; /usr/local/lib/RealPlayer/realplay %s # audio/aac; /usr/local/lib/RealPlayer/realplay %s # audio/aiff; /usr/local/lib/RealPlayer/realplay %s # audio/amr-encrypted; /usr/local/lib/RealPlayer/realplay %s # audio/amr-wb-encrypted; /usr/local/lib/RealPlayer/realplay %s # audio/amr-wb; /usr/local/lib/RealPlayer/realplay %s # audio/amr; /usr/local/lib/RealPlayer/realplay %s # audio/basic; /usr/local/lib/RealPlayer/realplay %s # audio/m4a; /usr/local/lib/RealPlayer/realplay %s # audio/mp1; /usr/local/lib/RealPlayer/realplay %s # audio/mp2; /usr/local/lib/RealPlayer/realplay %s # audio/mp3; /usr/local/lib/RealPlayer/realplay %s # audio/mpeg; /usr/local/lib/RealPlayer/realplay %s # audio/mpegurl; /usr/local/lib/RealPlayer/realplay %s # audio/mpg; /usr/local/lib/RealPlayer/realplay %s # audio/rn-mpeg; /usr/local/lib/RealPlayer/realplay %s # audio/scpls; /usr/local/lib/RealPlayer/realplay %s # audio/vnd.rn-realaudio; /usr/local/lib/RealPlayer/realplay %s # audio/wav; /usr/local/lib/RealPlayer/realplay %s # audio/x-aiff; /usr/local/lib/RealPlayer/realplay %s # audio/x-mp3; /usr/local/lib/RealPlayer/realplay %s # audio/x-mpeg; /usr/local/lib/RealPlayer/realplay %s # audio/x-mpegurl; /usr/local/lib/RealPlayer/realplay %s # audio/x-mpg; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-aiff; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-au; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-realaudio; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-wav; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-windows-acm; /usr/local/lib/RealPlayer/realplay %s # audio/x-pn-windows-pcm; /usr/local/lib/RealPlayer/realplay %s # audio/x-realaudio-secure; /usr/local/lib/RealPlayer/realplay %s # audio/x-realaudio; /usr/local/lib/RealPlayer/realplay %s # audio/x-rn-3gpp-amr; /usr/local/lib/RealPlayer/realplay %s # audio/x-scpls; /usr/local/lib/RealPlayer/realplay %s # audio/x-wav; /usr/local/lib/RealPlayer/realplay %s # image/vnd.rn-realpix; /usr/local/lib/RealPlayer/realplay %s # image/vnd.rn-realpix; /usr/local/lib/RealPlayer/realplay %s # text/vnd.rn-realtext; /usr/local/lib/RealPlayer/realplay %s # video/3gpp-encrypted; /usr/local/lib/RealPlayer/realplay %s # video/3gpp; /usr/local/lib/RealPlayer/realplay %s # video/vnd.rn-realvideo-secure; /usr/local/lib/RealPlayer/realplay %s # video/vnd.rn-realvideo; /usr/local/lib/RealPlayer/realplay %s