comparison roundup/mailgw.py @ 3724:b4d655b2aacf

E-mail subject line prefix delimiter configuration was being ignored
author Richard Jones <richard@users.sourceforge.net>
date Thu, 05 Oct 2006 23:08:21 +0000
parents 35811df7c783
children ee73abcc95d2
comparison
equal deleted inserted replaced
3723:e0d13120a330 3724:b4d655b2aacf
70 set() method to add the message to the item's spool; in the second case we 70 set() method to add the message to the item's spool; in the second case we
71 are calling the create() method to create a new node). If an auditor raises 71 are calling the create() method to create a new node). If an auditor raises
72 an exception, the original message is bounced back to the sender with the 72 an exception, the original message is bounced back to the sender with the
73 explanatory message given in the exception. 73 explanatory message given in the exception.
74 74
75 $Id: mailgw.py,v 1.177 2006-08-11 01:41:25 richard Exp $ 75 $Id: mailgw.py,v 1.178 2006-10-05 23:08:20 richard Exp $
76 """ 76 """
77 __docformat__ = 'restructuredtext' 77 __docformat__ = 'restructuredtext'
78 78
79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
80 import time, random, sys, logging 80 import time, random, sys, logging
610 610
611 # Matches subjects like: 611 # Matches subjects like:
612 # Re: "[issue1234] title of issue [status=resolved]" 612 # Re: "[issue1234] title of issue [status=resolved]"
613 open, close = config['MAILGW_SUBJECT_SUFFIX_DELIMITERS'] 613 open, close = config['MAILGW_SUBJECT_SUFFIX_DELIMITERS']
614 delim_open = re.escape(open) 614 delim_open = re.escape(open)
615 if delim_open in '[(': delim_open = '\\' + delim_open
615 delim_close = re.escape(close) 616 delim_close = re.escape(close)
616 subject_re = re.compile(r''' 617 if delim_close in '[(': delim_close = '\\' + delim_close
618 subject_re = r'''
617 (?P<refwd>\s*\W?\s*(fw|fwd|re|aw)\W\s*)*\s* # Re: 619 (?P<refwd>\s*\W?\s*(fw|fwd|re|aw)\W\s*)*\s* # Re:
618 (?P<quote>")? # Leading " 620 (?P<quote>")? # Leading "
619 (\[(?P<classname>[^\d\s]+) # [issue.. 621 (%s(?P<classname>[^\d\s]+) # [issue..
620 (?P<nodeid>\d+)? # ..1234] 622 (?P<nodeid>\d+)? # ..1234]
621 \])?\s* 623 %s)?\s*
622 (?P<title>[^%s]+)? # issue title 624 (?P<title>[^%s]+)? # issue title
623 "? # Trailing " 625 "? # Trailing "
624 (?P<argswhole>%s(?P<args>.+?)%s)? # [prop=value] 626 (?P<argswhole>%s(?P<args>.+?)%s)? # [prop=value]
625 '''%(delim_open, delim_open, delim_close), 627 '''%(delim_open, delim_close, delim_open, delim_open, delim_close)
626 re.IGNORECASE|re.VERBOSE) 628 subject_re = re.compile(subject_re, re.IGNORECASE|re.VERBOSE)
627 629
628 # figure subject line parsing modes 630 # figure subject line parsing modes
629 pfxmode = config['MAILGW_SUBJECT_PREFIX_PARSING'] 631 pfxmode = config['MAILGW_SUBJECT_PREFIX_PARSING']
630 sfxmode = config['MAILGW_SUBJECT_SUFFIX_PARSING'] 632 sfxmode = config['MAILGW_SUBJECT_SUFFIX_PARSING']
631 633

Roundup Issue Tracker: http://roundup-tracker.org/