[PATCH] models: Don't munge the 'From' field of patches

Doug Anderson dianders at chromium.org
Sat Feb 16 10:57:21 EST 2013

At the moment patchwork always uses the official submitter name (as
patchwork understands it) as the "From" for patches that you receive.
This isn't quite what users expect and has some unfortunate

The biggest problem is that patchwork saves the "official" name for an
email address the first time it sees an email from them.  If that name
is wrong (or was missing) patchwork will be confused even if future
emails from this person are fixed.  There are similar problems if a
user changes his/her name (get married?).

It seems better to just have each patch report the actual "From" that
was used to send that patch.  We'll still return the submitter in
'X-Patchwork-Submitter' just in case someone wants it.

Reported-by: Wolfram Sang <wsa at the-dreams.de>
Signed-off-by: Doug Anderson <dianders at chromium.org>
 apps/patchwork/models.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index 86a5266..6b9baf7 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -281,13 +281,13 @@ class Patch(models.Model):
         mail['Subject'] = self.name
         mail['Date'] = email.utils.formatdate(
-        mail['From'] = unicode(self.submitter)
+        mail['X-Patchwork-Submitter'] = unicode(self.submitter)
         mail['X-Patchwork-Id'] = str(self.id)
         mail['Message-Id'] = self.msgid
         mail.set_unixfrom('From patchwork ' + self.date.ctime())
-        copied_headers = ['To', 'Cc']
+        copied_headers = ['To', 'Cc', 'From']
         orig_headers = HeaderParser().parsestr(str(self.headers))
         for header in copied_headers:
             if header in orig_headers:

More information about the Patchwork mailing list