go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/gae/impl/memory/mail_static_lists.go (about) 1 // Copyright 2015 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package memory 16 17 import ( 18 "go.chromium.org/luci/common/data/stringset" 19 ) 20 21 // all of these constants were imported on Mon Dec 14 18:18:00 PST 2015 from 22 // https://cloud.google.com/appengine/docs/go/mail/ 23 24 var okHeaders = stringset.NewFromSlice( 25 "In-Reply-To", 26 "List-Id", 27 "List-Unsubscribe", 28 "On-Behalf-Of", 29 "References", 30 "Resent-Date", 31 "Resent-From", 32 "Resent-To", 33 ) 34 35 var badExtensions = stringset.NewFromSlice( 36 "ade", 37 "adp", 38 "bat", 39 "chm", 40 "cmd", 41 "com", 42 "cpl", 43 "exe", 44 "hta", 45 "ins", 46 "isp", 47 "jse", 48 "lib", 49 "mde", 50 "msc", 51 "msp", 52 "mst", 53 "pif", 54 "scr", 55 "sct", 56 "shb", 57 "sys", 58 "vb", 59 "vbe", 60 "vbs", 61 "vxd", 62 "wsc", 63 "wsf", 64 "wsh", 65 ) 66 67 var extensionMapping = map[string]string{ 68 "aif": "audio/x-aiff", 69 "aifc": "audio/x-aiff", 70 "aiff": "audio/x-aiff", 71 "asc": "text/plain", 72 "au": "audio/basic", 73 "avi": "video/x-msvideo", 74 "bmp": "image/x-ms-bmp", 75 "css": "text/css", 76 "csv": "text/comma-separated-values", 77 "diff": "text/plain", 78 "doc": "application/msword", 79 "docx": "application/msword", 80 "flac": "audio/flac", 81 "gif": "image/gif", 82 "gzip": "application/x-gzip", 83 "htm": "text/html", 84 "html": "text/html", 85 "ics": "text/calendar", 86 "jpe": "image/jpeg", 87 "jpeg": "image/jpeg", 88 "jpg": "image/jpeg", 89 "kml": "application/vnd.google-earth.kml+xml", 90 "kmz": "application/vnd.google-earth.kmz", 91 "m4a": "audio/mp4", 92 "mid": "audio/mid", 93 "mov": "video/quicktime", 94 "mp3": "audio/mpeg", 95 "mp4": "video/mp4", 96 "mpe": "video/mpeg", 97 "mpeg": "video/mpeg", 98 "mpg": "video/mpeg", 99 "odp": "application/vnd.oasis.opendocument.presentation", 100 "ods": "application/vnd.oasis.opendocument.spreadsheet", 101 "odt": "application/vnd.oasis.opendocument.text", 102 "oga": "audio/ogg", 103 "ogg": "audio/ogg", 104 "ogv": "video/ogg", 105 "pdf": "application/pdf", 106 "png": "image/png", 107 "pot": "text/plain", 108 "pps": "application/vnd.ms-powerpoint", 109 "ppt": "application/vnd.ms-powerpoint", 110 "pptx": "application/vnd.ms-powerpoint", 111 "qt": "video/quicktime", 112 "rmi": "audio/mid", 113 "rss": "application/rss+xml", 114 "snd": "audio/basic", 115 "sxc": "application/vnd.sun.xml.calc", 116 "sxw": "application/vnd.sun.xml.writer", 117 "text": "text/plain", 118 "tif": "image/tiff", 119 "tiff": "image/tiff", 120 "txt": "text/plain", 121 "vcf": "text/x-vcard", 122 "wav": "audio/x-wav", 123 "wbmp": "image/vnd.wap.wbmp", 124 "xls": "application/vnd.ms-excel", 125 "xlsx": "application/vnd.ms-excel", 126 "zip": "application/zip", 127 }