From 7b8cd8047d3c17b08ad888e5bf525bdcb9cc6bbd Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 23 Aug 2022 13:29:02 -0400 Subject: 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 --- b4/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'b4/__init__.py') 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', -- cgit v1.2.3