Currently, imap-send allows the user to choose between libcurl and openssl in case Git is compiled with both libraries only using the command line, and no option to set a default using the config is available. Add support for the same. Signed-off-by: Aditya Garg <gargaditya08@xxxxxxxx> --- Documentation/config/imap.adoc | 7 +++++++ Documentation/git-imap-send.adoc | 4 ++-- imap-send.c | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/config/imap.adoc b/Documentation/config/imap.adoc index 829d9e0bac..608c0be7ab 100644 --- a/Documentation/config/imap.adoc +++ b/Documentation/config/imap.adoc @@ -25,6 +25,13 @@ imap.port:: Defaults to 143 for imap:// hosts and 993 for imaps:// hosts. Ignored when imap.tunnel is set. +imap.usecurl:: + A boolean to choose whether to use libcurl or not to communicate + with the IMAP server. + Ignored if Git was built without `USE_CURL_FOR_IMAP_SEND` option + or with `NO_OPENSSL` option set. + `--[no]-curl` argument will override this option. + imap.sslverify:: A boolean to enable/disable verification of the server certificate used by the SSL/TLS connection. Default is `true`. Ignored when diff --git a/Documentation/git-imap-send.adoc b/Documentation/git-imap-send.adoc index de3613928f..efaa2b774e 100644 --- a/Documentation/git-imap-send.adoc +++ b/Documentation/git-imap-send.adoc @@ -44,12 +44,12 @@ OPTIONS --curl:: Use libcurl to communicate with the IMAP server, unless tunneling - into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND + into it. Ignored if Git was built without the `USE_CURL_FOR_IMAP_SEND` option set. --no-curl:: Talk to the IMAP server using git's own IMAP routines instead of - using libcurl. Ignored if Git was built with the NO_OPENSSL option + using libcurl. Ignored if Git was built with the `NO_OPENSSL` option set. diff --git a/imap-send.c b/imap-send.c index e062758198..90819eb856 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1559,6 +1559,8 @@ static int git_imap_config(const char *var, const char *val, return git_config_string(&cfg->auth_method, var, val); } else if (!strcmp("imap.port", var)) { cfg->port = git_config_int(var, val, ctx->kvi); + } else if (!strcmp("imap.usecurl", var)) { + use_curl = git_config_bool(var, val); } else if (!strcmp("imap.host", var)) { if (!val) { return config_error_nonbool(var); -- 2.43.0