summaryrefslogtreecommitdiff
path: root/manual/en/sylpheed-14.html
diff options
context:
space:
mode:
Diffstat (limited to 'manual/en/sylpheed-14.html')
-rw-r--r--manual/en/sylpheed-14.html152
1 files changed, 152 insertions, 0 deletions
diff --git a/manual/en/sylpheed-14.html b/manual/en/sylpheed-14.html
new file mode 100644
index 0000000..dde34f2
--- /dev/null
+++ b/manual/en/sylpheed-14.html
@@ -0,0 +1,152 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2<HTML>
3<HEAD>
4 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5 <TITLE>Sylpheed User's Manual: Handling MIME types</TITLE>
6 <LINK HREF="sylpheed-15.html" REL=next>
7 <LINK HREF="sylpheed-13.html" REL=previous>
8 <LINK HREF="sylpheed.html#toc14" REL=contents>
9</HEAD>
10<BODY>
11<A HREF="sylpheed-15.html">Next</A>
12<A HREF="sylpheed-13.html">Previous</A>
13<A HREF="sylpheed.html#toc14">Contents</A>
14<HR>
15<H2><A NAME="s14">14. Handling MIME types</A></H2>
16
17<H2><A NAME="ss14.1">14.1 How Sylpheed checks for Mime types</A>
18</H2>
19
20<P>When attaching a file to a message (composing a new message), the
21MIME type of the attached file is choosen based on the file extension
22from the mapping list defined in the <I>mime.types</I> file(s).
23Sylpheed defines its MIME type mapping table by loading the
24system wide MIME types file, then the user file.
25The systeme file is <I>SYSCONFDIR/mime.types</I> (SYSCONFDIR can
26be defined a compile time), or if it does not exist, <I>/etc/mime.types</I>.
27The user file is <I>$HOME/.sylpheed/mime.types</I>.
28<P>A <I>mime.types</I> file consist of one MIME type definition per line,
29each definition line starting with the name of the MIME type, followed by
30a space separated list of the corresponding file extensions.
31The file can contain empty lines, and comments start with the <CODE>#</CODE>
32character and close at line's end.
33<P>Following is a typical <I>mime.types</I> file (an extract of mine):
34<P>
35<PRE>
36# This file controls what Internet media types are sent to the client for
37# given file extension(s). Sending the correct media type to the client
38# is important so they know how to handle the content of the file.
39# The Internet media type registry is at
40# &lt;ftp://ftp.iana.org/in-notes/iana/assignments/media-types/>.
41
42# MIME type Extension
43application/mac-binhex40 hqx
44application/mac-compactpro cpt
45application/msword doc
46application/pdf pdf
47application/postscript ai eps ps
48application/rtf rtf
49application/x-bcpio bcpio
50application/x-bzip2 bz2
51application/x-csh csh
52application/x-gtar gtar
53application/x-gzip gz tgz
54application/x-kword kwd kwt
55application/x-kspread ksp
56application/x-kpresenter kpr kpt
57application/x-kchart chrt
58application/x-latex latex
59application/x-sh sh
60application/x-shar shar
61application/x-shockwave-flash swf
62application/x-tar tar
63application/x-tcl tcl
64application/x-tex tex
65application/x-texinfo texinfo texi
66application/x-troff t tr roff
67application/x-troff-man man
68application/zip zip
69audio/mpeg mpga mp2 mp3
70audio/x-aiff aif aiff aifc
71audio/x-wav wav
72image/gif gif
73image/ief ief
74image/jpeg jpeg jpg jpe
75image/png png
76image/tiff tiff tif
77text/plain asc txt
78text/rtf rtf
79text/sgml sgml sgm
80text/xml xml
81video/mpeg mpeg mpg mpe
82video/x-msvideo avi
83text/html html htm
84</PRE>
85<P>
86<P>If the file can be found or has the wrong format, Sylpheed will assume
87the default MIME type for all the attachments: <I>application/octet-stream</I>.
88In such a case, the recipients mail client may not know what application
89to use to view the attachment.
90<P>
91<H2><A NAME="ss14.2">14.2 How Sylpheed handles attachments (reception)</A>
92</H2>
93
94<P>When opening an attachment (select the attachment, right click and select
95<I>Open</I>) Sylpheed uses one of the following methods to determine
96the application to launch:
97<P>
98<UL>
99<LI>The attachment is an image: the application is the one defined by the
100<I>mime_image_viewer</I> variable of the common preferences configuration
101file (<I>$HOME/.sylpheed/sylpheedrc</I>). If no application is defined, or
102if the format of the definition is not valid, the default application
103command is <I>display</I> (ImageMagick viewer).</LI>
104<LI>The attachment is a sound file: the application is the one defined by the
105<I>mime_audio_player</I> variable of the common preferences configuration
106file (<I>$HOME/.sylpheed/sylpheedrc</I>). If no application is defined, or
107if the format of the definition is not valid, the default application
108command is <I>play</I>.</LI>
109<LI>The attachment is a HTML file: the application is the one defined by the
110<I>uri_cmd</I> variable of the common preferences configuration
111file (<I>$HOME/.sylpheed/sylpheedrc</I>). This can also be changed in the
112<I>Common preferences</I>, by changing the <I>Web browser</I> defined
113in the <I>Other</I> tab.</LI>
114<LI>Any other attachment type: Sylpheed relies on <I>metamail</I> to use
115the correct application (Sylpheed starts <I>metamail</I> giving it
116the attachment file and the MIME type taken from the mail).</LI>
117</UL>
118<P>
119<P>The binding of the applications to each MIME type is defined in the
120<I>mailcap</I> file. The systeme wide file is <I>/etc/mailcap</I>,
121while the user file is <I>$HOME/.mailcap</I>.
122<P>
123<P>In the mailcap file, there is one definition per line, big lines
124can be broken by escaping the newline with a <I>\</I> character,
125the first element of the line is the MIME type, then a semi-colon,
126(<I>;</I>), and finally the application to launch.
127The application part (right side of the semi-colon) can contain several
128shell commands separated by an escaped semi-colon (<I>\;</I>) and
129the <I>%s</I> string is replaced by the name of the file when
130launching the command.
131<P>
132<P>Following is a typical <I>mailcap</I> file (an extract of mine):
133<P>
134<PRE>
135
136image/*; ee %s
137
138video/mpeg; gtv %s
139video/*; xanim %s
140
141application/pdf; xpdf %s
142
143text/html; dillo %s
144</PRE>
145<P>
146<P>
147<HR>
148<A HREF="sylpheed-15.html">Next</A>
149<A HREF="sylpheed-13.html">Previous</A>
150<A HREF="sylpheed.html#toc14">Contents</A>
151</BODY>
152</HTML>