diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-28 09:43:36 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-28 09:43:36 -0400 |
commit | 601fdc2a68e023812fc3b47ef3c05da63a6093f8 (patch) | |
tree | 17a64aea129e258f31c521c47e924bcfdaf9c830 | |
parent | 4d32180e8d1c107ed4b44d2476d2f95afa21b0a9 (diff) | |
download | b4-601fdc2a68e023812fc3b47ef3c05da63a6093f8.tar.gz |
Fall back on user.email if sendemail.from not set
If we don't find a sendemail.from, then fall back to using user.email
and hope for the best.
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://msgid.link/eb5d38af-ed64-38fd-2515-e489120cbb0b@linaro.org
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 16ca88b..fe03834 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -3065,6 +3065,11 @@ def get_smtp(identity: Optional[str] = None, # Limited support for smtp settings to begin with, but should cover the vast majority of cases fromaddr = sconfig.get('from') + if not fromaddr: + # We fall back to user.email + usercfg = get_user_config() + fromaddr = usercfg['email'] + server = sconfig.get('smtpserver', 'localhost') port = sconfig.get('smtpserverport', 0) try: |