summaryrefslogtreecommitdiffstats
path: root/bin/attachment_mimetypes.py
blob: ede5fcb39fb9720fa8b1360549459d6acf7b1893 (plain)
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
mimetypes = {
# ODF
    'application/vnd.oasis.opendocument.base': 'odb',
    'application/vnd.oasis.opendocument.database': 'odb',
    'application/vnd.oasis.opendocument.chart': 'odc',
    'application/vnd.oasis.opendocument.chart-template': 'otc',
    'application/vnd.oasis.opendocument.formula': 'odf',
    'application/vnd.oasis.opendocument.formula-template': 'otf',
    'application/vnd.oasis.opendocument.graphics': 'odg',
    'application/vnd.oasis.opendocument.graphics-template': 'otg',
    'application/vnd.oasis.opendocument.graphics-flat-xml': 'fodg',
    'application/vnd.oasis.opendocument.presentation': 'odp',
    'application/vnd.oasis.opendocument.presentation-template': 'otp',
    'application/vnd.oasis.opendocument.presentation-flat-xml': 'fodp',
    'application/vnd.oasis.opendocument.spreadsheet': 'ods',
    'application/vnd.oasis.opendocument.spreadsheet-template': 'ots',
    'application/vnd.oasis.opendocument.spreadsheet-flat-xml': 'fods',
    'application/vnd.oasis.opendocument.text': 'odt',
    'application/vnd.oasis.opendocument.text-flat-xml': 'fodt',
    'application/vnd.oasis.opendocument.text-master': 'odm',
    'application/vnd.oasis.opendocument.text-template': 'ott',
    'application/vnd.oasis.opendocument.text-master-template': 'otm',
    'application/vnd.oasis.opendocument.text-web': 'oth',
# OOo XML
    'application/vnd.sun.xml.base': 'odb',
    'application/vnd.sun.xml.calc': 'sxc',
    'application/vnd.sun.xml.calc.template': 'stc',
    'application/vnd.sun.xml.chart': 'sxs',
    'application/vnd.sun.xml.draw': 'sxd',
    'application/vnd.sun.xml.draw.template': 'std',
    'application/vnd.sun.xml.impress': 'sxi',
    'application/vnd.sun.xml.impress.template': 'sti',
    'application/vnd.sun.xml.math': 'sxm',
    'application/vnd.sun.xml.writer': 'sxw',
    'application/vnd.sun.xml.writer.global': 'sxg',
    'application/vnd.sun.xml.writer.template': 'stw',
    'application/vnd.sun.xml.writer.web': 'stw',
# MSO
    'application/rtf': 'rtf',
    'text/rtf': 'rtf',
    'application/msword': 'doc',
    'application/vnd.ms-powerpoint': 'ppt',
    'application/vnd.ms-excel': 'xls',
    'application/vnd.ms-excel.sheet.binary.macroEnabled.12': 'xlsb',
    'application/vnd.ms-excel.sheet.macroEnabled.12': 'xlsm',
    'application/vnd.ms-excel.template.macroEnabled.12': 'xltm',
    'application/vnd.ms-powerpoint.presentation.macroEnabled.12': 'pptm',
    'application/vnd.ms-powerpoint.slide.macroEnabled.12': 'sldm',
    'application/vnd.ms-powerpoint.slideshow.macroEnabled.12': 'ppsm',
    'application/vnd.ms-powerpoint.template.macroEnabled.12': 'potm',
    'application/vnd.ms-word.document.macroEnabled.12': 'docm',
    'application/vnd.ms-word.template.macroEnabled.12': 'dotm',
    'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',
    'application/vnd.openxmlformats-officedocument.spreadsheetml.template': 'xltx',
    'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',
    'application/vnd.openxmlformats-officedocument.presentationml.template': 'potx',
    'application/vnd.openxmlformats-officedocument.presentationml.slideshow': 'ppsx',
    'application/vnd.openxmlformats-officedocument.presentationml.slide': 'sldx',
    'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',
    'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'dotx',
    'application/vnd.visio': 'vsd',
    'application/visio.drawing': 'vsd',
    'application/vnd.visio2013': 'vsdx',
    'application/vnd.visio.xml': 'vdx',
    'application/x-mspublisher': 'pub',
#WPS Office
    'application/wps-office.doc': 'doc',
    'application/wps-office.docx': 'docx',
    'application/wps-office.xls': 'xls',
    'application/wps-office.xlsx': 'xlsx',
    'application/wps-office.ppt': 'ppt',
    'application/wps-office.pptx': 'pptx',
# W3C
    'application/xhtml+xml': 'xhtml',
    'application/mathml+xml': 'mml',
    'text/html': 'html',
    'application/docbook+xml': 'docbook',
# misc
    'text/csv': 'csv',
    'text/spreadsheet': 'slk',
    'application/x-qpro': 'qpro',
    'application/x-dbase': 'dbf',
    'application/vnd.corel-draw': 'cdr',
    'application/vnd.lotus-wordpro': 'lwp',
    'application/vnd.lotus-1-2-3': 'wks',
    'application/vnd.wordperfect': 'wpd',
    'application/wordperfect5.1': 'wpd',
    'application/vnd.ms-works': 'wps',
    'application/clarisworks' : 'cwk',
    'application/macwriteii' : 'mw',
    'application/vnd.apple.keynote': 'key',
    'application/vnd.apple.numbers': 'numbers',
    'application/vnd.apple.pages': 'pages',
    'application/x-iwork-keynote-sffkey': 'key',
    'application/x-iwork-numbers-sffnumbers': 'numbers',
    'application/x-iwork-pages-sffpages': 'pages',
    'application/x-hwp': 'hwp',
    'application/x-aportisdoc': 'pdb',
    'application/prs.plucker' : 'pdb_plucker',
    'application/vnd.palm' : 'pdb_palm',
    'application/x-sony-bbeb' : 'lrf',
    'application/x-pocket-word': 'psw',
    'application/x-t602': '602',
    'application/x-fictionbook+xml': 'fb2',
    'application/x-abiword': 'abw',
    'application/x-pagemaker': 'pmd',
    'application/x-gnumeric': 'gnumeric',
    'application/vnd.stardivision.calc': 'sdc',
    'application/vnd.stardivision.draw': 'sda',
    'application/vnd.stardivision.writer': 'sdw',
    'application/x-starcalc': 'sdc',
    'application/x-stardraw': 'sdd',
    'application/x-starwriter': 'sdw',
# relatively uncommon image mimetypes
    'image/x-freehand': 'fh',
    'image/cgm': 'cgm',
    'image/tif': 'tiff',
    'image/tiff': 'tiff',
    'image/vnd.dxf': 'dxf',
    'image/emf': 'emf',
    'image/x-emf': 'emf',
    'image/x-targa': 'tga',
    'image/x-sgf': 'sgf',
    'image/x-svm': 'svm',
    'image/wmf': 'wmf',
    'image/x-wmf': 'wmf',
    'image/x-pict': 'pict',
    'image/x-cmx': 'cmx',
    'image/svg+xml': 'svg',
    'image/bmp': 'bmp',
    'image/x-ms-bmp': 'bmp',
    'image/x-MS-bmp': 'bmp',
    'image/x-wpg': 'wpg',
    'image/x-eps': 'eps',
    'image/x-met': 'met',
    'image/x-portable-bitmap': 'pbm',
    'image/x-photo-cd': 'pcd',
    'image/x-pcx': 'pcx',
    'image/x-portable-graymap': 'pgm',
    'image/x-portable-pixmap': 'ppm',
    'image/vnd.adobe.photoshop': 'psd',
    'image/x-cmu-raster': 'ras',
    'image/x-sun-raster': 'ras',
    'image/x-xbitmap': 'xbm',
    'image/x-xpixmap': 'xpm',
}

# disabled for now, this would download gigs of pngs/jpegs...
common_noncore_mimetypes = {
# graphics
    'image/gif': 'gif',
    'image/jpeg': 'jpeg',
    'image/png': 'png',
# pdf, etc.
    'application/pdf': 'pdf',
}