Changeset 487 for trunk/email2trac.py.in


Ignore:
Timestamp:
10/11/10 14:55:59 (14 years ago)
Author:
bas
Message:

Enhancement to update-by-subject routines, closes #188

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r486 r487  
    959959                if self.parameters.ticket_update and self.parameters.ticket_update_by_subject:
    960960                               
    961                         SUBJECT_RE = re.compile(r'^(RE|AW|VS|SV):(.*:)*\s*(.*)', re.IGNORECASE)
     961                        SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE)
    962962                        result = SUBJECT_RE.search(subject)
    963963
     
    965965                                ## This is a reply
    966966                                #
    967                                 orig_subject = result.group(3)
     967                                orig_subject = result.group(1)
    968968
    969969                                self.logger.debug('subject search string: %s' %(orig_subject))
     
    995995                                        if matched_id:
    996996                                                matched_id = '#%d' % matched_id
    997                                                 return matched_id
    998 
    999                 return matched_id
     997                                                return (matched_id, orig_subject)
     998                                       
     999                                        subject = orig_subject
     1000
     1001                return (matched_id, subject)
    10001002
    10011003
     
    15961598                else:
    15971599                        self.system = 'ticket'
    1598                         result = self.ticket_update_by_subject(subject)
    1599                         if result:
    1600                                 if not self.ticket_update(m, result, spam_msg):
     1600                        (matched_id, subject) = self.ticket_update_by_subject(subject)
     1601                        if matched_id:
     1602                                if not self.ticket_update(m, matched_id, spam_msg):
    16011603                                        self.new_ticket(m, subject, spam_msg)
    16021604                        else:
Note: See TracChangeset for help on using the changeset viewer.