diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-08-23 13:29:02 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-08-23 13:29:02 -0400 |
commit | 7b8cd8047d3c17b08ad888e5bf525bdcb9cc6bbd (patch) | |
tree | d660be26429f3f88eb21dc702e45ba072a88361c /b4/__init__.py | |
parent | ae63faa8e546381ab16f18bdfeb66a9cee86c88b (diff) | |
download | b4-7b8cd8047d3c17b08ad888e5bf525bdcb9cc6bbd.tar.gz |
ez: only use web endpoint when sending patches
Force the use of smtp server when sending anything other than patches
(e.g. b4 ty automated responses).
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/__init__.py')
-rw-r--r-- | b4/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 2b70c38..4e005af 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -2879,8 +2879,8 @@ def patchwork_set_state(msgids: List[str], state: str) -> bool: def send_mail(smtp: Union[smtplib.SMTP, smtplib.SMTP_SSL, None], msgs: Sequence[email.message.Message], fromaddr: Optional[str], destaddrs: Optional[Union[set, list]] = None, patatt_sign: bool = False, dryrun: bool = False, - maxheaderlen: Optional[int] = None, - output_dir: Optional[str] = None) -> Optional[int]: + maxheaderlen: Optional[int] = None, output_dir: Optional[str] = None, + use_web_endpoint: bool = False) -> Optional[int]: tosend = list() if output_dir is not None: @@ -2945,7 +2945,8 @@ def send_mail(smtp: Union[smtplib.SMTP, smtplib.SMTP_SSL, None], msgs: Sequence[ # Do we have an endpoint defined? config = get_main_config() endpoint = config.get('send-endpoint-web') - if endpoint: + if use_web_endpoint and endpoint: + logger.info('---') logger.info('Sending via web endpoint %s', endpoint) req = { 'action': 'receive', |