Bläddra i källkod

Initial script that does the appropriate parsing

Joe Ceresini 7 år sedan
förälder
incheckning
a54354e763
1 ändrade filer med 31 tillägg och 0 borttagningar
  1. 31 0
      do-parse.py

+ 31 - 0
do-parse.py

@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+from mailparse import parse_maildir_inbox
+
+
+#####################################################
+## Mail parsers here
+#####################################################
+
+# AWS support cases update appropriate RightNow tickets
+def parser_aws_support_case_update(msg):
+	return True
+
+# Known garbage, simply delete
+def parser_delete(msg):
+	return True
+
+
+#####################################################
+## Mapping of incoming email subjets to parsers
+#####################################################
+
+subject_parsers = [
+	( r"\[Case ([0-9]+)\]", parser_aws_support_case_update ),
+	( r"Welcome to Amazon Web Services", parser_delete ),
+	( r"Your AWS Account is Ready", parser_delete )
+]
+
+if __name__ == "__main__":
+
+	parse_maildir_inbox('/home/incoming/Maildir',subject_parsers)