git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] imap-send: check for NOLOGIN capability only when using LOGIN command

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2016, 18:43 UTC
Message-ID
<xmqqd1q0vt3z.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160408140224.GB13469@chikuwa.rhe.jp>
Kazuki Yamaguchi <k@rhe.jp> writes:
Show 6 quoted lines
> Don't check for NOLOGIN (LOGINDISABLED) capability when imap.authMethod
> is specified.
>
> LOGINDISABLED capability doesn't forbid using AUTHENTICATE, so it should
> be allowed, or we can't connect to IMAP servers which only accepts
> AUTHENTICATE command.

Makes sense. The code with this patch applied implements "An IMAP client which complies with this specification MUST NOT issue the LOGIN command if this capability is present." correctly.

Will queue.  Thanks.
Show 34 quoted lines
>
> Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
> ---
>  imap-send.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/imap-send.c b/imap-send.c
> index 2c52027c8445..30979f0c63cc 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -1095,11 +1095,6 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
>  				srvc->pass = xstrdup(cred.password);
>  		}
>  
> -		if (CAP(NOLOGIN)) {
> -			fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
> -			goto bail;
> -		}
> -
>  		if (srvc->auth_method) {
>  			struct imap_cmd_cb cb;
>  
> @@ -1123,6 +1118,11 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
>  				goto bail;
>  			}
>  		} else {
> +			if (CAP(NOLOGIN)) {
> +				fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n",
> +					srvc->user, srvc->host);
> +				goto bail;
> +			}
>  			if (!imap->buf.sock.ssl)
>  				imap_warn("*** IMAP Warning *** Password is being "
>  					  "sent in the clear\n");
Previous: Kazuki YamaguchiNext: Kazuki Yamaguchi
Message 2 of 3 in “imap-send: check for NOLOGIN capability only when using LOGIN command”
  1. 1/2 imap-send: check for NOLOGIN capability only when using LOGIN commandKazuki Yamaguchi, Apr 8, 2016
  2. Junio C HamanoApr 8, 2016
  3. 2/2 imap-send: fix CRAM-MD5 response calculationKazuki Yamaguchi, Apr 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.