]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/bin/parsemail.py
parser: allow short-form List-Id headers
[patchwork] / apps / patchwork / bin / parsemail.py
index 7f6727fc79c9d7e7efaf36f303e8f3c2ee188a4d..68bd94cd37174a4f25851f2a2596cea2e56f34d9 100755 (executable)
@@ -57,11 +57,17 @@ def clean_header(header):
 
 def find_project(mail):
     project = None
-    listid_re = re.compile('.*<([^>]+)>.*', re.S)
+    listid_res = [re.compile('.*<([^>]+)>.*', re.S),
+                  re.compile('^([\S]+)$', re.S)]
 
     for header in list_id_headers:
         if header in mail:
-            match = listid_re.match(mail.get(header))
+
+            for listid_re in listid_res:
+                match = listid_re.match(mail.get(header))
+                if match:
+                    break
+
             if not match:
                 continue