From 4b693fe7edc1f0d42109291284e3ad822725923e Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 10 Apr 2020 16:05:54 -0400 Subject: Use ~/.signature if it exists for tpt defaults If we find a ~/.signature, then use it for making a default ${signature} value, otherwise make a "Name " boring one. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'b4/__init__.py') diff --git a/b4/__init__.py b/b4/__init__.py index a49f439..d432ab1 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -643,6 +643,8 @@ class LoreMessage: fromdata = email.utils.getaddresses([str(x) for x in self.msg.get_all('from', [])])[0] self.fromname = fromdata[0] self.fromemail = fromdata[1] + if not len(self.fromname.strip()): + self.fromname = self.fromemail except IndexError: pass -- cgit v1.2.3