Skip to content

Commit 4f83e61

Browse files
author
Richard Jones
committed
re-open the database as the author in mail handling
1 parent dbf37c9 commit 4f83e61

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Fixed:
3636
. fixed nosy reaction and author copy handling
3737
. errors in nosy reaction will be propogated now (were effectively being
3838
squashed)
39-
39+
. re-open the database as the author in mail handling
4040

4141
2001-10-23 - 0.3.0 pre 3
4242
Feature:

roundup-mailgw

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup-mailgw,v 1.13 2001-11-09 01:05:55 richard Exp $
19+
# $Id: roundup-mailgw,v 1.14 2001-11-13 21:44:44 richard Exp $
2020

2121
import sys, os, re, cStringIO
2222
if int(sys.version[0]) < 2:
@@ -140,7 +140,7 @@ def main(args):
140140

141141
# get a mail handler
142142
db = instance.open('admin')
143-
handler = instance.MailGW(db)
143+
handler = instance.MailGW(instance, db)
144144

145145
# if there's no more arguments, read a single message from stdin
146146
if len(args) == 2:
@@ -168,6 +168,10 @@ if __name__ == '__main__':
168168

169169
#
170170
# $Log: not supported by cvs2svn $
171+
# Revision 1.13 2001/11/09 01:05:55 richard
172+
# Fixed bug #479511 ] mailgw to pop once engelbert gruber tested the POP
173+
# gateway.
174+
#
171175
# Revision 1.12 2001/11/08 05:16:55 richard
172176
# Rolled roundup-popgw into roundup-mailgw. Cleaned mailgw up significantly,
173177
# tested unix mailbox some more. POP still untested.

roundup/mailgw.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class node. Any parts of other types are each stored in separate files
7272
an exception, the original message is bounced back to the sender with the
7373
explanatory message given in the exception.
7474
75-
$Id: mailgw.py,v 1.32 2001-11-12 22:04:29 richard Exp $
75+
$Id: mailgw.py,v 1.33 2001-11-13 21:44:44 richard Exp $
7676
'''
7777

7878

@@ -114,7 +114,8 @@ def getPart(self):
114114
r'\s*(?P<title>[^\[]+)(\[(?P<args>.+?)\])?', re.I)
115115

116116
class MailGW:
117-
def __init__(self, db):
117+
def __init__(self, instance, db):
118+
self.instance = instance
118119
self.db = db
119120

120121
def main(self, fp):
@@ -294,6 +295,11 @@ def handle_message(self, message):
294295
# handle the users
295296
#
296297
author = self.db.uidFromAddress(message.getaddrlist('from')[0])
298+
# reopen the database as the author
299+
username = self.db.user.get(author, 'username')
300+
self.db.close()
301+
self.db = self.instance.open(username)
302+
# now update the recipients list
297303
recipients = []
298304
tracker_email = self.ISSUE_TRACKER_EMAIL.lower()
299305
for recipient in message.getaddrlist('to') + message.getaddrlist('cc'):
@@ -515,6 +521,9 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
515521

516522
#
517523
# $Log: not supported by cvs2svn $
524+
# Revision 1.32 2001/11/12 22:04:29 richard
525+
# oops, left debug in there
526+
#
518527
# Revision 1.31 2001/11/12 22:01:06 richard
519528
# Fixed issues with nosy reaction and author copies.
520529
#

0 commit comments

Comments
 (0)