From 4c508c4ad9902e935a65abc840a43acaa91ea061 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 6 Nov 2014 22:08:53 -0800 Subject: [PATCH] ssoma-mda: Support name-less From: headers For example: >>> email.utils.parseaddr('alice@example.net') ('', 'alice@example.net') Now folks with: From: alice@example.net will be stored in the Git commit as: "alice@example.net" --- ssoma-mda | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssoma-mda b/ssoma-mda index c5aedf4..99d62b1 100755 --- a/ssoma-mda +++ b/ssoma-mda @@ -220,6 +220,8 @@ def get_author(message): """Create a pygit2.Signature for the message author.""" author_name, author_email = _email_utils.parseaddr( message['From']) + if not author_name: + author_name = author_email.split('@')[0] date = message['Date'] datetime = _email_utils.parsedate_to_datetime(date) time = int(datetime.timestamp()) -- 2.26.2