comparison roundup/mailgw.py @ 3645:ff32acc965da

match incoming mail In-Reply-To against existing messages... ...when no issue id is specified in the Subject
author Richard Jones <richard@users.sourceforge.net>
date Thu, 03 Aug 2006 00:50:06 +0000
parents 1113e1456093
children 35811df7c783
comparison
equal deleted inserted replaced
3644:f35ece8f8ff7 3645:ff32acc965da
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.175 2006-04-06 06:01:35 a1s Exp $ 75 $Id: mailgw.py,v 1.176 2006-08-03 00:50:06 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
714 if pfxmode == 'none': 714 if pfxmode == 'none':
715 nodeid = None 715 nodeid = None
716 else: 716 else:
717 nodeid = m.group('nodeid') 717 nodeid = m.group('nodeid')
718 718
719 # try in-reply-to to match the message if there's no nodeid
720 inreplyto = message.getheader('in-reply-to') or ''
721 if nodeid is None and inreplyto:
722 l = self.db.getclass('msg').stringFind(inreplyto=inreplyto)
723 if l:
724 nodeid = l[0]
725
719 # title is optional too 726 # title is optional too
720 title = m.group('title') 727 title = m.group('title')
721 if title: 728 if title:
722 title = title.strip() 729 title = title.strip()
723 else: 730 else:
928 935
929 # 936 #
930 # handle message-id and in-reply-to 937 # handle message-id and in-reply-to
931 # 938 #
932 messageid = message.getheader('message-id') 939 messageid = message.getheader('message-id')
933 inreplyto = message.getheader('in-reply-to') or ''
934 # generate a messageid if there isn't one 940 # generate a messageid if there isn't one
935 if not messageid: 941 if not messageid:
936 messageid = "<%s.%s.%s%s@%s>"%(time.time(), random.random(), 942 messageid = "<%s.%s.%s%s@%s>"%(time.time(), random.random(),
937 classname, nodeid, config['MAIL_DOMAIN']) 943 classname, nodeid, config['MAIL_DOMAIN'])
938 944

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