diff --git a/CHANGELOG b/CHANGELOG index b127bb9f..e9c430f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,3 +37,5 @@ Andreas Kotowicz. 2010-01-20 r149 Issue #126 Reports didn't work with transalations. 2010-01-20 r150 Issue #127 Add german transalation, courtesy of openinformation.org + +2009-01-20 r151 Issue #128 If queue name has a dash in it, email imported failed. Thanks to enix.org for the patch. diff --git a/management/commands/get_email.py b/management/commands/get_email.py index 5867455f..c0a72ec9 100644 --- a/management/commands/get_email.py +++ b/management/commands/get_email.py @@ -164,10 +164,10 @@ def ticket_from_message(message, queue, quiet): return False return True - regex = re.compile("^\[[A-Za-z0-9]+-\d+\]") - if regex.match(subject): + matchobj = re.match(r"^\[(?P[-A-Za-z0-9]+)-(?P\d+)\]", subject) + if matchobj: # This is a reply or forward. - ticket = re.match(r"^\[(?P[A-Za-z0-9]+)-(?P\d+)\]", subject).group('id') + ticket = matchobj.group('id') else: ticket = None