Index: impl/memory/mail_static_lists.go |
diff --git a/impl/memory/mail_static_lists.go b/impl/memory/mail_static_lists.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..87ea2408ae2b0e4b40293ff9dd69e3fe1aad6e1d |
--- /dev/null |
+++ b/impl/memory/mail_static_lists.go |
@@ -0,0 +1,159 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package memory |
+ |
+import ( |
+ "github.com/luci/luci-go/common/stringset" |
+) |
+ |
+// all of these constants were imported on Mon Dec 14 18:18:00 PST 2015 from |
+// https://cloud.google.com/appengine/docs/go/mail/ |
+ |
+var okHeaders = stringset.NewFromSlice( |
+ "In-Reply-To", |
+ "List-Id", |
+ "List-Unsubscribe", |
+ "On-Behalf-Of", |
+ "References", |
+ "Resent-Date", |
+ "Resent-From", |
+ "Resent-To", |
+) |
+ |
+var okMimeTypes = stringset.NewFromSlice( |
+ "application/msword", |
+ "application/pdf", |
+ "application/rss+xml", |
+ "application/vnd.google-earth.kml+xml", |
+ "application/vnd.google-earth.kmz", |
+ "application/vnd.ms-excel", |
+ "application/vnd.ms-powerpoint", |
+ "application/vnd.oasis.opendocument.presentation", |
+ "application/vnd.oasis.opendocument.spreadsheet", |
+ "application/vnd.oasis.opendocument.text", |
+ "application/vnd.sun.xml.calc", |
+ "application/vnd.sun.xml.writer", |
+ "application/x-gzip", |
+ "application/zip", |
+ "audio/basic", |
+ "audio/flac", |
+ "audio/mid", |
+ "audio/mp4", |
+ "audio/mpeg", |
+ "audio/ogg", |
+ "audio/x-aiff", |
+ "audio/x-wav", |
+ "image/gif", |
+ "image/jpeg", |
+ "image/png", |
+ "image/tiff", |
+ "image/vnd.wap.wbmp", |
+ "image/x-ms-bmp", |
+ "text/calendar", |
+ "text/comma-separated-values", |
+ "text/css", |
+ "text/html", |
+ "text/plain", |
+ "text/x-vcard", |
+ "video/mp4", |
+ "video/mpeg", |
+ "video/ogg", |
+ "video/quicktime", |
+ "video/x-msvideo", |
+) |
+ |
+var badExtensions = stringset.NewFromSlice( |
+ "ade", |
+ "adp", |
+ "bat", |
+ "chm", |
+ "cmd", |
+ "com", |
+ "cpl", |
+ "exe", |
+ "hta", |
+ "ins", |
+ "isp", |
+ "jse", |
+ "lib", |
+ "mde", |
+ "msc", |
+ "msp", |
+ "mst", |
+ "pif", |
+ "scr", |
+ "sct", |
+ "shb", |
+ "sys", |
+ "vb", |
+ "vbe", |
+ "vbs", |
+ "vxd", |
+ "wsc", |
+ "wsf", |
+ "wsh", |
+) |
+ |
+var extensionMapping = map[string]string{ |
+ "aif": "audio/x-aiff", |
+ "aifc": "audio/x-aiff", |
+ "aiff": "audio/x-aiff", |
+ "asc": "text/plain", |
+ "au": "audio/basic", |
+ "avi": "video/x-msvideo", |
+ "bmp": "image/x-ms-bmp", |
+ "css": "text/css", |
+ "csv": "text/comma-separated-values", |
+ "diff": "text/plain", |
+ "doc": "application/msword", |
+ "docx": "application/msword", |
+ "flac": "audio/flac", |
+ "gif": "image/gif", |
+ "gzip": "application/x-gzip", |
+ "htm": "text/html", |
+ "html": "text/html", |
+ "ics": "text/calendar", |
+ "jpe": "image/jpeg", |
+ "jpeg": "image/jpeg", |
+ "jpg": "image/jpeg", |
+ "kml": "application/vnd.google-earth.kml+xml", |
+ "kmz": "application/vnd.google-earth.kmz", |
+ "m4a": "audio/mp4", |
+ "mid": "audio/mid", |
+ "mov": "video/quicktime", |
+ "mp3": "audio/mpeg", |
+ "mp4": "video/mp4", |
+ "mpe": "video/mpeg", |
+ "mpeg": "video/mpeg", |
+ "mpg": "video/mpeg", |
+ "odp": "application/vnd.oasis.opendocument.presentation", |
+ "ods": "application/vnd.oasis.opendocument.spreadsheet", |
+ "odt": "application/vnd.oasis.opendocument.text", |
+ "oga": "audio/ogg", |
+ "ogg": "audio/ogg", |
+ "ogv": "video/ogg", |
+ "pdf": "application/pdf", |
+ "png": "image/png", |
+ "pot": "text/plain", |
+ "pps": "application/vnd.ms-powerpoint", |
+ "ppt": "application/vnd.ms-powerpoint", |
+ "pptx": "application/vnd.ms-powerpoint", |
+ "qt": "video/quicktime", |
+ "rmi": "audio/mid", |
+ "rss": "application/rss+xml", |
+ "snd": "audio/basic", |
+ "sxc": "application/vnd.sun.xml.calc", |
+ "sxw": "application/vnd.sun.xml.writer", |
+ "text": "text/plain", |
+ "tif": "image/tiff", |
+ "tiff": "image/tiff", |
+ "txt": "text/plain", |
+ "vcf": "text/x-vcard", |
+ "wav": "audio/x-wav", |
+ "wbmp": "image/vnd.wap.wbmp", |
+ "xls": "application/vnd.ms-excel", |
+ "xlsx": "application/vnd.ms-excel", |
+ "zip": "application/zip", |
+} |