Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: impl/memory/mail_static_lists.go

Issue 1525923002: Implement Mail service. (Closed) Base URL: https://github.com/luci/gae.git@filter_user
Patch Set: tests and words Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/mail.go ('k') | impl/memory/mail_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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",
+}
« no previous file with comments | « impl/memory/mail.go ('k') | impl/memory/mail_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698