Mercurial > p > roundup > code
diff roundup/roundupdb.py @ 5098:99e289359798
issue2550803: Replying to NOSY mail goes to the tracker through
reply-to, not original message author.
Created new [tracker] replyto_address config.ini option to allow:
1) setting reply-to header to the tracker
2) setting reply-to header to the address of the author
of the change
3) setting it to a fixed address (like noreply@some.place)
Proposal by Peter Funk (pefu) in discussion with Tom Ekberg
(tekberg).
I chose to re-retrieve the email address for the author from the
database rather than adding a new variable. Also managed to make
a test case for each of the three settings.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 26 Jun 2016 00:36:23 -0400 |
| parents | 786f0581bc90 |
| children | 8901cc4ef0e0 |
line wrap: on
line diff
--- a/roundup/roundupdb.py Sat Jun 25 22:28:19 2016 -0400 +++ b/roundup/roundupdb.py Sun Jun 26 00:36:23 2016 -0400 @@ -532,8 +532,18 @@ message = mailer.get_standard_message(multipart=message_files) - # set reply-to to the tracker - message['Reply-To'] = tracker_name + # set reply-to as requested by config option TRACKER_REPLYTO_ADDRESS + replyto_config = self.db.config.TRACKER_REPLYTO_ADDRESS + if replyto_config: + if replyto_config == "AUTHOR": + # note that authaddr at this point is already surrounded by < >, so + # get the original address from the db as nice_send_header adds < > + replyto_addr = nice_sender_header(authname, users.get(authid, 'address', ''), charset) + else: + replyto_addr = replyto_config + else: + replyto_addr = tracker_name + message['Reply-To'] = replyto_addr # message ids if messageid:
