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:46:18 -0400 |
commit | c522e95030108937c2d73244972bdc78ba6bc581 (patch) | |
tree | 56d42a434d086cb1d7f57949d7660539eae60411 | |
parent | 31a52eb49e79ff4185302f75b2e5c6559d19ecb5 (diff) | |
download | b4-stable-0.10.y.tar.gz |
Fall back on user.email if sendemail.from not setstable-0.10.y
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 37976c7..9147774 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -3055,6 +3055,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: |