This patch series does the following things: Firstly it basically makes the imap-send command usable again since it was broken because of not being able to correctly parse the config file. Further it adds support for OAuth2.0 and PLAIN authentication to git imap-send. Last, it does some minor improvements including adding the ability to specify the folder using the command line and set a default between curl and openssl using the config. P.S.: I am surprised this thing even exists xD. v2: - Added support for OAuth2.0 with curl. - Fixed the memory leak in case auth_cram_md5 fails. v3: - Improve wording in first patch - Change misleading message if OAuth2.0 is used without OpenSSL v4: - Add PLAIN authentication mechanism for OpenSSL - Improved wording in the first patch a bit more v5: - Add ability to specify destination folder using the command line - Add ability to set a default between curl and openssl using the config v6: - Fix minor mistakes in --folder documentation Aditya Garg (6): imap-send: fix bug causing cfg->folder being set to NULL imap-send: add support for OAuth2.0 authentication imap-send: add PLAIN authentication method to OpenSSL imap-send: fix memory leak in case auth_cram_md5 fails imap-send: enable specifying the folder using the command line imap-send: enable user to choose between libcurl and openssl using the config Documentation/config/imap.adoc | 17 +- Documentation/git-imap-send.adoc | 65 +++++-- imap-send.c | 279 +++++++++++++++++++++++++++++-- 3 files changed, 333 insertions(+), 28 deletions(-) Range-diff: -: ---------- > 1: 4757d0305d imap-send: fix bug causing cfg->folder being set to NULL -: ---------- > 2: f5ad01abc5 imap-send: add support for OAuth2.0 authentication -: ---------- > 3: e3dc19dc49 imap-send: add PLAIN authentication method to OpenSSL -: ---------- > 4: 11f7ac1325 imap-send: fix memory leak in case auth_cram_md5 fails 1: 62edbcfc6e ! 5: f6e7a5498e imap-send: enable specifying the folder using the command line @@ Documentation/config/imap.adoc Command used to set up a tunnel to the IMAP server through which ## Documentation/git-imap-send.adoc ## +@@ Documentation/git-imap-send.adoc: git-imap-send - Send a collection of patches from stdin to an IMAP folder + SYNOPSIS + -------- + [verse] +-'git imap-send' [-v] [-q] [--[no-]curl] ++'git imap-send' [-v] [-q] [--[no-]curl] [(--folder|-f) <folder>] + + + DESCRIPTION + ----------- +-This command uploads a mailbox generated with 'git format-patch' ++This command uploads a mailbox generated with `git format-patch` + into an IMAP drafts folder. This allows patches to be sent as + other email is when using mail clients that cannot read mailbox + files directly. The command also works with any general mailbox +-in which emails have the fields "From", "Date", and "Subject" in ++in which emails have the fields 'From', 'Date', and 'Subject' in + that order. + + Typical usage is something like: + +-git format-patch --signoff --stdout --attach origin | git imap-send ++------ ++$ git format-patch --signoff --stdout --attach origin | git imap-send ++------ + + + OPTIONS @@ Documentation/git-imap-send.adoc: OPTIONS --quiet:: Be quiet. +-f <folder>:: -+--folder <folder>:: ++--folder=<folder>:: + Specify the folder in which the emails have to saved. -+ For example: `--folder [Gmail]/Drafts` or `-f INBOX/Drafts`. ++ For example: `--folder=[Gmail]/Drafts` or `-f INBOX/Drafts`. + --curl:: Use libcurl to communicate with the IMAP server, unless tunneling @@ imap-send.c static int use_curl = USE_CURL_DEFAULT; +static char *opt_folder = NULL; - static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] < <mbox>", NULL }; +-static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] < <mbox>", NULL }; ++static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] [(--folder|-f) <folder>] < <mbox>", NULL }; static struct option imap_send_options[] = { OPT__VERBOSITY(&verbosity), 2: 245cc89cca = 6: 4769924781 imap-send: enable user to choose between libcurl and openssl using the config 3: 4b91d3bf89 < -: ---------- fix -- 2.43.0