File: mime.php3

package info (click to toggle)
imp 3%3A2.2.6-5.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,476 kB
  • ctags: 766
  • sloc: php: 4,253; sh: 831; makefile: 98; perl: 50; pascal: 15
file content (357 lines) | stat: -rw-r--r-- 11,223 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<?php

/*
  
  File: config/mime.conf
  $Author: rkrusty $
  $Revision: 1.2.2.7 $
  $Date: 2000/11/29 17:02:01 $
  
  IMP: Copyright 1998 Patrick C. Audley <paudley@blackcat.ca>
                 1999 The Horde Project <dev@lists.horde.org>
  
  This code is under the GNU Public License
  See the file COPYING in this directory
  
*/


/* MIME Type Configuration
 *
 * This file allows you to configure site-specific MIME types, and
 * control how HTML email is rendered by IMP. Please read the comments
 * carefully if you change it.  */


/* If you would like IMP to handle HTML email, please examine the last 3 examples */


/* If you're adding your own type, each entry is an array, and here
 * are what the parts control:
 *
 * $mime_actions['type/subtype'] tells the MIME engine what type the array is for
 *
 * 'action':        Determines whether a special driver needs to be called for this type.
 *                   These drivers are implemented in the mimetypes.lib file. Usually 'default'.
 *
 * 'view':          Determines whether the MIME type is viewable in a stand-alone window
 *                   (This is useful for large things like Word documents via mswordview)
 *
 * 'inline':        Determines whether IMP should display the type in the main message window
 *                   (This is useful for images or HTML or other small things)
 *
 * 'override_text': Determines if this MIME-type will display *in place of* other MIME types.
 *                   This option is not necessarily safe, but can be used well for things like
 *                   displaying HTML parts of email without the non-Rich part. (optional)
 *
 * 'download':      Determines whether the MIME-type is separately downloadable from IMP
 *                   (This is useful for almost everything, like documents, etc)
 *
 * 'icon':          Which icon to use for this MIME-type, icons in <imphome>/graphics (optional)
 *
 * 'view_function': The name of any special MIME-driver needed to view this MIME-type (optional)
 *
 * 'function':      The name of any special MIME-driver needed to download this MIME-type.
 *                   This is required only if 'action' is set to 'function'.
 */

/* For example, The first function is a generic text formatter. It
 * will take a MIME type that is actually text (like application/pgp)
 * and format it.
 *
 * The second function below display all gifs/jpgs that are 10k or
 * smaller.
 *
 * The third function will display word attachments if you have
 * mswordview. */

/********* The last section controls HTML-mail behavior *********** */

$mime_actions['application/pgp'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_text.gif'
      );

$mime_actions['application/octet-stream/delivery-status'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_mail.gif'
      );

$mime_actions['application/octet-stream/rfc822'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_mail.gif'
      );

$mime_actions['application/pdf'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => false,
      'download'        => true,
      'icon'            => 'mime_pdf.gif'
      );

$mime_actions['message/rfc822'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => false,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_mail.gif'
      );

$mime_actions['message/'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_mail.gif'
      );

$mime_actions['text/'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_text.gif'
      );

$mime_actions['text/richtext'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => false,
      'view_function'   => 'mime_view_text',
      'download'        => true,
      'icon'            => 'mime_text.gif'
      );

$mime_actions['image/'] =
array(
      'action'       => 'default',
      'function'     => 'mime_action_images',
      'view'         => true,
      'download'     => true,
      'icon'         => 'mime_image.gif'
      );

if (!empty($default->path_to_mswordview)) {
    $mime_actions['application/msword'] =
      array(
	    'action'        => 'default',
	    'view'          => true,
	    'view_function' => 'mime_view_msword',
	    'download'      => true,
	    'icon'          => 'mime_msword.gif'
	    );
}

if (!empty($default->path_to_xlHtml)) {
    $mime_actions['application/msexcel'] =
      array(
	    'action' => 'default',
	    'view' => true,
	    'view_function' => 'mime_view_xls',
	    'download' => true,
	    'icon' => 'mime_excel.gif'
	    );
	    
    $mime_actions['application/vnd.ms-excel'] =
      array(
	    'action' => 'default',
	    'view' => true,
	    'view_function' => 'mime_view_xls',
	    'download' => true,
	    'icon' => 'mime_excel.gif'
	    );
}

$mime_actions['application/x-imp-data'] =
array(
      'action'       => 'function',
      'function'     => 'mime_action_ximpdata',
      'view'         => false,
      'download'     => false,
      'icon'         => 'mime_broken.gif'
      );

$mime_actions['application/x-gtar'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_tgz',
      'download'        => true,
      'icon'            => 'mime_compressed.gif'
      );

$mime_actions['application/x-tar'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_tar',
      'download'        => true,
      'icon'            => 'mime_compressed.gif'
      );


/*** User-contributed mimetypes for various kinds of data. Uncomment
     them if you want them. ***/

// .zip - Uses zipinfo.
// By: Joao Pedro Goncalves <joaop@iscsp.utl.pt>
// Define $default->path_to_zipinfo in defaults.php3.
/*
$mime_actions['application/zip'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_zip',
      'download'        => true,
      'icon'            => 'mime_compressed.gif'
      );

$mime_actions['application/x-zip-compressed'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_zip',
      'download'        => true,
      'icon'            => 'mime_compressed.gif'
      );

*/

// .rpm - Red Hat packages.
// By: Joao Pedro Goncalves <joaop@iscsp.utl.pt>
// Define $default->path_to_rpm in defaults.php3.
/*
$mime_actions['application/x-rpm'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_rpm',
      'download'        => true,
      'icon'            => 'mime_rpm.gif'
      );

*/
// .deb - Debian packages.
// Define $default->path_to_dpkg in defaults.php3.

$mime_actions['application/x-debian-package'] =
array(
      'action'          => 'default',
      'view'            => true,
      'view_function'   => 'mime_view_deb',
      'download'        => true,
      'icon'            => 'mime_deb.gif'
      );
  


/***** HTML Email Configuration *****/

// There are multiple ways to configure IMP to view HTML sent as
// email. Here are three. It is VERY IMPORTANT to note that if you
// configure HTML to be viewed inline and set 'override_text' to true,
// it will attempt to OVERRIDE the text part of the email and replace it
// with the HTML part. This follows the behavior of most "Rich" email
// clients that send HTML mail with a text and HTML part that are
// identical except for the markup (aka multipart/alternative, but we don't
// implement _quite_ that yet).

// Viewing HTML is NOT SECURE - it can open you to attack. For 
// this reason, you can *choose* to view it, but it won't display in imp at
// all unless you change the settings.

// Thus, the default is to only allow html parts to be downloadable, and not
// viewable through IMP at all. This is for security reasons; please try and
// understand those reasons before enabling any sort of HTML viewing.
$mime_actions['text/html'] =
array(
      'action'          => 'default',
      'view'            => false,
      'inline'          => false,
      'override_text'   => false,
      'view_function'   => 'mime_view_html',
      'download'        => true,
      'icon'            => 'mime_html.gif'
      );

// Allow the HTML MIME-part to be viewed in another browser window and
// downloadable. This is the safest way to read mail and
// still have HTML mail renderable, all options are open.
// THIS IS STILL A POTENTIAL SECURITY HOLE
$mime_actions['text/html'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => false,
      'override_text'   => false,
      'view_function'   => 'mime_view_html',
      'download'        => true,
      'icon'            => 'mime_html.gif'
      );

// View the HTML MIME-part inline, overriding the text part, and be
// downloadable. This is not provably 100% safe (you may lose text).
//
// This is not secure, unfortunately, and should only be used if you
// can trust your incoming mail.
/*
$mime_actions['text/html'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'override_text'   => true,
      'view_function'   => 'mime_view_html',
      'download'        => true,
      'icon'            => 'mime_html.gif'
      );
*/

// This is my (mikeh@spark.com) favorite - HTML inline, not
// downloadable. Overrides text parts. Totally transparent. This is
// just like the previous one, but the user interface is less
// cluttered without the download option. There is the potential
// danger that we lose some text parts when we do this, but current
// HTML-email clients send the email in such a way that this doesn't
// happen as far as I know.
// 
// Unfortunately, this is not secure. Unless you only get trusted mail, (like an
// intranet, where I have my IMP), you shouldn't use this.
/*
$mime_actions['text/html'] =
array(
      'action'          => 'default',
      'view'            => true,
      'inline'          => true,
      'override_text'   => true,
      'view_function'   => 'mime_view_html',
      'download'        => false,
      'icon'            => 'mime_html.gif'
      );
*/

?>