@@ -130,6 +130,8 @@ def setup_parser() -> argparse.ArgumentParser:
help='Do not perform any network queries')
parser.add_argument('--no-stdin', action='store_true', default=False,
help='Disable TTY detection for stdin')
+ parser.add_argument('--use-web-endpoint', dest='send_web', action='store_true', default=False,
+ help="Force going through the web endpoint")
subparsers = parser.add_subparsers(help='sub-command help', dest='subcmd')
@@ -1459,10 +1459,8 @@ def cmd_send(cmdargs: argparse.Namespace) -> None:
pathlib.Path(cmdargs.output_dir).mkdir(parents=True, exist_ok=True)
sconfig = b4.get_sendemail_config()
- # If we have an smtp server defined, always use that instead of the endpoint
- # we may make this configurable in the future, but this almost always makes sense
endpoint = None
- if not sconfig.get('smtpserver'):
+ if not sconfig.get('smtpserver') or cmdargs.send_web:
endpoint = config.get('send-endpoint-web', '')
if not re.search(r'^https?://', endpoint):
logger.debug('Endpoint does not start with https, ignoring: %s', endpoint)
@@ -124,9 +124,10 @@ You should now be able to send patches via this web submission endpoint.
Using your own SMTP server
--------------------------
-B4 will use the ``sendemail`` section from your git configuration, but
-it only supports the most common subset of options. The vast majority of
-servers will only need the following settings::
+If there is a ``sendmail`` section in your git configuration, B4 will try use
+that by default instead of the web endpoint. Only the most common subset of
+options are supported. The vast majority of servers will only need the
+following settings::
[sendemail]
smtpServer = smtp.example.org
@@ -136,7 +137,8 @@ servers will only need the following settings::
smtpPass = [omitted]
You can also set up msmtp or a similar tool and specify the path to the
-``sendmail``-compliant binary as the value for ``smtpServer``.
+``sendmail``-compliant binary as the value for ``smtpServer``. You can force B4
+to use the web endpoint by using the ``--use-web-endpoint`` argument.
Sending your patches
--------------------