Skip to content

Commit

Permalink
Set Reply-To header to commit author.
Browse files Browse the repository at this point in the history
  • Loading branch information
brasse committed Mar 20, 2010
1 parent 77dc893 commit a31b2fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions post_receive_email.py
Expand Up @@ -26,12 +26,13 @@ def __init__(self, smtp_host, smtp_port,
self.recipients = recipients
self.subject_prefix = subject_prefix

def send(self, subject, message):
def send(self, subject, reply_to, message):
if not self.recipients:
return

mime_text = MIMEText(message, _charset='utf-8')
mime_text['From'] = self.sender
mime_text['Reply-To'] = reply_to
mime_text['To'] = ', '.join(self.recipients)
if self.subject_prefix:
subject = '%s %s' % (self.subject_prefix, subject)
Expand Down Expand Up @@ -77,7 +78,10 @@ def process_commits(commits, mailer):
else:
subject = '%s commit %s' % (ref_name, commit_hash)
message = git_show(commit)
mailer.send(subject, message)
match = re.search(r'Author: (.+)', message)
assert match
reply_to = match.group(1)
mailer.send(subject, reply_to, message)


def get_commits(old_rev, new_rev):
Expand Down

0 comments on commit a31b2fc

Please sign in to comment.