aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-25 12:57:07 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-25 12:57:07 -0400
commitf2eacc4dbcb8f976ab12570c0a3c6d53bc3c1c23 (patch)
treecb85453f996c2fbcf22700a13134d246af4f1a50
parent422db9f1e80e04e559ba5a6c5458c693d29b4e05 (diff)
downloadb4-f2eacc4dbcb8f976ab12570c0a3c6d53bc3c1c23.tar.gz
Handle situations where -f only has an email
Normally, -f would be 'Some Service <service@example.org>', but in case it's just "service@example.org", wrap it in angle brackets properly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/pr.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/b4/pr.py b/b4/pr.py
index 04feeae..86d039c 100644
--- a/b4/pr.py
+++ b/b4/pr.py
@@ -298,6 +298,8 @@ def explode(gitdir, lmsg, mailfrom=None, retrieve_links=True, fpopts=None):
allcc.append(fromaddr)
if realname:
# Use "Name via Foo" notation
+ if mailfrom.find('@') > 0 > mailfrom.find('<'):
+ mailfrom = f'<{mailfrom}>'
mailfrom = f'{realname} via {mailfrom}'
config = b4.get_main_config()