summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/bin
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-08-01 16:05:37 +1000
committerJeremy Kerr <jk@ozlabs.org>2009-08-01 16:08:05 +1000
commit7d9334e879857f8a380bc9509b6cbf9972cecc25 (patch)
tree2a9e0d876b62d569bb829ebbd083f849f8c86d7d /apps/patchwork/bin
parentd9afef53a2102e5a4deba9953749e2bb5c8df486 (diff)
downloadpatchwork-7d9334e879857f8a380bc9509b6cbf9972cecc25.tar.bz2
patchwork-7d9334e879857f8a380bc9509b6cbf9972cecc25.tar.xz
parser: allow short-form List-Id headers
Some lists (eg, nongnu.org) have short-form List-Id headers. For example: List-Id: qemu-devel.nongnu.org Although RFC 2919 prescribes that: list-id-header = "List-ID:" [phrase] "<" list-id ">" CRLF we should allow for these headers anyway. Based on an original patch from "J.H." <warthog9@kernel.org>. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/bin')
-rwxr-xr-xapps/patchwork/bin/parsemail.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py
index 7f6727f..68bd94c 100755
--- a/apps/patchwork/bin/parsemail.py
+++ b/apps/patchwork/bin/parsemail.py
@@ -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